Col_bones.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2011 Conrad Sanderson
3 //
4 // This file is part of the Armadillo C++ library.
5 // It is provided without any warranty of fitness
6 // for any purpose. You can redistribute this file
7 // and/or modify it under the terms of the GNU
8 // Lesser General Public License (LGPL) as published
9 // by the Free Software Foundation, either version 3
10 // of the License or (at your option) any later version.
11 // (see http://www.opensource.org/licenses for more info)
12 
13 
16 
18 
19 template<typename eT>
20 class Col : public Mat<eT>
21  {
22  public:
23 
24  typedef eT elem_type;
26 
27 
28  inline Col();
29  inline Col(const Col<eT>& X);
30  inline explicit Col(const uword n_elem);
31  inline Col(const uword in_rows, const uword in_cols);
32 
33  inline Col(const char* text);
34  inline const Col& operator=(const char* text);
35 
36  inline Col(const std::string& text);
37  inline const Col& operator=(const std::string& text);
38 
39  #if defined(ARMA_USE_CXX11)
40  inline Col(const std::initializer_list<eT>& list);
41  inline const Col& operator=(const std::initializer_list<eT>& list);
42  #endif
43 
44 
45  inline const Col& operator=(const eT val);
46 
47  template<typename T1> inline Col(const Base<eT,T1>& X);
48  template<typename T1> inline const Col& operator=(const Base<eT,T1>& X);
49 
50  inline Col( eT* aux_mem, const uword aux_length, const bool copy_aux_mem = true, const bool strict = true);
51  inline Col(const eT* aux_mem, const uword aux_length);
52 
53  template<typename T1, typename T2>
54  inline explicit Col(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
55 
56  template<typename T1> inline Col(const BaseCube<eT,T1>& X);
57  template<typename T1> inline const Col& operator=(const BaseCube<eT,T1>& X);
58 
59  inline Col(const subview_cube<eT>& X);
60  inline const Col& operator=(const subview_cube<eT>& X);
61 
62  inline mat_injector<Col> operator<<(const eT val);
63 
64  arma_inline eT& row(const uword row_num);
65  arma_inline eT row(const uword row_num) const;
66 
67  arma_inline subview_col<eT> rows(const uword in_row1, const uword in_row2);
68  arma_inline const subview_col<eT> rows(const uword in_row1, const uword in_row2) const;
69 
70  arma_inline subview_col<eT> subvec(const uword in_row1, const uword in_row2);
71  arma_inline const subview_col<eT> subvec(const uword in_row1, const uword in_row2) const;
72 
73  arma_inline subview_col<eT> subvec(const span& row_span);
74  arma_inline const subview_col<eT> subvec(const span& row_span) const;
75 
76  //arma_inline subview_col<eT> operator()(const span& row_span);
77  //arma_inline const subview_col<eT> operator()(const span& row_span) const;
78 
79 
80  inline void shed_row (const uword row_num);
81  inline void shed_rows(const uword in_row1, const uword in_row2);
82 
83  inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero = true);
84  template<typename T1> inline void insert_rows(const uword row_num, const Base<eT,T1>& X);
85 
86 
87  typedef eT* row_iterator;
88  typedef const eT* const_row_iterator;
89 
90  inline row_iterator begin_row(const uword row_num);
91  inline const_row_iterator begin_row(const uword row_num) const;
92 
93  inline row_iterator end_row (const uword row_num);
94  inline const_row_iterator end_row (const uword row_num) const;
95 
96 
97  template<uword fixed_n_elem>
98  class fixed : public Col<eT>
99  {
100  private:
101 
102  static const bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);
103 
104  arma_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
105 
106  arma_inline void mem_setup();
107  arma_inline void change_to_row();
108 
109 
110  public:
111 
112  static const uword n_rows = fixed_n_elem;
113  static const uword n_cols = 1;
114  static const uword n_elem = fixed_n_elem;
115 
116  arma_inline fixed();
118  inline fixed(const subview_cube<eT>& X);
119 
120  template<typename T1> inline fixed(const Base<eT,T1>& A);
121  template<typename T1, typename T2> inline fixed(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
122 
123  inline fixed( eT* aux_mem, const bool copy_aux_mem = true);
124  inline fixed(const eT* aux_mem);
125 
126  inline fixed(const char* text);
127  inline fixed(const std::string& text);
128 
129  template<typename T1> inline const Col& operator=(const Base<eT,T1>& A);
130 
131  inline const Col& operator=(const eT val);
132  inline const Col& operator=(const char* text);
133  inline const Col& operator=(const std::string& text);
134  inline const Col& operator=(const subview_cube<eT>& X);
135 
136  inline subview_row<eT> operator()(const uword row_num, const span& col_span);
137  inline const subview_row<eT> operator()(const uword row_num, const span& col_span) const;
138 
139  inline subview_col<eT> operator()(const span& row_span, const uword col_num );
140  inline const subview_col<eT> operator()(const span& row_span, const uword col_num ) const;
141 
142  inline subview<eT> operator()(const span& row_span, const span& col_span);
143  inline const subview<eT> operator()(const span& row_span, const span& col_span) const;
144 
146  arma_inline arma_warn_unused eT operator[] (const uword i) const;
147  arma_inline arma_warn_unused eT& at (const uword i);
148  arma_inline arma_warn_unused eT at (const uword i) const;
150  arma_inline arma_warn_unused eT operator() (const uword i) const;
151 
152  arma_inline arma_warn_unused eT& at (const uword in_row, const uword in_col);
153  arma_inline arma_warn_unused eT at (const uword in_row, const uword in_col) const;
154  arma_inline arma_warn_unused eT& operator() (const uword in_row, const uword in_col);
155  arma_inline arma_warn_unused eT operator() (const uword in_row, const uword in_col) const;
156 
157  arma_hot inline const Col<eT>& fill(const eT val);
158  arma_hot inline const Col<eT>& zeros();
159  arma_hot inline const Col<eT>& ones();
160  };
161 
162 
163  #ifdef ARMA_EXTRA_COL_PROTO
164  #include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_PROTO)
165  #endif
166 
167  };
168 
169 
170 
eT * row_iterator
Definition: Col_bones.hpp:87
eT elem_type
Definition: Col_bones.hpp:24
static const uword mat_prealloc
Definition: arma_config.hpp:24
static const uword n_elem
Definition: Col_bones.hpp:114
arma_hot const Col< eT > & zeros()
Definition: Col_meat.hpp:1154
Definition: span.hpp:35
arma_inline arma_warn_unused eT & operator[](const uword i)
Definition: Col_meat.hpp:1010
mat_injector< Col > operator<<(const eT val)
Definition: Col_meat.hpp:336
const uword n_elem
number of elements in the matrix (read-only)
Definition: Mat_bones.hpp:31
static const uword n_cols
Definition: Col_bones.hpp:113
const Col & operator=(const char *text)
construct a column vector from specified text
Definition: Col_meat.hpp:93
arma_inline void mem_setup()
Definition: Col_meat.hpp:671
arma_inline void change_to_row()
Definition: Col_meat.hpp:689
arma_inline eT & row(const uword row_num)
Definition: Col_meat.hpp:346
u32 uword
Definition: typedef.hpp:85
arma_aligned eT mem_local_extra[(use_extra)?fixed_n_elem:1]
Definition: Col_bones.hpp:104
Col()
construct an empty column vector
Definition: Col_meat.hpp:21
arma_inline subview_col< eT > rows(const uword in_row1, const uword in_row2)
Definition: Col_meat.hpp:370
Class for column vectors (matrices with only one column)
Definition: Col_bones.hpp:20
get_pod_type< eT >::result pod_type
Definition: Col_bones.hpp:25
static const bool use_extra
Definition: Col_bones.hpp:102
void insert_rows(const uword row_num, const uword N, const bool set_to_zero=true)
Definition: Col_meat.hpp:556
arma_inline arma_warn_unused eT & at(const uword i)
Definition: Col_meat.hpp:1034
#define arma_aligned
row_iterator begin_row(const uword row_num)
Definition: Col_meat.hpp:614
arma_hot const Col< eT > & fill(const eT val)
Definition: Col_meat.hpp:1138
Analog of the Base class, intended for cubes.
subview_row< eT > operator()(const uword row_num, const span &col_span)
Definition: Col_meat.hpp:931
#define arma_warn_unused
const Col & operator=(const Base< eT, T1 > &A)
arma_inline subview_col< eT > subvec(const uword in_row1, const uword in_row2)
Definition: Col_meat.hpp:402
Dense matrix class.
#define arma_inline
static const uword n_rows
Definition: Col_bones.hpp:112
arma_hot const Col< eT > & ones()
Definition: Col_meat.hpp:1170
void shed_row(const uword row_num)
remove specified row
Definition: Col_meat.hpp:503
const eT * const_row_iterator
Definition: Col_bones.hpp:88
#define arma_hot
void shed_rows(const uword in_row1, const uword in_row2)
remove specified rows
Definition: Col_meat.hpp:518
row_iterator end_row(const uword row_num)
Definition: Col_meat.hpp:642
arma_inline fixed()
Definition: Col_meat.hpp:702


armadillo_matrix
Author(s):
autogenerated on Fri Apr 16 2021 02:31:56