Row_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 Row : public Mat<eT>
21  {
22  public:
23 
24  typedef eT elem_type;
26 
27 
28  inline Row();
29  inline Row(const Row<eT>& X);
30  inline explicit Row(const uword N);
31  inline Row(const uword in_rows, const uword in_cols);
32 
33  inline Row(const char* text);
34  inline const Row& operator=(const char* text);
35 
36  inline Row(const std::string& text);
37  inline const Row& operator=(const std::string& text);
38 
39  #if defined(ARMA_USE_CXX11)
40  inline Row(const std::initializer_list<eT>& list);
41  inline const Row& operator=(const std::initializer_list<eT>& list);
42  #endif
43 
44  inline const Row& operator=(const eT val);
45 
46  template<typename T1> inline Row(const Base<eT,T1>& X);
47  template<typename T1> inline const Row& operator=(const Base<eT,T1>& X);
48 
49  inline Row( eT* aux_mem, const uword aux_length, const bool copy_aux_mem = true, const bool strict = true);
50  inline Row(const eT* aux_mem, const uword aux_length);
51 
52  template<typename T1, typename T2>
53  inline explicit Row(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
54 
55  template<typename T1> inline Row(const BaseCube<eT,T1>& X);
56  template<typename T1> inline const Row& operator=(const BaseCube<eT,T1>& X);
57 
58  inline Row(const subview_cube<eT>& X);
59  inline const Row& operator=(const subview_cube<eT>& X);
60 
61  inline mat_injector<Row> operator<<(const eT val);
62 
63  arma_inline eT& col(const uword col_num);
64  arma_inline eT col(const uword col_num) const;
65 
66  arma_inline subview_row<eT> cols(const uword in_col1, const uword in_col2);
67  arma_inline const subview_row<eT> cols(const uword in_col1, const uword in_col2) const;
68 
69  arma_inline subview_row<eT> subvec(const uword in_col1, const uword in_col2);
70  arma_inline const subview_row<eT> subvec(const uword in_col1, const uword in_col2) const;
71 
72  arma_inline subview_row<eT> subvec(const span& col_span);
73  arma_inline const subview_row<eT> subvec(const span& col_span) const;
74 
75  // arma_inline subview_row<eT> operator()(const span& col_span);
76  // arma_inline const subview_row<eT> operator()(const span& col_span) const;
77 
78 
79  inline void shed_col (const uword col_num);
80  inline void shed_cols(const uword in_col1, const uword in_col2);
81 
82  inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero = true);
83  template<typename T1> inline void insert_cols(const uword col_num, const Base<eT,T1>& X);
84 
85 
86  typedef eT* row_iterator;
87  typedef const eT* const_row_iterator;
88 
89  inline row_iterator begin_row(const uword row_num);
90  inline const_row_iterator begin_row(const uword row_num) const;
91 
92  inline row_iterator end_row (const uword row_num);
93  inline const_row_iterator end_row (const uword row_num) const;
94 
95 
96  template<uword fixed_n_elem>
97  class fixed : public Row<eT>
98  {
99  private:
100 
101  static const bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);
102 
103  arma_aligned eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
104 
105  arma_inline void mem_setup();
106 
107 
108  public:
109 
110  static const uword n_rows = 1;
111  static const uword n_cols = fixed_n_elem;
112  static const uword n_elem = fixed_n_elem;
113 
114  arma_inline fixed();
116  inline fixed(const subview_cube<eT>& X);
117 
118  template<typename T1> inline fixed(const Base<eT,T1>& A);
119  template<typename T1, typename T2> inline fixed(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
120 
121  inline fixed( eT* aux_mem, const bool copy_aux_mem = true);
122  inline fixed(const eT* aux_mem);
123 
124  inline fixed(const char* text);
125  inline fixed(const std::string& text);
126 
127  template<typename T1> inline const Row& operator=(const Base<eT,T1>& A);
128 
129  inline const Row& operator=(const eT val);
130  inline const Row& operator=(const char* text);
131  inline const Row& operator=(const std::string& text);
132  inline const Row& operator=(const subview_cube<eT>& X);
133 
134  inline subview_row<eT> operator()(const uword row_num, const span& col_span);
135  inline const subview_row<eT> operator()(const uword row_num, const span& col_span) const;
136 
137  inline subview_col<eT> operator()(const span& row_span, const uword col_num );
138  inline const subview_col<eT> operator()(const span& row_span, const uword col_num ) const;
139 
140  inline subview<eT> operator()(const span& row_span, const span& col_span);
141  inline const subview<eT> operator()(const span& row_span, const span& col_span) const;
142 
144  arma_inline arma_warn_unused eT operator[] (const uword i) const;
145  arma_inline arma_warn_unused eT& at (const uword i);
146  arma_inline arma_warn_unused eT at (const uword i) const;
148  arma_inline arma_warn_unused eT operator() (const uword i) const;
149 
150  arma_inline arma_warn_unused eT& at (const uword in_row, const uword in_col);
151  arma_inline arma_warn_unused eT at (const uword in_row, const uword in_col) const;
152  arma_inline arma_warn_unused eT& operator() (const uword in_row, const uword in_col);
153  arma_inline arma_warn_unused eT operator() (const uword in_row, const uword in_col) const;
154 
155  arma_hot inline const Row<eT>& fill(const eT val);
156  arma_hot inline const Row<eT>& zeros();
157  arma_hot inline const Row<eT>& ones();
158  };
159 
160 
161  #ifdef ARMA_EXTRA_ROW_PROTO
162  #include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_PROTO)
163  #endif
164 
165  };
166 
167 
168 
void shed_cols(const uword in_col1, const uword in_col2)
remove specified columns
Definition: Row_meat.hpp:484
static const uword mat_prealloc
Definition: arma_config.hpp:24
const Row & operator=(const char *text)
Definition: Row_meat.hpp:87
arma_aligned eT mem_local_extra[(use_extra)?fixed_n_elem:1]
Definition: Row_bones.hpp:103
Definition: span.hpp:35
const eT * const_row_iterator
Definition: Row_bones.hpp:87
void shed_col(const uword col_num)
remove specified columns
Definition: Row_meat.hpp:469
get_pod_type< eT >::result pod_type
Definition: Row_bones.hpp:25
static const uword n_elem
Definition: Row_bones.hpp:112
arma_inline subview_row< eT > cols(const uword in_col1, const uword in_col2)
Definition: Row_meat.hpp:336
u32 uword
Definition: typedef.hpp:85
arma_inline void mem_setup()
Definition: Row_meat.hpp:637
row_iterator begin_row(const uword row_num)
Definition: Row_meat.hpp:580
subview_row< eT > operator()(const uword row_num, const span &col_span)
Definition: Row_meat.hpp:798
const Row & operator=(const Base< eT, T1 > &A)
arma_hot const Row< eT > & fill(const eT val)
Definition: Row_meat.hpp:1076
row_iterator end_row(const uword row_num)
Definition: Row_meat.hpp:608
arma_inline fixed()
Definition: Row_meat.hpp:654
arma_hot const Row< eT > & zeros()
Definition: Row_meat.hpp:1092
arma_hot const Row< eT > & ones()
Definition: Row_meat.hpp:1108
Class for row vectors (matrices with only one row)
void insert_cols(const uword col_num, const uword N, const bool set_to_zero=true)
Definition: Row_meat.hpp:522
#define arma_aligned
mat_injector< Row > operator<<(const eT val)
Definition: Row_meat.hpp:302
static const uword n_rows
Definition: Row_bones.hpp:110
arma_inline eT & col(const uword col_num)
Definition: Row_meat.hpp:312
Analog of the Base class, intended for cubes.
static const uword n_cols
Definition: Row_bones.hpp:111
#define arma_warn_unused
Dense matrix class.
#define arma_inline
arma_inline subview_row< eT > subvec(const uword in_col1, const uword in_col2)
Definition: Row_meat.hpp:368
eT * row_iterator
Definition: Row_bones.hpp:86
Row()
construct an empty row vector
Definition: Row_meat.hpp:21
eT elem_type
Definition: Row_bones.hpp:24
static const bool use_extra
Definition: Row_bones.hpp:101
#define arma_hot
arma_inline arma_warn_unused eT & at(const uword i)
Definition: Row_meat.hpp:972
arma_inline arma_warn_unused eT & operator[](const uword i)
Definition: Row_meat.hpp:948


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