Row_bones.hpp
Go to the documentation of this file.
00001 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
00002 // Copyright (C) 2008-2011 Conrad Sanderson
00003 // 
00004 // This file is part of the Armadillo C++ library.
00005 // It is provided without any warranty of fitness
00006 // for any purpose. You can redistribute this file
00007 // and/or modify it under the terms of the GNU
00008 // Lesser General Public License (LGPL) as published
00009 // by the Free Software Foundation, either version 3
00010 // of the License or (at your option) any later version.
00011 // (see http://www.opensource.org/licenses for more info)
00012 
00013 
00016 
00018 
00019 template<typename eT>
00020 class Row : public Mat<eT>
00021   {
00022   public:
00023   
00024   typedef eT                                elem_type;
00025   typedef typename get_pod_type<eT>::result pod_type;
00026   
00027   
00028   inline          Row();
00029   inline          Row(const Row<eT>& X);
00030   inline explicit Row(const uword N);
00031   inline          Row(const uword in_rows, const uword in_cols);
00032   
00033   inline                  Row(const char*        text);
00034   inline const Row& operator=(const char*        text);
00035   
00036   inline                  Row(const std::string& text);
00037   inline const Row& operator=(const std::string& text);
00038   
00039   #if defined(ARMA_USE_CXX11)
00040   inline                  Row(const std::initializer_list<eT>& list);
00041   inline const Row& operator=(const std::initializer_list<eT>& list);
00042   #endif
00043   
00044   inline const Row& operator=(const eT val);
00045 
00046   template<typename T1> inline                   Row(const Base<eT,T1>& X);
00047   template<typename T1> inline const Row&  operator=(const Base<eT,T1>& X);
00048   
00049   inline Row(      eT* aux_mem, const uword aux_length, const bool copy_aux_mem = true, const bool strict = true);
00050   inline Row(const eT* aux_mem, const uword aux_length);
00051   
00052   template<typename T1, typename T2>
00053   inline explicit Row(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
00054   
00055   template<typename T1> inline                  Row(const BaseCube<eT,T1>& X);
00056   template<typename T1> inline const Row& operator=(const BaseCube<eT,T1>& X);
00057   
00058   inline                  Row(const subview_cube<eT>& X);
00059   inline const Row& operator=(const subview_cube<eT>& X);
00060   
00061   inline mat_injector<Row> operator<<(const eT val);
00062   
00063   arma_inline eT& col(const uword col_num);
00064   arma_inline eT  col(const uword col_num) const;
00065   
00066   arma_inline       subview_row<eT> cols(const uword in_col1, const uword in_col2);
00067   arma_inline const subview_row<eT> cols(const uword in_col1, const uword in_col2) const;
00068   
00069   arma_inline       subview_row<eT> subvec(const uword in_col1, const uword in_col2);
00070   arma_inline const subview_row<eT> subvec(const uword in_col1, const uword in_col2) const;
00071   
00072   arma_inline       subview_row<eT> subvec(const span& col_span);
00073   arma_inline const subview_row<eT> subvec(const span& col_span) const;
00074   
00075   // arma_inline       subview_row<eT> operator()(const span& col_span);
00076   // arma_inline const subview_row<eT> operator()(const span& col_span) const;
00077   
00078   
00079   inline void shed_col (const uword col_num);
00080   inline void shed_cols(const uword in_col1, const uword in_col2);
00081   
00082                         inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero = true);
00083   template<typename T1> inline void insert_cols(const uword col_num, const Base<eT,T1>& X);
00084   
00085   
00086   typedef       eT*       row_iterator;
00087   typedef const eT* const_row_iterator;
00088   
00089   inline       row_iterator begin_row(const uword row_num);
00090   inline const_row_iterator begin_row(const uword row_num) const;
00091   
00092   inline       row_iterator end_row  (const uword row_num);
00093   inline const_row_iterator end_row  (const uword row_num) const;
00094   
00095   
00096   template<uword fixed_n_elem>
00097   class fixed : public Row<eT>
00098     {
00099     private:
00100     
00101     static const bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);
00102     
00103     arma_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
00104     
00105     arma_inline void mem_setup();
00106     
00107     
00108     public:
00109     
00110     static const uword n_rows = 1;
00111     static const uword n_cols = fixed_n_elem;
00112     static const uword n_elem = fixed_n_elem;
00113     
00114     arma_inline fixed();
00115     arma_inline fixed(const fixed<fixed_n_elem>& X);
00116          inline fixed(const subview_cube<eT>& X);
00117     
00118     template<typename T1>              inline fixed(const Base<eT,T1>& A);
00119     template<typename T1, typename T2> inline fixed(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
00120     
00121     inline fixed(      eT* aux_mem, const bool copy_aux_mem = true);
00122     inline fixed(const eT* aux_mem);
00123     
00124     inline fixed(const char*        text);
00125     inline fixed(const std::string& text);
00126     
00127     template<typename T1> inline const Row& operator=(const Base<eT,T1>& A);
00128     
00129     inline const Row& operator=(const eT val);
00130     inline const Row& operator=(const char*        text);
00131     inline const Row& operator=(const std::string& text);
00132     inline const Row& operator=(const subview_cube<eT>& X);
00133     
00134     inline       subview_row<eT> operator()(const uword   row_num,  const span& col_span);
00135     inline const subview_row<eT> operator()(const uword   row_num,  const span& col_span) const;
00136     
00137     inline       subview_col<eT> operator()(const span& row_span, const uword   col_num );
00138     inline const subview_col<eT> operator()(const span& row_span, const uword   col_num ) const;
00139     
00140     inline       subview<eT>     operator()(const span& row_span, const span& col_span);
00141     inline const subview<eT>     operator()(const span& row_span, const span& col_span) const;
00142     
00143     arma_inline arma_warn_unused eT& operator[] (const uword i);
00144     arma_inline arma_warn_unused eT  operator[] (const uword i) const;
00145     arma_inline arma_warn_unused eT& at         (const uword i);
00146     arma_inline arma_warn_unused eT  at         (const uword i) const;
00147     arma_inline arma_warn_unused eT& operator() (const uword i);
00148     arma_inline arma_warn_unused eT  operator() (const uword i) const;
00149     
00150     arma_inline arma_warn_unused eT& at         (const uword in_row, const uword in_col);
00151     arma_inline arma_warn_unused eT  at         (const uword in_row, const uword in_col) const;
00152     arma_inline arma_warn_unused eT& operator() (const uword in_row, const uword in_col);
00153     arma_inline arma_warn_unused eT  operator() (const uword in_row, const uword in_col) const;
00154     
00155     arma_hot inline const Row<eT>& fill(const eT val);
00156     arma_hot inline const Row<eT>& zeros();
00157     arma_hot inline const Row<eT>& ones();
00158     };
00159   
00160   
00161   #ifdef ARMA_EXTRA_ROW_PROTO
00162     #include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_PROTO)
00163   #endif
00164   
00165   };
00166 
00167 
00168 


armadillo_matrix
Author(s): Conrad Sanderson - NICTA (www.nicta.com.au), (Wrapper by Sjoerd van den Dries)
autogenerated on Tue Jan 7 2014 11:42:05