27 typedef typename T1::elem_type eT;
36 const uword in_n_elem = in_n_rows * in_n_cols;
49 const bool same_size = ( (out.
n_rows == in_n_rows) && (out.
n_cols == in_n_cols) );
51 if(same_size ==
false)
56 "reshape(): size can't be changed as template based size specification is in use" 71 eT* out_mem = out.
memptr();
77 for(
uword row=0; row<B_n_rows; ++row)
79 for(
uword col=0; col<B_n_cols; ++col)
81 out_mem[i] = B.
at(row,col);
97 eT* out_mem = out.
memptr();
110 for(
uword i=0; i<n_elem_to_copy; ++i)
112 out_mem[i] = B.
at(row,col);
124 for(
uword i=n_elem_to_copy; i<in_n_elem; ++i)
134 template<
typename T1>
141 typedef typename T1::elem_type eT;
151 const uword in_n_elem = in_n_rows * in_n_cols * in_n_slices;
159 out.
set_size(in_n_rows, in_n_cols, in_n_slices);
164 const bool same_size = ( (out.
n_rows == in_n_rows) && (out.
n_cols == in_n_cols) && (out.
n_slices == in_n_slices) );
166 if(same_size ==
false)
171 "reshape(): size can't be changed as template based size specification is in use" 190 out.
set_size(in_n_rows, in_n_cols, in_n_slices);
192 eT* out_mem = out.
memptr();
199 for(
uword slice=0; slice<B_n_slices; ++slice)
201 for(
uword row=0; row<B_n_rows; ++row)
203 for(
uword col=0; col<B_n_cols; ++col)
205 out_mem[i] = B.
at(row,col,slice);
220 out.
set_size(in_n_rows, in_n_cols, in_n_slices);
222 eT* out_mem = out.
memptr();
237 for(
uword i=0; i<n_elem_to_copy; ++i)
239 out_mem[i] = B.
at(row,col,slice);
257 for(
uword i=n_elem_to_copy; i<in_n_elem; ++i)
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the matrix
arma_aligned uword aux_uword_d
storage of auxiliary data, uword format
void set_size(const uword in_elem)
change the matrix to have user specified dimensions (data is not preserved)
arma_hot static arma_inline void copy(eT *dest, const eT *src, const uword n_elem)
arma_aligned uword aux_uword_b
storage of auxiliary data, uword format
arma_aligned uword aux_uword_c
storage of auxiliary data, uword format
arma_aligned uword aux_uword_c
storage of auxiliary data, uword format
void set_size(const uword in_rows, const uword in_cols, const uword in_slices)
change the cube to have user specified dimensions (data is not preserved)
const uword n_cols
number of columns in the matrix (read-only)
arma_aligned uword aux_uword_b
storage of auxiliary data, uword format
const uword n_elem
number of elements in the matrix (read-only)
const uword n_rows
number of rows in the matrix (read-only)
arma_aligned const T1 & m
storage of reference to the operand (eg. a matrix)
arma_inline const Op< T1, op_min > min(const Base< typename T1::elem_type, T1 > &X, const uword dim=0)
Delayed 'minimum values' operation. The dimension, along which the minima are found, is set via 'dim'. For dim = 0, the minimum value of each column is found (i.e. searches by traversing across rows). For dim = 1, the minimum value of each row is found (i.e. searches by traversing across columns). The default is dim = 0.
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the cube
const uword n_cols
number of columns in each slice (read-only)
static arma_inline T1 & rw(const T1 &x)
internal function to allow modification of data declared as read-only
arma_inline arma_warn_unused eT & at(const uword i)
linear element accessor (treats the matrix as a vector); no bounds check.
static void apply(Mat< typename T1::elem_type > &out, const Op< T1, op_reshape > &in)
#define arma_extra_debug_sigprint
Analog of the Op class, intended for cubes.
arma_aligned uword aux_uword_a
storage of auxiliary data, uword format
arma_aligned const T1 & m
storage of reference to the operand (e.g. a cube)
const uword n_elem
number of elements in the cube (read-only)
arma_aligned uword aux_uword_a
storage of auxiliary data, uword format
const uword n_slices
number of slices in the cube (read-only)
const uword n_elem_slice
DEPRECATED: do not use this member variable – it will be removed in version 3.0. ...
const uword n_rows
number of rows in each slice (read-only)
arma_inline arma_warn_unused eT & at(const uword i)
linear element accessor (treats the cube as a vector); no bounds check.