34 const uword in_n_rows,
43 ,
n_elem(in_n_rows*in_n_cols)
57 const uword in_n_rows,
66 ,
n_elem(in_n_rows*in_n_cols)
103 const bool overlap = check_overlap(x_in);
130 template<
typename oT>
135 arma_check( (f_ptr == 0),
"subview_field::operator[]: field is read-only");
140 const uword index = (in_col + aux_col1)*f.n_rows + aux_row1 + in_row;
142 return *((*f_ptr).mem[index]);
147 template<
typename oT>
155 const uword index = (in_col + aux_col1)*f.n_rows + aux_row1 + in_row;
157 return *(f.mem[index]);
162 template<
typename oT>
167 arma_check( (f_ptr == 0),
"subview_field::operator(): field is read-only");
173 const uword index = (in_col + aux_col1)*f.n_rows + aux_row1 + in_row;
175 return *((*f_ptr).mem[index]);
180 template<
typename oT>
190 const uword index = (in_col + aux_col1)*f.n_rows + aux_row1 + in_row;
192 return *(f.mem[index]);
197 template<
typename oT>
202 arma_check( (f_ptr == 0),
"subview_field::operator(): field is read-only");
205 const uword index = (in_col + aux_col1)*f.n_rows + aux_row1 + in_row;
207 return *((*f_ptr).mem[index]);
212 template<
typename oT>
219 const uword index = (in_col + aux_col1)*f.n_rows + aux_row1 + in_row;
221 return *(f.mem[index]);
226 template<
typename oT>
233 arma_check( (f_ptr == 0),
"subview_field::at(): field is read-only");
235 const uword index = (in_col + aux_col1)*f.n_rows + aux_row1 + in_row;
237 return *((*f_ptr).mem[index]);
242 template<
typename oT>
249 const uword index = (in_col + aux_col1)*f.n_rows + aux_row1 + in_row;
251 return *(f.mem[index]);
256 template<
typename oT>
289 const bool outside_rows = ( (x_row_start >= t_row_end_p1) || (t_row_start >= x_row_end_p1) );
290 const bool outside_cols = ( (x_col_start >= t_col_end_p1) || (t_col_start >= x_col_end_p1) );
292 return ( (outside_rows ==
false) && (outside_cols ==
false) );
300 template<
typename oT>
308 const bool alias = (&actual_out == &in.
f);
311 field<oT>& out = (alias) ? (*tmp) : actual_out;
arma_inline oT & operator[](const uword i)
const uword n_rows
number of rows in the field (read-only)
const uword n_cols
number of columns in the field (read-only)
void set_size(const uword n_obj_in)
#define arma_extra_debug_print
arma_inline oT & operator()(const uword i)
subview_field< oT > col(const uword col_num)
creation of subview_field (column of a field)
arma_inline oT & at(const uword row, const uword col)
bool check_overlap(const subview_field &x) const
#define arma_extra_debug_sigprint
static void extract(field< oT > &out, const subview_field &in)
X = Y.subfield(...)
subview_field< oT > row(const uword row_num)
creation of subview_field (row of a field)
const uword n_elem
number of elements in the field (read-only)
void operator=(const field< oT > &x)
void arma_hot arma_check(const bool state, const T1 &x)
if state is true, abort program
arma_inline oT & at(const uword i)
linear element accessor (treats the field as a vector); no bounds check