max@0: // Copyright (C) 2008-2011 NICTA (www.nicta.com.au) max@0: // Copyright (C) 2008-2011 Conrad Sanderson max@0: // max@0: // This file is part of the Armadillo C++ library. max@0: // It is provided without any warranty of fitness max@0: // for any purpose. You can redistribute this file max@0: // and/or modify it under the terms of the GNU max@0: // Lesser General Public License (LGPL) as published max@0: // by the Free Software Foundation, either version 3 max@0: // of the License or (at your option) any later version. max@0: // (see http://www.opensource.org/licenses for more info) max@0: max@0: max@0: //! \addtogroup Col max@0: //! @{ max@0: max@0: //! Class for column vectors (matrices with only one column) max@0: max@0: template max@0: class Col : public Mat max@0: { max@0: public: max@0: max@0: typedef eT elem_type; max@0: typedef typename get_pod_type::result pod_type; max@0: max@0: max@0: inline Col(); max@0: inline Col(const Col& X); max@0: inline explicit Col(const uword n_elem); max@0: inline Col(const uword in_rows, const uword in_cols); max@0: max@0: inline Col(const char* text); max@0: inline const Col& operator=(const char* text); max@0: max@0: inline Col(const std::string& text); max@0: inline const Col& operator=(const std::string& text); max@0: max@0: #if defined(ARMA_USE_CXX11) max@0: inline Col(const std::initializer_list& list); max@0: inline const Col& operator=(const std::initializer_list& list); max@0: #endif max@0: max@0: max@0: inline const Col& operator=(const eT val); max@0: max@0: template inline Col(const Base& X); max@0: template inline const Col& operator=(const Base& X); max@0: max@0: inline Col( eT* aux_mem, const uword aux_length, const bool copy_aux_mem = true, const bool strict = true); max@0: inline Col(const eT* aux_mem, const uword aux_length); max@0: max@0: template max@0: inline explicit Col(const Base& A, const Base& B); max@0: max@0: template inline Col(const BaseCube& X); max@0: template inline const Col& operator=(const BaseCube& X); max@0: max@0: inline Col(const subview_cube& X); max@0: inline const Col& operator=(const subview_cube& X); max@0: max@0: inline mat_injector operator<<(const eT val); max@0: max@0: arma_inline eT& row(const uword row_num); max@0: arma_inline eT row(const uword row_num) const; max@0: max@0: arma_inline subview_col rows(const uword in_row1, const uword in_row2); max@0: arma_inline const subview_col rows(const uword in_row1, const uword in_row2) const; max@0: max@0: arma_inline subview_col subvec(const uword in_row1, const uword in_row2); max@0: arma_inline const subview_col subvec(const uword in_row1, const uword in_row2) const; max@0: max@0: arma_inline subview_col subvec(const span& row_span); max@0: arma_inline const subview_col subvec(const span& row_span) const; max@0: max@0: //arma_inline subview_col operator()(const span& row_span); max@0: //arma_inline const subview_col operator()(const span& row_span) const; max@0: max@0: max@0: inline void shed_row (const uword row_num); max@0: inline void shed_rows(const uword in_row1, const uword in_row2); max@0: max@0: inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero = true); max@0: template inline void insert_rows(const uword row_num, const Base& X); max@0: max@0: max@0: typedef eT* row_iterator; max@0: typedef const eT* const_row_iterator; max@0: max@0: inline row_iterator begin_row(const uword row_num); max@0: inline const_row_iterator begin_row(const uword row_num) const; max@0: max@0: inline row_iterator end_row (const uword row_num); max@0: inline const_row_iterator end_row (const uword row_num) const; max@0: max@0: max@0: template max@0: class fixed : public Col max@0: { max@0: private: max@0: max@0: static const bool use_extra = (fixed_n_elem > arma_config::mat_prealloc); max@0: max@0: arma_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ]; max@0: max@0: arma_inline void mem_setup(); max@0: arma_inline void change_to_row(); max@0: max@0: max@0: public: max@0: max@0: static const uword n_rows = fixed_n_elem; max@0: static const uword n_cols = 1; max@0: static const uword n_elem = fixed_n_elem; max@0: max@0: arma_inline fixed(); max@0: arma_inline fixed(const fixed& X); max@0: inline fixed(const subview_cube& X); max@0: max@0: template inline fixed(const Base& A); max@0: template inline fixed(const Base& A, const Base& B); max@0: max@0: inline fixed( eT* aux_mem, const bool copy_aux_mem = true); max@0: inline fixed(const eT* aux_mem); max@0: max@0: inline fixed(const char* text); max@0: inline fixed(const std::string& text); max@0: max@0: template inline const Col& operator=(const Base& A); max@0: max@0: inline const Col& operator=(const eT val); max@0: inline const Col& operator=(const char* text); max@0: inline const Col& operator=(const std::string& text); max@0: inline const Col& operator=(const subview_cube& X); max@0: max@0: inline subview_row operator()(const uword row_num, const span& col_span); max@0: inline const subview_row operator()(const uword row_num, const span& col_span) const; max@0: max@0: inline subview_col operator()(const span& row_span, const uword col_num ); max@0: inline const subview_col operator()(const span& row_span, const uword col_num ) const; max@0: max@0: inline subview operator()(const span& row_span, const span& col_span); max@0: inline const subview operator()(const span& row_span, const span& col_span) const; max@0: max@0: arma_inline arma_warn_unused eT& operator[] (const uword i); max@0: arma_inline arma_warn_unused eT operator[] (const uword i) const; max@0: arma_inline arma_warn_unused eT& at (const uword i); max@0: arma_inline arma_warn_unused eT at (const uword i) const; max@0: arma_inline arma_warn_unused eT& operator() (const uword i); max@0: arma_inline arma_warn_unused eT operator() (const uword i) const; max@0: max@0: arma_inline arma_warn_unused eT& at (const uword in_row, const uword in_col); max@0: arma_inline arma_warn_unused eT at (const uword in_row, const uword in_col) const; max@0: arma_inline arma_warn_unused eT& operator() (const uword in_row, const uword in_col); max@0: arma_inline arma_warn_unused eT operator() (const uword in_row, const uword in_col) const; max@0: max@0: arma_hot inline const Col& fill(const eT val); max@0: arma_hot inline const Col& zeros(); max@0: arma_hot inline const Col& ones(); max@0: }; max@0: max@0: max@0: #ifdef ARMA_EXTRA_COL_PROTO max@0: #include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_PROTO) max@0: #endif max@0: max@0: }; max@0: max@0: max@0: max@0: //! @}