Col_proto.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2010 NICTA and the authors listed below
00002 // http://nicta.com.au
00003 // 
00004 // Authors:
00005 // - Conrad Sanderson (conradsand at ieee dot org)
00006 // 
00007 // This file is part of the Armadillo C++ library.
00008 // It is provided without any warranty of fitness
00009 // for any purpose. You can redistribute this file
00010 // and/or modify it under the terms of the GNU
00011 // Lesser General Public License (LGPL) as published
00012 // by the Free Software Foundation, either version 3
00013 // of the License or (at your option) any later version.
00014 // (see http://www.opensource.org/licenses for more info)
00015 
00016 
00017 //! \addtogroup Col
00018 //! @{
00019 
00020 //! Class for column vectors (matrices with only column)
00021 
00022 template<typename eT>
00023 class Col : public Mat<eT>, public BaseVec< eT, Col<eT> >
00024   {
00025   public:
00026   
00027   typedef eT                                elem_type;
00028   typedef typename get_pod_type<eT>::result pod_type;
00029   
00030   
00031   inline                     Col();
00032   inline explicit            Col(const u32 n_elem);
00033   inline                     Col(const u32 in_rows, const u32 in_cols);
00034   
00035   inline                     Col(const char*        text);
00036   inline const Col&    operator=(const char*        text);
00037   inline                     Col(const std::string& text);
00038   inline const Col&    operator=(const std::string& text);
00039   
00040   inline                     Col(const Col& X);
00041   inline const Col&    operator=(const Col& X);
00042   
00043   //inline explicit            Col(const Mat<eT>& X);
00044   inline                     Col(const Mat<eT>& X);
00045   inline const Col&    operator=(const Mat<eT>& X);
00046   inline const Col&   operator*=(const Mat<eT>& X);
00047   
00048   inline Col(      eT* aux_mem, const u32 aux_n_rows, const u32 aux_n_cols, const bool copy_aux_mem = true);
00049   inline Col(const eT* aux_mem, const u32 aux_n_rows, const u32 aux_n_cols);
00050   
00051   inline Col(      eT* aux_mem, const u32 aux_length, const bool copy_aux_mem = true);
00052   inline Col(const eT* aux_mem, const u32 aux_length);
00053   
00054   template<typename T1, typename T2>
00055   inline explicit Col(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
00056   
00057   inline                     Col(const subview<eT>& X);
00058   inline const Col&    operator=(const subview<eT>& X);
00059   inline const Col&   operator*=(const subview<eT>& X);
00060   
00061   inline                     Col(const subview_cube<eT>& X);
00062   inline const Col&    operator=(const subview_cube<eT>& X);
00063   inline const Col&   operator*=(const subview_cube<eT>& X);
00064   
00065   inline                     Col(const diagview<eT>& X);
00066   inline const Col&    operator=(const diagview<eT>& X);
00067   inline const Col&   operator*=(const diagview<eT>& X);
00068   
00069   arma_inline eT& row(const u32 row_num);
00070   arma_inline eT  row(const u32 row_num) const;
00071   
00072   arma_inline       subview_col<eT> rows(const u32 in_row1, const u32 in_row2);
00073   arma_inline const subview_col<eT> rows(const u32 in_row1, const u32 in_row2) const;
00074   
00075   template<typename T1, typename op_type> inline                   Col(const Op<T1, op_type>& X);
00076   template<typename T1, typename op_type> inline const Col&  operator=(const Op<T1, op_type>& X);
00077   template<typename T1, typename op_type> inline const Col& operator*=(const Op<T1, op_type>& X);
00078   
00079   template<typename T1, typename eop_type> inline                   Col(const eOp<T1, eop_type>& X);
00080   template<typename T1, typename eop_type> inline const Col&  operator=(const eOp<T1, eop_type>& X);
00081   template<typename T1, typename eop_type> inline const Col& operator*=(const eOp<T1, eop_type>& X);
00082   
00083   template<typename T1, typename op_type> inline                   Col(const mtOp<eT, T1, op_type>& X);
00084   template<typename T1, typename op_type> inline const Col&  operator=(const mtOp<eT, T1, op_type>& X);
00085   template<typename T1, typename op_type> inline const Col& operator*=(const mtOp<eT, T1, op_type>& X);
00086   
00087   template<typename T1, typename T2, typename glue_type> inline                   Col(const Glue<T1, T2, glue_type>& X);
00088   template<typename T1, typename T2, typename glue_type> inline const Col&  operator=(const Glue<T1, T2, glue_type>& X);
00089   template<typename T1, typename T2, typename glue_type> inline const Col& operator*=(const Glue<T1, T2, glue_type>& X);
00090   
00091   template<typename T1, typename T2, typename eglue_type> inline                   Col(const eGlue<T1, T2, eglue_type>& X);
00092   template<typename T1, typename T2, typename eglue_type> inline const Col&  operator=(const eGlue<T1, T2, eglue_type>& X);
00093   template<typename T1, typename T2, typename eglue_type> inline const Col& operator*=(const eGlue<T1, T2, eglue_type>& X);
00094   
00095   template<typename T1, typename T2, typename glue_type> inline                   Col(const mtGlue<eT, T1, T2, glue_type>& X);
00096   template<typename T1, typename T2, typename glue_type> inline const Col&  operator=(const mtGlue<eT, T1, T2, glue_type>& X);
00097   template<typename T1, typename T2, typename glue_type> inline const Col& operator*=(const mtGlue<eT, T1, T2, glue_type>& X);
00098   
00099   inline void  set_size(const u32 n_elem);
00100   inline void  set_size(const u32 n_rows, const u32 n_cols);
00101   
00102   template<typename eT2>
00103   inline void copy_size(const Mat<eT2>& m);
00104   
00105   inline void zeros();
00106   inline void zeros(const u32 n_elem);
00107   inline void zeros(const u32 n_rows, const u32 n_cols);
00108   
00109   inline void ones();
00110   inline void ones(const u32 n_elem);
00111   inline void ones(const u32 n_rows, const u32 n_cols);
00112   
00113   
00114   inline void load(const std::string   name, const file_type type = auto_detect, const bool print_status = true);
00115   inline void load(      std::istream& is,   const file_type type = auto_detect, const bool print_status = true);
00116   
00117   inline void quiet_load(const std::string   name, const file_type type = auto_detect);
00118   inline void quiet_load(      std::istream& is,   const file_type type = auto_detect);
00119   
00120   
00121   typedef       eT*       row_iterator;
00122   typedef const eT* const_row_iterator;
00123   
00124   inline       row_iterator begin_row(const u32 row_num);
00125   inline const_row_iterator begin_row(const u32 row_num) const;
00126   
00127   inline       row_iterator end_row  (const u32 row_num);
00128   inline const_row_iterator end_row  (const u32 row_num) const;
00129   };
00130 
00131 
00132 
00133 //! @}