Classes | |
class | Cube< eT > |
Dense cube class. More... | |
class | Cube_aux |
Functions | |
Cube::~Cube () | |
Cube::Cube () | |
Cube::Cube (const u32 in_rows, const u32 in_cols, const u32 in_slices) | |
construct the cube to have user specified dimensions | |
void | Cube::init (const u32 in_rows, const u32 in_cols, const u32 in_slices) |
internal cube construction; if the requested size is small enough, memory from the stack is used. otherwise memory is allocated via 'new' | |
void | Cube::delete_mat () |
void | Cube::create_mat () |
arma_inline const Cube & | Cube::operator= (const eT val) |
Set the cube to be equal to the specified scalar. NOTE: the size of the cube will be 1x1x1. | |
arma_inline const Cube & | Cube::operator+= (const eT val) |
In-place addition of a scalar to all elements of the cube. | |
arma_inline const Cube & | Cube::operator-= (const eT val) |
In-place subtraction of a scalar from all elements of the cube. | |
arma_inline const Cube & | Cube::operator*= (const eT val) |
In-place multiplication of all elements of the cube with a scalar. | |
arma_inline const Cube & | Cube::operator/= (const eT val) |
In-place division of all elements of the cube with a scalar. | |
Cube::Cube (const Cube &m) | |
construct a cube from a given cube | |
const Cube & | Cube::operator= (const Cube &m) |
construct a cube from a given cube | |
void | Cube::init (const Cube &x) |
construct a cube from a given cube | |
Cube::Cube (eT *aux_mem, const u32 aux_n_rows, const u32 aux_n_cols, const u32 aux_n_slices, const bool copy_aux_mem=true) | |
construct a cube from a given auxiliary array of eTs. if copy_aux_mem is true, new memory is allocated and the array is copied. if copy_aux_mem is false, the auxiliary array is used directly (without allocating memory and copying). note that in the latter case the default is to copy the array. | |
Cube::Cube (const eT *aux_mem, const u32 aux_n_rows, const u32 aux_n_cols, const u32 aux_n_slices) | |
construct a cube from a given auxiliary read-only array of eTs. the array is copied. | |
const Cube & | Cube::operator+= (const Cube &m) |
in-place cube addition | |
const Cube & | Cube::operator-= (const Cube &m) |
in-place cube subtraction | |
const Cube & | Cube::operator%= (const Cube &m) |
in-place element-wise cube multiplication | |
const Cube & | Cube::operator/= (const Cube &m) |
in-place element-wise cube division | |
template<typename T1 , typename T2 > | |
Cube::Cube (const BaseCube< pod_type, T1 > &A, const BaseCube< pod_type, T2 > &B) | |
for constructing a complex cube out of two non-complex cubes | |
Cube::Cube (const subview_cube< eT > &X) | |
construct a cube from a subview_cube instance (e.g. construct a cube from a delayed subcube operation) | |
const Cube & | Cube::operator= (const subview_cube< eT > &X) |
construct a cube from a subview_cube instance (e.g. construct a cube from a delayed subcube operation) | |
const Cube & | Cube::operator+= (const subview_cube< eT > &X) |
in-place cube addition (using a subcube on the right-hand-side) | |
const Cube & | Cube::operator-= (const subview_cube< eT > &X) |
in-place cube subtraction (using a subcube on the right-hand-side) | |
const Cube & | Cube::operator%= (const subview_cube< eT > &X) |
in-place element-wise cube mutiplication (using a subcube on the right-hand-side) | |
const Cube & | Cube::operator/= (const subview_cube< eT > &X) |
in-place element-wise cube division (using a subcube on the right-hand-side) | |
arma_inline Mat< eT > & | Cube::slice (const u32 in_slice) |
provide the reference to the matrix representing a single slice | |
arma_inline const Mat< eT > & | Cube::slice (const u32 in_slice) const |
provide the reference to the matrix representing a single slice | |
arma_inline subview_cube< eT > | Cube::slices (const u32 in_slice1, const u32 in_slice2) |
creation of subview_cube (subcube comprised of specified slices) | |
arma_inline const subview_cube < eT > | Cube::slices (const u32 in_slice1, const u32 in_slice2) const |
creation of subview_cube (subcube comprised of specified slices) | |
arma_inline subview_cube< eT > | Cube::subcube (const u32 in_row1, const u32 in_col1, const u32 in_slice1, const u32 in_row2, const u32 in_col2, const u32 in_slice2) |
creation of subview_cube (generic subcube) | |
arma_inline const subview_cube < eT > | Cube::subcube (const u32 in_row1, const u32 in_col1, const u32 in_slice1, const u32 in_row2, const u32 in_col2, const u32 in_slice2) const |
creation of subview_cube (generic subcube) | |
template<typename T1 , typename op_cube_type > | |
Cube::Cube (const OpCube< T1, op_cube_type > &X) | |
create a cube from OpCube, i.e. run the previously delayed unary operations | |
template<typename T1 , typename op_cube_type > | |
const Cube & | Cube::operator= (const OpCube< T1, op_cube_type > &X) |
create a cube from OpCube, i.e. run the previously delayed unary operations | |
template<typename T1 , typename op_cube_type > | |
const Cube & | Cube::operator+= (const OpCube< T1, op_cube_type > &X) |
in-place cube addition, with the right-hand-side operand having delayed operations | |
template<typename T1 , typename op_cube_type > | |
const Cube & | Cube::operator-= (const OpCube< T1, op_cube_type > &X) |
in-place cube subtraction, with the right-hand-side operand having delayed operations | |
template<typename T1 , typename op_cube_type > | |
const Cube & | Cube::operator%= (const OpCube< T1, op_cube_type > &X) |
in-place cube element-wise multiplication, with the right-hand-side operand having delayed operations | |
template<typename T1 , typename op_cube_type > | |
const Cube & | Cube::operator/= (const OpCube< T1, op_cube_type > &X) |
in-place cube element-wise division, with the right-hand-side operand having delayed operations | |
template<typename T1 , typename T2 , typename glue_cube_type > | |
Cube::Cube (const GlueCube< T1, T2, glue_cube_type > &X) | |
create a cube from Glue, i.e. run the previously delayed binary operations | |
template<typename T1 , typename T2 , typename glue_cube_type > | |
const Cube & | Cube::operator= (const GlueCube< T1, T2, glue_cube_type > &X) |
create a cube from Glue, i.e. run the previously delayed binary operations | |
template<typename T1 , typename T2 , typename glue_cube_type > | |
const Cube & | Cube::operator+= (const GlueCube< T1, T2, glue_cube_type > &X) |
in-place cube addition, with the right-hand-side operands having delayed operations | |
template<typename T1 , typename T2 , typename glue_cube_type > | |
const Cube & | Cube::operator-= (const GlueCube< T1, T2, glue_cube_type > &X) |
in-place cube subtraction, with the right-hand-side operands having delayed operations | |
template<typename T1 , typename T2 , typename glue_cube_type > | |
const Cube & | Cube::operator%= (const GlueCube< T1, T2, glue_cube_type > &X) |
in-place cube element-wise multiplication, with the right-hand-side operands having delayed operations | |
template<typename T1 , typename T2 , typename glue_cube_type > | |
const Cube & | Cube::operator/= (const GlueCube< T1, T2, glue_cube_type > &X) |
in-place cube element-wise division, with the right-hand-side operands having delayed operations | |
arma_inline eT & | Cube::operator() (const u32 i) |
linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined | |
arma_inline eT | Cube::operator() (const u32 i) const |
linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined | |
arma_inline eT & | Cube::operator[] (const u32 i) |
linear element accessor (treats the cube as a vector); no bounds check. | |
arma_inline eT | Cube::operator[] (const u32 i) const |
linear element accessor (treats the cube as a vector); no bounds check | |
arma_inline eT & | Cube::operator() (const u32 in_row, const u32 in_col, const u32 in_slice) |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined | |
arma_inline eT | Cube::operator() (const u32 in_row, const u32 in_col, const u32 in_slice) const |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined | |
arma_inline eT & | Cube::at (const u32 in_row, const u32 in_col, const u32 in_slice) |
element accessor; no bounds check | |
arma_inline eT | Cube::at (const u32 in_row, const u32 in_col, const u32 in_slice) const |
element accessor; no bounds check | |
arma_inline const Cube & | Cube::operator++ () |
prefix ++ | |
arma_inline void | Cube::operator++ (int) |
postfix ++ (must not return the object by reference) | |
arma_inline const Cube & | Cube::operator-- () |
prefix -- | |
arma_inline void | Cube::operator-- (int) |
postfix -- (must not return the object by reference) | |
arma_inline bool | Cube::is_finite () const |
returns true if all of the elements are finite | |
arma_inline eT * | Cube::memptr () |
returns a pointer to array of eTs used by the cube | |
arma_inline const eT * | Cube::memptr () const |
returns a pointer to array of eTs used by the cube | |
arma_inline eT * | Cube::slice_memptr (const u32 slice) |
returns a pointer to array of eTs used by the specified slice in the cube | |
arma_inline const eT * | Cube::slice_memptr (const u32 slice) const |
returns a pointer to array of eTs used by the specified slice in the cube | |
arma_inline eT * | Cube::slice_colptr (const u32 in_slice, const u32 in_col) |
returns a pointer to array of eTs used by the specified slice in the cube | |
arma_inline const eT * | Cube::slice_colptr (const u32 in_slice, const u32 in_col) const |
returns a pointer to array of eTs used by the specified slice in the cube | |
void | Cube::print (const std::string extra_text="") const |
print contents of the cube (to the cout stream), optionally preceding with a user specified line of text. the precision and cell width are modified. on return, the stream's flags are restored to their original values. | |
void | Cube::print (std::ostream &user_stream, const std::string extra_text="") const |
print contents of the cube to a user specified stream, optionally preceding with a user specified line of text. the precision and cell width are modified. on return, the stream's flags are restored to their original values. | |
void | Cube::raw_print (const std::string extra_text="") const |
print contents of the cube (to the cout stream), optionally preceding with a user specified line of text. the stream's flags are used as is and are not modified (i.e. the precision and cell width are not modified). | |
void | Cube::raw_print (std::ostream &user_stream, const std::string extra_text="") const |
print contents of the cube to a user specified stream, optionally preceding with a user specified line of text. the stream's flags are used as is and are not modified. (i.e. the precision and cell width are not modified). | |
void | Cube::set_size (const u32 in_rows, const u32 in_cols, const u32 in_slices) |
change the cube to have user specified dimensions (data is not preserved) | |
template<typename eT2 > | |
void | Cube::copy_size (const Cube< eT2 > &m) |
change the cube (without preserving data) to have the same dimensions as the given cube | |
void | Cube::fill (const eT val) |
fill the cube with the specified value | |
void | Cube::zeros () |
void | Cube::zeros (const u32 in_rows, const u32 in_cols, const u32 in_slices) |
void | Cube::ones () |
void | Cube::ones (const u32 in_rows, const u32 in_cols, const u32 in_slices) |
void | Cube::reset () |
void | Cube::save (const std::string name, const file_type type=arma_binary) const |
save the cube to a file | |
void | Cube::load (const std::string name, const file_type type=auto_detect) |
load a cube from a file | |
template<typename eT > | |
static arma_inline void | Cube_aux::prefix_pp (Cube< eT > &x) |
prefix ++ | |
template<typename T > | |
static arma_inline void | Cube_aux::prefix_pp (Cube< std::complex< T > > &x) |
prefix ++ for complex numbers (work around for limitations of the std::complex class) | |
template<typename eT > | |
static arma_inline void | Cube_aux::postfix_pp (Cube< eT > &x) |
postfix ++ | |
template<typename T > | |
static arma_inline void | Cube_aux::postfix_pp (Cube< std::complex< T > > &x) |
postfix ++ for complex numbers (work around for limitations of the std::complex class) | |
template<typename eT > | |
static arma_inline void | Cube_aux::prefix_mm (Cube< eT > &x) |
prefix -- | |
template<typename T > | |
static arma_inline void | Cube_aux::prefix_mm (Cube< std::complex< T > > &x) |
prefix -- for complex numbers (work around for limitations of the std::complex class) | |
template<typename eT > | |
static arma_inline void | Cube_aux::postfix_mm (Cube< eT > &x) |
postfix -- | |
template<typename T > | |
static arma_inline void | Cube_aux::postfix_mm (Cube< std::complex< T > > &x) |
postfix ++ for complex numbers (work around for limitations of the std::complex class) |
Definition at line 22 of file Cube_meat.hpp.
References arma_config::debug, Cube< eT >::delete_mat(), Cube< eT >::mem, Cube< eT >::mem_local, Cube< eT >::n_cols, Cube< eT >::n_elem, Cube< eT >::n_elem_slice, Cube< eT >::n_rows, Cube< eT >::n_slices, access::rw(), and Cube< eT >::use_aux_mem.
00023 { 00024 arma_extra_debug_sigprint_this(this); 00025 00026 delete_mat(); 00027 00028 if(use_aux_mem == false) 00029 { 00030 if(n_elem > sizeof(mem_local)/sizeof(eT) ) 00031 { 00032 delete [] mem; 00033 } 00034 } 00035 00036 if(arma_config::debug == true) 00037 { 00038 // try to expose buggy user code that accesses deleted objects 00039 access::rw(n_rows) = 0; 00040 access::rw(n_cols) = 0; 00041 access::rw(n_elem_slice) = 0; 00042 access::rw(n_slices) = 0; 00043 access::rw(n_elem) = 0; 00044 access::rw(mat_ptrs) = 0; 00045 access::rw(mem) = 0; 00046 } 00047 00048 isnt_supported_elem_type<eT>::check(); 00049 }
Definition at line 55 of file Cube_meat.hpp.
00056 : n_rows(0) 00057 , n_cols(0) 00058 , n_elem_slice(0) 00059 , n_slices(0) 00060 , n_elem(0) 00061 , use_aux_mem(false) 00062 , mat_ptrs(mat_ptrs) 00063 , mem(mem) 00064 { 00065 arma_extra_debug_sigprint_this(this); 00066 }
Cube< eT >::Cube | ( | const u32 | in_rows, | |
const u32 | in_cols, | |||
const u32 | in_slices | |||
) | [inline, inherited] |
construct the cube to have user specified dimensions
Definition at line 73 of file Cube_meat.hpp.
References Cube< eT >::init().
void Cube< eT >::init | ( | const u32 | in_rows, | |
const u32 | in_cols, | |||
const u32 | in_slices | |||
) | [inline, protected, inherited] |
internal cube construction; if the requested size is small enough, memory from the stack is used. otherwise memory is allocated via 'new'
Definition at line 95 of file Cube_meat.hpp.
References arma_check(), Cube< eT >::create_mat(), Cube< eT >::delete_mat(), Cube< eT >::mem, Cube< eT >::mem_local, Cube< eT >::n_cols, Cube< eT >::n_elem, Cube< eT >::n_elem_slice, Cube< eT >::n_rows, Cube< eT >::n_slices, access::rw(), and Cube< eT >::use_aux_mem.
Referenced by Cube< eT >::copy_size(), Cube< eT >::Cube(), Cube< eT >::init(), Cube< eT >::operator=(), Cube< eT >::reset(), and Cube< eT >::set_size().
00096 { 00097 arma_extra_debug_sigprint( arma_boost::format("in_n_rows = %d, in_n_cols = %d, in_n_slices = %d") % in_n_rows % in_n_cols % in_n_slices ); 00098 00099 const u32 new_n_elem = in_n_rows * in_n_cols * in_n_slices; 00100 00101 if(n_elem == new_n_elem) 00102 { 00103 if( (n_rows != in_n_rows) || (n_cols != in_n_cols) || (n_slices != in_n_slices) ) 00104 { 00105 delete_mat(); 00106 00107 access::rw(n_rows) = in_n_rows; 00108 access::rw(n_cols) = in_n_cols; 00109 access::rw(n_elem_slice) = in_n_rows*in_n_cols; 00110 access::rw(n_slices) = in_n_slices; 00111 00112 create_mat(); 00113 } 00114 } 00115 else 00116 { 00117 arma_debug_check 00118 ( 00119 (use_aux_mem == true), 00120 "Cube::init(): can't change the amount of memory as auxiliary memory is in use" 00121 ); 00122 00123 delete_mat(); 00124 00125 if(n_elem > sizeof(mem_local)/sizeof(eT) ) 00126 { 00127 delete [] mem; 00128 } 00129 00130 if(new_n_elem <= sizeof(mem_local)/sizeof(eT) ) 00131 { 00132 access::rw(mem) = mem_local; 00133 } 00134 else 00135 { 00136 access::rw(mem) = new(std::nothrow) eT[new_n_elem]; 00137 arma_check( (mem == 0), "Cube::init(): out of memory" ); 00138 } 00139 00140 access::rw(n_elem) = new_n_elem; 00141 00142 if(new_n_elem == 0) 00143 { 00144 access::rw(n_rows) = 0; 00145 access::rw(n_cols) = 0; 00146 access::rw(n_elem_slice) = 0; 00147 access::rw(n_slices) = 0; 00148 } 00149 else 00150 { 00151 access::rw(n_rows) = in_n_rows; 00152 access::rw(n_cols) = in_n_cols; 00153 access::rw(n_elem_slice) = in_n_rows*in_n_cols; 00154 access::rw(n_slices) = in_n_slices; 00155 } 00156 00157 create_mat(); 00158 } 00159 }
void Cube< eT >::delete_mat | ( | ) | [inline, protected, inherited] |
Definition at line 165 of file Cube_meat.hpp.
References Cube< eT >::mat_ptrs_local, Cube< eT >::n_slices, access::rw(), and Cube< eT >::slice().
Referenced by Cube< eT >::init(), and Cube< eT >::~Cube().
void Cube< eT >::create_mat | ( | ) | [inline, protected, inherited] |
Definition at line 185 of file Cube_meat.hpp.
References arma_check(), Cube< eT >::mat_ptrs_local, Cube< eT >::n_cols, Cube< eT >::n_rows, Cube< eT >::n_slices, access::rw(), Cube< eT >::slice(), and Cube< eT >::slice_memptr().
Referenced by Cube< eT >::init().
00186 { 00187 arma_extra_debug_sigprint(); 00188 00189 if( n_slices <= sizeof(mat_ptrs_local)/sizeof(Mat<eT>*) ) 00190 { 00191 access::rw(mat_ptrs) = const_cast< const Mat<eT>** >(mat_ptrs_local); 00192 } 00193 else 00194 { 00195 access::rw(mat_ptrs) = new(std::nothrow) const Mat<eT>*[n_slices]; 00196 arma_check( (mat_ptrs == 0), "Cube::create_mat(): out of memory" ); 00197 } 00198 00199 for(u32 slice = 0; slice < n_slices; ++slice) 00200 { 00201 mat_ptrs[slice] = new Mat<eT>('j', slice_memptr(slice), n_rows, n_cols); 00202 } 00203 }
arma_inline const Cube< eT > & Cube< eT >::operator= | ( | const eT | val | ) | [inline, inherited] |
Set the cube to be equal to the specified scalar. NOTE: the size of the cube will be 1x1x1.
Definition at line 212 of file Cube_meat.hpp.
References Cube< eT >::init(), Cube< eT >::mem, and access::rw().
Referenced by Cube< eT >::Cube().
00213 { 00214 arma_extra_debug_sigprint(); 00215 00216 init(1,1,1); 00217 access::rw(mem[0]) = val; 00218 return *this; 00219 }
arma_inline const Cube< eT > & Cube< eT >::operator+= | ( | const eT | val | ) | [inline, inherited] |
In-place addition of a scalar to all elements of the cube.
Definition at line 227 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem, and access::rw().
00228 { 00229 arma_extra_debug_sigprint(); 00230 00231 for(u32 i=0; i<n_elem; ++i) 00232 { 00233 access::rw(mem[i]) += val; 00234 } 00235 00236 return *this; 00237 }
arma_inline const Cube< eT > & Cube< eT >::operator-= | ( | const eT | val | ) | [inline, inherited] |
In-place subtraction of a scalar from all elements of the cube.
Definition at line 245 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem, and access::rw().
00246 { 00247 arma_extra_debug_sigprint(); 00248 00249 for(u32 i=0; i<n_elem; ++i) 00250 { 00251 access::rw(mem[i]) -= val; 00252 } 00253 00254 return *this; 00255 }
arma_inline const Cube< eT > & Cube< eT >::operator*= | ( | const eT | val | ) | [inline, inherited] |
In-place multiplication of all elements of the cube with a scalar.
Definition at line 263 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem, and access::rw().
00264 { 00265 arma_extra_debug_sigprint(); 00266 00267 for(u32 i=0; i<n_elem; ++i) 00268 { 00269 access::rw(mem[i]) *= val; 00270 } 00271 00272 return *this; 00273 }
arma_inline const Cube< eT > & Cube< eT >::operator/= | ( | const eT | val | ) | [inline, inherited] |
In-place division of all elements of the cube with a scalar.
Definition at line 281 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem, and access::rw().
00282 { 00283 arma_extra_debug_sigprint(); 00284 00285 for(u32 i=0; i<n_elem; ++i) 00286 { 00287 access::rw(mem[i]) /= val; 00288 } 00289 00290 return *this; 00291 }
construct a cube from a given cube
Definition at line 298 of file Cube_meat.hpp.
References Cube< eT >::init().
00299 : n_rows(0) 00300 , n_cols(0) 00301 , n_elem_slice(0) 00302 , n_slices(0) 00303 , n_elem(0) 00304 , use_aux_mem(false) 00305 , mat_ptrs(mat_ptrs) 00306 , mem(mem) 00307 { 00308 arma_extra_debug_sigprint(arma_boost::format("this = %x in_cube = %x") % this % &in_cube); 00309 00310 init(in_cube); 00311 }
const Cube< eT > & Cube< eT >::operator= | ( | const Cube< eT > & | m | ) | [inline, inherited] |
construct a cube from a given cube
Definition at line 319 of file Cube_meat.hpp.
References Cube< eT >::init().
00320 { 00321 arma_extra_debug_sigprint(); 00322 00323 init(x); 00324 return *this; 00325 }
void Cube< eT >::init | ( | const Cube< eT > & | x | ) | [inline, protected, inherited] |
construct a cube from a given cube
Definition at line 333 of file Cube_meat.hpp.
References syslib::copy_elem(), Cube< eT >::init(), Cube< eT >::mem, Cube< eT >::memptr(), Cube< eT >::n_cols, Cube< eT >::n_elem, Cube< eT >::n_rows, and Cube< eT >::n_slices.
Cube< eT >::Cube | ( | eT * | aux_mem, | |
const u32 | aux_n_rows, | |||
const u32 | aux_n_cols, | |||
const u32 | aux_n_slices, | |||
const bool | copy_aux_mem = true | |||
) | [inline, inherited] |
construct a cube from a given auxiliary array of eTs. if copy_aux_mem is true, new memory is allocated and the array is copied. if copy_aux_mem is false, the auxiliary array is used directly (without allocating memory and copying). note that in the latter case the default is to copy the array.
Definition at line 354 of file Cube_meat.hpp.
References syslib::copy_elem(), Cube< eT >::init(), Cube< eT >::memptr(), and Cube< eT >::n_elem.
00355 : n_rows (copy_aux_mem ? 0 : aux_n_rows ) 00356 , n_cols (copy_aux_mem ? 0 : aux_n_cols ) 00357 , n_elem_slice(copy_aux_mem ? 0 : aux_n_rows*aux_n_cols ) 00358 , n_slices (copy_aux_mem ? 0 : aux_n_slices ) 00359 , n_elem (copy_aux_mem ? 0 : aux_n_rows*aux_n_cols*aux_n_slices) 00360 , use_aux_mem (copy_aux_mem ? false : true ) 00361 , mem (copy_aux_mem ? mem : aux_mem ) 00362 { 00363 arma_extra_debug_sigprint_this(this); 00364 00365 if(copy_aux_mem == true) 00366 { 00367 init(aux_n_rows, aux_n_cols, aux_n_slices); 00368 syslib::copy_elem( memptr(), aux_mem, n_elem ); 00369 } 00370 }
Cube< eT >::Cube | ( | const eT * | aux_mem, | |
const u32 | aux_n_rows, | |||
const u32 | aux_n_cols, | |||
const u32 | aux_n_slices | |||
) | [inline, inherited] |
construct a cube from a given auxiliary read-only array of eTs. the array is copied.
Definition at line 378 of file Cube_meat.hpp.
References syslib::copy_elem(), Cube< eT >::init(), Cube< eT >::memptr(), and Cube< eT >::n_elem.
00379 : n_rows(0) 00380 , n_cols(0) 00381 , n_elem_slice(0) 00382 , n_slices(0) 00383 , n_elem(0) 00384 , use_aux_mem(false) 00385 , mat_ptrs(mat_ptrs) 00386 , mem(mem) 00387 { 00388 arma_extra_debug_sigprint_this(this); 00389 00390 init(aux_n_rows, aux_n_cols, aux_n_slices); 00391 syslib::copy_elem( memptr(), aux_mem, n_elem ); 00392 }
const Cube< eT > & Cube< eT >::operator+= | ( | const Cube< eT > & | m | ) | [inline, inherited] |
in-place cube addition
Definition at line 400 of file Cube_meat.hpp.
References glue_cube_plus::apply_inplace().
00401 { 00402 arma_extra_debug_sigprint(); 00403 00404 glue_cube_plus::apply_inplace(*this, m); 00405 return *this; 00406 }
const Cube< eT > & Cube< eT >::operator-= | ( | const Cube< eT > & | m | ) | [inline, inherited] |
in-place cube subtraction
Definition at line 414 of file Cube_meat.hpp.
References glue_cube_minus::apply_inplace().
00415 { 00416 arma_extra_debug_sigprint(); 00417 00418 glue_cube_minus::apply_inplace(*this, m); 00419 return *this; 00420 }
const Cube< eT > & Cube< eT >::operator%= | ( | const Cube< eT > & | m | ) | [inline, inherited] |
in-place element-wise cube multiplication
Definition at line 428 of file Cube_meat.hpp.
References glue_cube_schur::apply_inplace().
00429 { 00430 arma_extra_debug_sigprint(); 00431 00432 glue_cube_schur::apply_inplace(*this, m); 00433 return *this; 00434 }
const Cube< eT > & Cube< eT >::operator/= | ( | const Cube< eT > & | m | ) | [inline, inherited] |
in-place element-wise cube division
Definition at line 442 of file Cube_meat.hpp.
References glue_cube_div::apply_inplace().
00443 { 00444 arma_extra_debug_sigprint(); 00445 00446 glue_cube_div::apply_inplace(*this, m); 00447 return *this; 00448 }
Cube< eT >::Cube | ( | const BaseCube< pod_type, T1 > & | A, | |
const BaseCube< pod_type, T2 > & | B | |||
) | [inline, explicit, inherited] |
for constructing a complex cube out of two non-complex cubes
< compile-time abort if eT isn't std::complex
< compile-time abort if T is std::complex
< compile-time abort if types are not compatible
Definition at line 457 of file Cube_meat.hpp.
References arma_assert_same_size(), Cube< eT >::mem, and access::rw().
00461 : n_rows(0) 00462 , n_cols(0) 00463 , n_elem_slice(0) 00464 , n_slices(0) 00465 , n_elem(0) 00466 , use_aux_mem(false) 00467 , mat_ptrs(mat_ptrs) 00468 , mem(mem) 00469 { 00470 arma_extra_debug_sigprint_this(this); 00471 00472 arma_type_check< is_complex<eT>::value == false >::apply(); //!< compile-time abort if eT isn't std::complex 00473 00474 typedef typename T1::elem_type T; 00475 arma_type_check< is_complex<T>::value == true >::apply(); //!< compile-time abort if T is std::complex 00476 00477 isnt_same_type<std::complex<T>, eT>::check(); //!< compile-time abort if types are not compatible 00478 00479 const unwrap_cube<T1> tmp_A(A.get_ref()); 00480 const unwrap_cube<T2> tmp_B(B.get_ref()); 00481 00482 const Cube<T>& X = tmp_A.M; 00483 const Cube<T>& Y = tmp_B.M; 00484 00485 arma_assert_same_size(X, Y, "Cube()"); 00486 00487 init(X.n_rows, X.n_cols, X.n_slices); 00488 00489 const T* X_mem = X.mem; 00490 const T* Y_mem = Y.mem; 00491 00492 for(u32 i=0; i<n_elem; ++i) 00493 { 00494 access::rw(mem[i]) = std::complex<T>(X_mem[i], Y_mem[i]); 00495 } 00496 }
Cube< eT >::Cube | ( | const subview_cube< eT > & | X | ) | [inline, inherited] |
construct a cube from a subview_cube instance (e.g. construct a cube from a delayed subcube operation)
Definition at line 503 of file Cube_meat.hpp.
References Cube< eT >::operator=().
const Cube< eT > & Cube< eT >::operator= | ( | const subview_cube< eT > & | X | ) | [inline, inherited] |
construct a cube from a subview_cube instance (e.g. construct a cube from a delayed subcube operation)
Definition at line 524 of file Cube_meat.hpp.
00525 { 00526 arma_extra_debug_sigprint(); 00527 00528 subview_cube<eT>::extract(*this, X); 00529 return *this; 00530 }
const Cube< eT > & Cube< eT >::operator+= | ( | const subview_cube< eT > & | X | ) | [inline, inherited] |
in-place cube addition (using a subcube on the right-hand-side)
Definition at line 538 of file Cube_meat.hpp.
00539 { 00540 arma_extra_debug_sigprint(); 00541 00542 subview_cube<eT>::plus_inplace(*this, X); 00543 return *this; 00544 }
const Cube< eT > & Cube< eT >::operator-= | ( | const subview_cube< eT > & | X | ) | [inline, inherited] |
in-place cube subtraction (using a subcube on the right-hand-side)
Definition at line 552 of file Cube_meat.hpp.
00553 { 00554 arma_extra_debug_sigprint(); 00555 00556 subview_cube<eT>::minus_inplace(*this, X); 00557 return *this; 00558 }
const Cube< eT > & Cube< eT >::operator%= | ( | const subview_cube< eT > & | X | ) | [inline, inherited] |
in-place element-wise cube mutiplication (using a subcube on the right-hand-side)
Definition at line 566 of file Cube_meat.hpp.
00567 { 00568 arma_extra_debug_sigprint(); 00569 00570 subview_cube<eT>::schur_inplace(*this, X); 00571 return *this; 00572 }
const Cube< eT > & Cube< eT >::operator/= | ( | const subview_cube< eT > & | X | ) | [inline, inherited] |
in-place element-wise cube division (using a subcube on the right-hand-side)
Definition at line 580 of file Cube_meat.hpp.
00581 { 00582 arma_extra_debug_sigprint(); 00583 00584 subview_cube<eT>::div_inplace(*this, X); 00585 return *this; 00586 }
arma_inline Mat< eT > & Cube< eT >::slice | ( | const u32 | in_slice | ) | [inline, inherited] |
provide the reference to the matrix representing a single slice
Definition at line 594 of file Cube_meat.hpp.
References Cube< eT >::n_slices.
Referenced by Cube< eT >::create_mat(), Cube< eT >::delete_mat(), diskio::load_raw_ascii(), and arma_ostream::print().
arma_inline const Mat< eT > & Cube< eT >::slice | ( | const u32 | in_slice | ) | const [inline, inherited] |
provide the reference to the matrix representing a single slice
Definition at line 613 of file Cube_meat.hpp.
References Cube< eT >::n_slices.
arma_inline subview_cube< eT > Cube< eT >::slices | ( | const u32 | in_slice1, | |
const u32 | in_slice2 | |||
) | [inline, inherited] |
creation of subview_cube (subcube comprised of specified slices)
Definition at line 632 of file Cube_meat.hpp.
References Cube< eT >::n_cols, Cube< eT >::n_rows, and Cube< eT >::n_slices.
00633 { 00634 arma_extra_debug_sigprint(); 00635 00636 arma_debug_check 00637 ( 00638 (in_slice1 > in_slice2) || (in_slice2 >= n_slices), 00639 "Cube::slices(): indices out of bounds or incorrectly used" 00640 ); 00641 00642 return subview_cube<eT>(*this, 0, 0, in_slice1, ( (n_rows>0) ? n_rows-1 : 0 ), ( (n_cols>0) ? n_cols-1 : 0 ), in_slice2); 00643 }
arma_inline const subview_cube< eT > Cube< eT >::slices | ( | const u32 | in_slice1, | |
const u32 | in_slice2 | |||
) | const [inline, inherited] |
creation of subview_cube (subcube comprised of specified slices)
Definition at line 651 of file Cube_meat.hpp.
References Cube< eT >::n_cols, Cube< eT >::n_rows, and Cube< eT >::n_slices.
00652 { 00653 arma_extra_debug_sigprint(); 00654 00655 arma_debug_check 00656 ( 00657 (in_slice1 > in_slice2) || (in_slice2 >= n_slices), 00658 "Cube::rows(): indices out of bounds or incorrectly used" 00659 ); 00660 00661 return subview_cube<eT>(*this, 0, 0, in_slice1, ( (n_rows>0) ? n_rows-1 : 0 ), ( (n_cols>0) ? n_cols-1 : 0 ), in_slice2); 00662 }
arma_inline subview_cube< eT > Cube< eT >::subcube | ( | const u32 | in_row1, | |
const u32 | in_col1, | |||
const u32 | in_slice1, | |||
const u32 | in_row2, | |||
const u32 | in_col2, | |||
const u32 | in_slice2 | |||
) | [inline, inherited] |
creation of subview_cube (generic subcube)
Definition at line 670 of file Cube_meat.hpp.
References Cube< eT >::n_cols, Cube< eT >::n_rows, and Cube< eT >::n_slices.
00671 { 00672 arma_extra_debug_sigprint(); 00673 00674 arma_debug_check 00675 ( 00676 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_slice1 > in_slice2) || 00677 (in_row2 >= n_rows) || (in_col2 >= n_cols) || (in_slice2 >= n_slices), 00678 "Cube::subcube(): indices out of bounds or incorrectly used" 00679 ); 00680 00681 return subview_cube<eT>(*this, in_row1, in_col1, in_slice1, in_row2, in_col2, in_slice2); 00682 }
arma_inline const subview_cube< eT > Cube< eT >::subcube | ( | const u32 | in_row1, | |
const u32 | in_col1, | |||
const u32 | in_slice1, | |||
const u32 | in_row2, | |||
const u32 | in_col2, | |||
const u32 | in_slice2 | |||
) | const [inline, inherited] |
creation of subview_cube (generic subcube)
Definition at line 690 of file Cube_meat.hpp.
References Cube< eT >::n_cols, Cube< eT >::n_rows, and Cube< eT >::n_slices.
00691 { 00692 arma_extra_debug_sigprint(); 00693 00694 arma_debug_check 00695 ( 00696 (in_row1 > in_row2) || (in_col1 > in_col2) || (in_slice1 > in_slice2) || 00697 (in_row2 >= n_rows) || (in_col2 >= n_cols) || (in_slice2 >= n_slices), 00698 "Cube::subcube(): indices out of bounds or incorrectly used" 00699 ); 00700 00701 return subview_cube<eT>(*this, in_row1, in_col1, in_slice1, in_row2, in_col2, in_slice2); 00702 }
Cube< eT >::Cube | ( | const OpCube< T1, op_cube_type > & | X | ) | [inline, inherited] |
create a cube from OpCube, i.e. run the previously delayed unary operations
Definition at line 710 of file Cube_meat.hpp.
00711 : n_rows(0) 00712 , n_cols(0) 00713 , n_elem_slice(0) 00714 , n_slices(0) 00715 , n_elem(0) 00716 , use_aux_mem(false) 00717 , mat_ptrs(mat_ptrs) 00718 , mem(mem) 00719 { 00720 arma_extra_debug_sigprint_this(this); 00721 00722 isnt_same_type<eT, typename T1::elem_type>::check(); 00723 00724 op_cube_type::apply(*this, X); 00725 }
const Cube< eT > & Cube< eT >::operator= | ( | const OpCube< T1, op_cube_type > & | X | ) | [inline, inherited] |
create a cube from OpCube, i.e. run the previously delayed unary operations
Definition at line 734 of file Cube_meat.hpp.
00735 { 00736 arma_extra_debug_sigprint(); 00737 00738 isnt_same_type<eT, typename T1::elem_type>::check(); 00739 00740 op_cube_type::apply(*this, X); 00741 00742 return *this; 00743 }
const Cube< eT > & Cube< eT >::operator+= | ( | const OpCube< T1, op_cube_type > & | X | ) | [inline, inherited] |
in-place cube addition, with the right-hand-side operand having delayed operations
Definition at line 752 of file Cube_meat.hpp.
References glue_cube_plus::apply_inplace().
00753 { 00754 arma_extra_debug_sigprint(); 00755 00756 isnt_same_type<eT, typename T1::elem_type>::check(); 00757 00758 glue_cube_plus::apply_inplace(*this, X); 00759 00760 return *this; 00761 }
const Cube< eT > & Cube< eT >::operator-= | ( | const OpCube< T1, op_cube_type > & | X | ) | [inline, inherited] |
in-place cube subtraction, with the right-hand-side operand having delayed operations
Definition at line 770 of file Cube_meat.hpp.
References glue_cube_minus::apply_inplace().
00771 { 00772 arma_extra_debug_sigprint(); 00773 00774 isnt_same_type<eT, typename T1::elem_type>::check(); 00775 00776 glue_cube_minus::apply_inplace(*this, X); 00777 00778 return *this; 00779 }
const Cube< eT > & Cube< eT >::operator%= | ( | const OpCube< T1, op_cube_type > & | X | ) | [inline, inherited] |
in-place cube element-wise multiplication, with the right-hand-side operand having delayed operations
Definition at line 788 of file Cube_meat.hpp.
References glue_cube_schur::apply_inplace().
00789 { 00790 arma_extra_debug_sigprint(); 00791 00792 isnt_same_type<eT, typename T1::elem_type>::check(); 00793 glue_cube_schur::apply_inplace(*this, X); 00794 00795 return *this; 00796 }
const Cube< eT > & Cube< eT >::operator/= | ( | const OpCube< T1, op_cube_type > & | X | ) | [inline, inherited] |
in-place cube element-wise division, with the right-hand-side operand having delayed operations
Definition at line 805 of file Cube_meat.hpp.
References glue_cube_div::apply_inplace().
00806 { 00807 arma_extra_debug_sigprint(); 00808 00809 isnt_same_type<eT, typename T1::elem_type>::check(); 00810 glue_cube_div::apply_inplace(*this, X); 00811 00812 return *this; 00813 }
Cube< eT >::Cube | ( | const GlueCube< T1, T2, glue_cube_type > & | X | ) | [inline, inherited] |
create a cube from Glue, i.e. run the previously delayed binary operations
Definition at line 821 of file Cube_meat.hpp.
References Cube< eT >::operator=().
const Cube< eT > & Cube< eT >::operator= | ( | const GlueCube< T1, T2, glue_cube_type > & | X | ) | [inline, inherited] |
create a cube from Glue, i.e. run the previously delayed binary operations
Definition at line 842 of file Cube_meat.hpp.
00843 { 00844 arma_extra_debug_sigprint(); 00845 00846 isnt_same_type<eT, typename T1::elem_type>::check(); 00847 isnt_same_type<eT, typename T2::elem_type>::check(); 00848 00849 glue_cube_type::apply(*this, X); 00850 00851 return *this; 00852 }
const Cube< eT > & Cube< eT >::operator+= | ( | const GlueCube< T1, T2, glue_cube_type > & | X | ) | [inline, inherited] |
in-place cube addition, with the right-hand-side operands having delayed operations
Definition at line 860 of file Cube_meat.hpp.
References glue_cube_plus::apply_inplace().
00861 { 00862 arma_extra_debug_sigprint(); 00863 00864 isnt_same_type<eT, typename T1::elem_type>::check(); 00865 isnt_same_type<eT, typename T2::elem_type>::check(); 00866 00867 glue_cube_plus::apply_inplace(*this, X); 00868 00869 return *this; 00870 }
const Cube< eT > & Cube< eT >::operator-= | ( | const GlueCube< T1, T2, glue_cube_type > & | X | ) | [inline, inherited] |
in-place cube subtraction, with the right-hand-side operands having delayed operations
Definition at line 879 of file Cube_meat.hpp.
References glue_cube_minus::apply_inplace().
00880 { 00881 arma_extra_debug_sigprint(); 00882 00883 isnt_same_type<eT, typename T1::elem_type>::check(); 00884 isnt_same_type<eT, typename T2::elem_type>::check(); 00885 00886 glue_cube_minus::apply_inplace(*this, X); 00887 00888 return *this; 00889 }
const Cube< eT > & Cube< eT >::operator%= | ( | const GlueCube< T1, T2, glue_cube_type > & | X | ) | [inline, inherited] |
in-place cube element-wise multiplication, with the right-hand-side operands having delayed operations
Definition at line 898 of file Cube_meat.hpp.
References glue_cube_schur::apply_inplace().
00899 { 00900 arma_extra_debug_sigprint(); 00901 00902 isnt_same_type<eT, typename T1::elem_type>::check(); 00903 isnt_same_type<eT, typename T2::elem_type>::check(); 00904 00905 glue_cube_schur::apply_inplace(*this, X); 00906 return *this; 00907 }
const Cube< eT > & Cube< eT >::operator/= | ( | const GlueCube< T1, T2, glue_cube_type > & | X | ) | [inline, inherited] |
in-place cube element-wise division, with the right-hand-side operands having delayed operations
Definition at line 916 of file Cube_meat.hpp.
References glue_cube_div::apply_inplace().
00917 { 00918 arma_extra_debug_sigprint(); 00919 00920 isnt_same_type<eT, typename T1::elem_type>::check(); 00921 isnt_same_type<eT, typename T2::elem_type>::check(); 00922 00923 glue_cube_div::apply_inplace(*this, X); 00924 return *this; 00925 }
linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 933 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem, and access::rw().
00934 { 00935 arma_debug_check( (i >= n_elem), "Cube::operator(): index out of bounds"); 00936 return access::rw(mem[i]); 00937 }
arma_inline eT Cube< eT >::operator() | ( | const u32 | i | ) | const [inline, inherited] |
linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 945 of file Cube_meat.hpp.
References Cube< eT >::mem, and Cube< eT >::n_elem.
linear element accessor (treats the cube as a vector); no bounds check.
Definition at line 956 of file Cube_meat.hpp.
References Cube< eT >::mem, and access::rw().
00957 { 00958 return access::rw(mem[i]); 00959 }
arma_inline eT Cube< eT >::operator[] | ( | const u32 | i | ) | const [inline, inherited] |
linear element accessor (treats the cube as a vector); no bounds check
Definition at line 967 of file Cube_meat.hpp.
References Cube< eT >::mem.
00968 { 00969 return mem[i]; 00970 }
arma_inline eT & Cube< eT >::operator() | ( | const u32 | in_row, | |
const u32 | in_col, | |||
const u32 | in_slice | |||
) | [inline, inherited] |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 978 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_cols, Cube< eT >::n_elem_slice, Cube< eT >::n_rows, Cube< eT >::n_slices, and access::rw().
00979 { 00980 arma_debug_check 00981 ( 00982 (in_row >= n_rows) || 00983 (in_col >= n_cols) || 00984 (in_slice >= n_slices) 00985 , 00986 "Cube::operator(): index out of bounds" 00987 ); 00988 00989 return access::rw(mem[in_slice*n_elem_slice + in_col*n_rows + in_row]); 00990 }
arma_inline eT Cube< eT >::operator() | ( | const u32 | in_row, | |
const u32 | in_col, | |||
const u32 | in_slice | |||
) | const [inline, inherited] |
element accessor; bounds checking not done when ARMA_NO_DEBUG is defined
Definition at line 998 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_cols, Cube< eT >::n_elem_slice, Cube< eT >::n_rows, and Cube< eT >::n_slices.
arma_inline eT & Cube< eT >::at | ( | const u32 | in_row, | |
const u32 | in_col, | |||
const u32 | in_slice | |||
) | [inline, inherited] |
element accessor; no bounds check
Definition at line 1018 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem_slice, Cube< eT >::n_rows, and access::rw().
Referenced by op_reshape::apply(), glue_cube_plus::apply(), diskio::load_arma_ascii(), diskio::load_ppm_binary(), diskio::save_arma_ascii(), diskio::save_ppm_binary(), and diskio::save_raw_ascii().
01019 { 01020 return access::rw( mem[in_slice*n_elem_slice + in_col*n_rows + in_row] ); 01021 }
arma_inline eT Cube< eT >::at | ( | const u32 | in_row, | |
const u32 | in_col, | |||
const u32 | in_slice | |||
) | const [inline, inherited] |
element accessor; no bounds check
Definition at line 1029 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem_slice, and Cube< eT >::n_rows.
01030 { 01031 return mem[in_slice*n_elem_slice + in_col*n_rows + in_row]; 01032 }
arma_inline const Cube< eT > & Cube< eT >::operator++ | ( | ) | [inline, inherited] |
prefix ++
Definition at line 1040 of file Cube_meat.hpp.
References Cube_aux::prefix_pp().
01041 { 01042 Cube_aux::prefix_pp(*this); 01043 return *this; 01044 }
arma_inline void Cube< eT >::operator++ | ( | int | ) | [inline, inherited] |
postfix ++ (must not return the object by reference)
Definition at line 1052 of file Cube_meat.hpp.
References Cube_aux::postfix_pp().
01053 { 01054 Cube_aux::postfix_pp(*this); 01055 }
arma_inline const Cube< eT > & Cube< eT >::operator-- | ( | ) | [inline, inherited] |
prefix --
Definition at line 1063 of file Cube_meat.hpp.
References Cube_aux::prefix_mm().
01064 { 01065 Cube_aux::prefix_mm(*this); 01066 return *this; 01067 }
arma_inline void Cube< eT >::operator-- | ( | int | ) | [inline, inherited] |
postfix -- (must not return the object by reference)
Definition at line 1075 of file Cube_meat.hpp.
References Cube_aux::postfix_mm().
01076 { 01077 Cube_aux::postfix_mm(*this); 01078 }
arma_inline bool Cube< eT >::is_finite | ( | ) | const [inline, inherited] |
returns true if all of the elements are finite
Definition at line 1086 of file Cube_meat.hpp.
References arma_isfinite(), Cube< eT >::mem, and Cube< eT >::n_elem.
01087 { 01088 for(u32 i=0; i<n_elem; ++i) 01089 { 01090 if(arma_isfinite(mem[i]) == false) 01091 { 01092 return false; 01093 } 01094 } 01095 01096 return true; 01097 }
arma_inline eT * Cube< eT >::memptr | ( | ) | [inline, inherited] |
returns a pointer to array of eTs used by the cube
Definition at line 1105 of file Cube_meat.hpp.
References Cube< eT >::mem.
Referenced by abs(), op_atanh::apply(), op_tanh::apply(), op_atan::apply(), op_tan::apply(), op_asinh::apply(), op_sinh::apply(), op_asin::apply(), op_sin::apply(), op_acosh::apply(), op_cosh::apply(), op_acos::apply(), op_cos::apply(), op_scalar_div_post::apply(), op_scalar_div_pre::apply(), op_scalar_times::apply(), op_scalar_minus_post::apply(), op_scalar_minus_pre::apply(), op_scalar_plus::apply(), op_reshape::apply(), op_randn::apply(), op_rand::apply(), op_neg::apply(), op_conj::apply(), op_pow_s32::apply(), op_pow::apply(), op_square::apply(), op_sqrt::apply(), op_trunc_exp::apply(), op_exp::apply(), op_log10::apply(), op_trunc_log::apply(), op_log::apply(), glue_cube_schur::apply(), glue_cube_plus::apply(), glue_cube_minus::apply(), glue_cube_div::apply(), glue_cube_schur::apply_inplace(), glue_cube_plus::apply_inplace(), glue_cube_minus::apply_inplace(), glue_cube_div::apply_inplace(), Cube< eT >::Cube(), subview_cube< eT >::div_inplace(), conv_to< Cube< out_eT > >::from(), imag(), Cube< eT >::init(), diskio::load_arma_binary(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), subview_cube< eT >::plus_inplace(), Cube_aux::postfix_mm(), Cube_aux::postfix_pp(), Cube_aux::prefix_mm(), Cube_aux::prefix_pp(), arma_ostream::print(), real(), and subview_cube< eT >::schur_inplace().
01106 { 01107 return const_cast<eT*>(mem); 01108 }
arma_inline const eT * Cube< eT >::memptr | ( | ) | const [inline, inherited] |
returns a pointer to array of eTs used by the cube
Definition at line 1116 of file Cube_meat.hpp.
References Cube< eT >::mem.
01117 { 01118 return mem; 01119 }
arma_inline eT * Cube< eT >::slice_memptr | ( | const u32 | slice | ) | [inline, inherited] |
returns a pointer to array of eTs used by the specified slice in the cube
Definition at line 1127 of file Cube_meat.hpp.
References Cube< eT >::mem, and Cube< eT >::n_elem_slice.
Referenced by Cube< eT >::create_mat().
01128 { 01129 return const_cast<eT*>( &mem[ slice*n_elem_slice ] ); 01130 }
arma_inline const eT * Cube< eT >::slice_memptr | ( | const u32 | slice | ) | const [inline, inherited] |
returns a pointer to array of eTs used by the specified slice in the cube
Definition at line 1138 of file Cube_meat.hpp.
References Cube< eT >::mem, and Cube< eT >::n_elem_slice.
01139 { 01140 return &mem[ slice*n_elem_slice ]; 01141 }
arma_inline eT * Cube< eT >::slice_colptr | ( | const u32 | in_slice, | |
const u32 | in_col | |||
) | [inline, inherited] |
returns a pointer to array of eTs used by the specified slice in the cube
Definition at line 1149 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem_slice, and Cube< eT >::n_rows.
Referenced by subview_cube< eT >::div_inplace(), subview_cube< eT >::extract(), subview_cube< eT >::minus_inplace(), subview_cube< eT >::plus_inplace(), and subview_cube< eT >::schur_inplace().
01150 { 01151 return const_cast<eT*>( &mem[ slice*n_elem_slice + col*n_rows] ); 01152 }
arma_inline const eT * Cube< eT >::slice_colptr | ( | const u32 | in_slice, | |
const u32 | in_col | |||
) | const [inline, inherited] |
returns a pointer to array of eTs used by the specified slice in the cube
Definition at line 1160 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem_slice, and Cube< eT >::n_rows.
01161 { 01162 return &mem[ slice*n_elem_slice + col*n_rows ]; 01163 }
void Cube< eT >::print | ( | const std::string | extra_text = "" |
) | const [inline, inherited] |
print contents of the cube (to the cout stream), optionally preceding with a user specified line of text. the precision and cell width are modified. on return, the stream's flags are restored to their original values.
Definition at line 1174 of file Cube_meat.hpp.
Referenced by Cube< eT >::print(), and Cube< eT >::raw_print().
01175 { 01176 arma_extra_debug_sigprint(); 01177 01178 if(extra_text.length() != 0) 01179 { 01180 cout << extra_text << '\n'; 01181 } 01182 01183 arma_ostream::print(cout, *this, true); 01184 }
void Cube< eT >::print | ( | std::ostream & | user_stream, | |
const std::string | extra_text = "" | |||
) | const [inline, inherited] |
print contents of the cube to a user specified stream, optionally preceding with a user specified line of text. the precision and cell width are modified. on return, the stream's flags are restored to their original values.
Definition at line 1194 of file Cube_meat.hpp.
References Cube< eT >::print().
01195 { 01196 arma_extra_debug_sigprint(); 01197 01198 if(extra_text.length() != 0) 01199 { 01200 user_stream << extra_text << '\n'; 01201 } 01202 01203 arma_ostream::print(user_stream, *this, true); 01204 }
void Cube< eT >::raw_print | ( | const std::string | extra_text = "" |
) | const [inline, inherited] |
print contents of the cube (to the cout stream), optionally preceding with a user specified line of text. the stream's flags are used as is and are not modified (i.e. the precision and cell width are not modified).
Definition at line 1215 of file Cube_meat.hpp.
References Cube< eT >::print().
01216 { 01217 arma_extra_debug_sigprint(); 01218 01219 if(extra_text.length() != 0) 01220 { 01221 cout << extra_text << '\n'; 01222 } 01223 01224 arma_ostream::print(cout, *this, false); 01225 }
void Cube< eT >::raw_print | ( | std::ostream & | user_stream, | |
const std::string | extra_text = "" | |||
) | const [inline, inherited] |
print contents of the cube to a user specified stream, optionally preceding with a user specified line of text. the stream's flags are used as is and are not modified. (i.e. the precision and cell width are not modified).
Definition at line 1236 of file Cube_meat.hpp.
References Cube< eT >::print().
01237 { 01238 arma_extra_debug_sigprint(); 01239 01240 if(extra_text.length() != 0) 01241 { 01242 user_stream << extra_text << '\n'; 01243 } 01244 01245 arma_ostream::print(user_stream, *this, false); 01246 }
void Cube< eT >::set_size | ( | const u32 | in_rows, | |
const u32 | in_cols, | |||
const u32 | in_slices | |||
) | [inline, inherited] |
change the cube to have user specified dimensions (data is not preserved)
Definition at line 1254 of file Cube_meat.hpp.
References Cube< eT >::init().
Referenced by op_reshape::apply(), op_randn::apply(), op_rand::apply(), glue_cube_schur::apply(), glue_cube_plus::apply(), glue_cube_minus::apply(), glue_cube_div::apply(), subview_cube< eT >::extract(), diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_ppm_binary(), diskio::load_raw_ascii(), Cube< eT >::ones(), and Cube< eT >::zeros().
01255 { 01256 arma_extra_debug_sigprint(); 01257 01258 init(in_n_rows, in_n_cols, in_n_slices); 01259 }
void Cube< eT >::copy_size | ( | const Cube< eT2 > & | m | ) | [inline, inherited] |
change the cube (without preserving data) to have the same dimensions as the given cube
Definition at line 1268 of file Cube_meat.hpp.
References Cube< eT >::init(), Cube< eT >::n_cols, Cube< eT >::n_rows, and Cube< eT >::n_slices.
Referenced by op_atanh::apply(), op_tanh::apply(), op_atan::apply(), op_tan::apply(), op_asinh::apply(), op_sinh::apply(), op_asin::apply(), op_sin::apply(), op_acosh::apply(), op_cosh::apply(), op_acos::apply(), op_cos::apply(), op_scalar_div_post::apply(), op_scalar_div_pre::apply(), op_scalar_times::apply(), glue_cube_schur::apply(), glue_cube_plus::apply(), glue_cube_minus::apply(), glue_cube_div::apply(), and unwrap_cube_write< Cube< eT > >::unwrap_cube_write().
void Cube< eT >::fill | ( | const eT | val | ) | [inline, inherited] |
fill the cube with the specified value
Definition at line 1281 of file Cube_meat.hpp.
References Cube< eT >::mem, Cube< eT >::n_elem, and access::rw().
Referenced by Cube< eT >::ones(), operator*(), operator/(), and Cube< eT >::zeros().
01282 { 01283 arma_extra_debug_sigprint(); 01284 01285 for(u32 i=0; i<n_elem; ++i) 01286 { 01287 access::rw(mem[i]) = val; 01288 } 01289 }
void Cube< eT >::zeros | ( | ) | [inline, inherited] |
Definition at line 1296 of file Cube_meat.hpp.
References Cube< eT >::fill().
Referenced by op_zeros::apply(), and subview_cube< eT >::minus_inplace().
01297 { 01298 arma_extra_debug_sigprint(); 01299 01300 fill(eT(0)); 01301 }
void Cube< eT >::zeros | ( | const u32 | in_rows, | |
const u32 | in_cols, | |||
const u32 | in_slices | |||
) | [inline, inherited] |
Definition at line 1308 of file Cube_meat.hpp.
References Cube< eT >::fill(), and Cube< eT >::set_size().
01309 { 01310 arma_extra_debug_sigprint( arma_boost::format("in_rows = %d, in_cols = %d, in_slices = %d") % in_rows % in_cols % in_slices ); 01311 01312 set_size(in_rows, in_cols, in_slices); 01313 fill(eT(0)); 01314 }
void Cube< eT >::ones | ( | ) | [inline, inherited] |
Definition at line 1321 of file Cube_meat.hpp.
References Cube< eT >::fill().
Referenced by op_ones_full::apply().
01322 { 01323 arma_extra_debug_sigprint(); 01324 01325 fill(eT(1)); 01326 }
void Cube< eT >::ones | ( | const u32 | in_rows, | |
const u32 | in_cols, | |||
const u32 | in_slices | |||
) | [inline, inherited] |
Definition at line 1333 of file Cube_meat.hpp.
References Cube< eT >::fill(), and Cube< eT >::set_size().
01334 { 01335 arma_extra_debug_sigprint( arma_boost::format("in_rows = %d, in_cols = %d, in_slices = %d") % in_rows % in_cols % in_slices ); 01336 01337 set_size(in_rows, in_cols, in_slices); 01338 fill(eT(1)); 01339 }
void Cube< eT >::reset | ( | ) | [inline, inherited] |
Definition at line 1346 of file Cube_meat.hpp.
References Cube< eT >::init().
Referenced by diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_auto_detect(), and diskio::load_ppm_binary().
01347 { 01348 arma_extra_debug_sigprint(); 01349 01350 init(0,0,0); 01351 }
void Cube< eT >::save | ( | const std::string | name, | |
const file_type | type = arma_binary | |||
) | const [inline, inherited] |
save the cube to a file
Definition at line 1359 of file Cube_meat.hpp.
References arma_ascii, arma_binary, arma_stop(), ppm_binary, raw_ascii, diskio::save_arma_ascii(), diskio::save_arma_binary(), diskio::save_ppm_binary(), and diskio::save_raw_ascii().
01360 { 01361 arma_extra_debug_sigprint(); 01362 01363 switch(type) 01364 { 01365 case raw_ascii: 01366 diskio::save_raw_ascii(*this, name); 01367 break; 01368 01369 case arma_ascii: 01370 diskio::save_arma_ascii(*this, name); 01371 break; 01372 01373 case arma_binary: 01374 diskio::save_arma_binary(*this, name); 01375 break; 01376 01377 case ppm_binary: 01378 diskio::save_ppm_binary(*this, name); 01379 break; 01380 01381 default: 01382 arma_stop("Cube::save(): unsupported file type"); 01383 } 01384 01385 }
void Cube< eT >::load | ( | const std::string | name, | |
const file_type | type = auto_detect | |||
) | [inline, inherited] |
load a cube from a file
Definition at line 1393 of file Cube_meat.hpp.
References arma_ascii, arma_binary, arma_stop(), auto_detect, diskio::load_arma_ascii(), diskio::load_arma_binary(), diskio::load_auto_detect(), diskio::load_ppm_binary(), diskio::load_raw_ascii(), ppm_binary, and raw_ascii.
01394 { 01395 arma_extra_debug_sigprint(); 01396 01397 switch(type) 01398 { 01399 case auto_detect: 01400 diskio::load_auto_detect(*this, name); 01401 break; 01402 01403 case raw_ascii: 01404 diskio::load_raw_ascii(*this, name); 01405 break; 01406 01407 case arma_ascii: 01408 diskio::load_arma_ascii(*this, name); 01409 break; 01410 01411 case arma_binary: 01412 diskio::load_arma_binary(*this, name); 01413 break; 01414 01415 case ppm_binary: 01416 diskio::load_ppm_binary(*this, name); 01417 break; 01418 01419 default: 01420 arma_stop("Cube::load(): unsupported file type"); 01421 } 01422 01423 }
arma_inline void Cube_aux::prefix_pp | ( | Cube< eT > & | x | ) | [inline, static, inherited] |
prefix ++
Definition at line 1431 of file Cube_meat.hpp.
References Cube< eT >::memptr(), and Cube< eT >::n_elem.
Referenced by Cube< eT >::operator++().
arma_inline void Cube_aux::prefix_pp | ( | Cube< std::complex< T > > & | x | ) | [inline, static, inherited] |
prefix ++ for complex numbers (work around for limitations of the std::complex class)
Definition at line 1448 of file Cube_meat.hpp.
arma_inline void Cube_aux::postfix_pp | ( | Cube< eT > & | x | ) | [inline, static, inherited] |
postfix ++
Definition at line 1459 of file Cube_meat.hpp.
References Cube< eT >::memptr(), and Cube< eT >::n_elem.
Referenced by Cube< eT >::operator++().
arma_inline void Cube_aux::postfix_pp | ( | Cube< std::complex< T > > & | x | ) | [inline, static, inherited] |
postfix ++ for complex numbers (work around for limitations of the std::complex class)
Definition at line 1476 of file Cube_meat.hpp.
arma_inline void Cube_aux::prefix_mm | ( | Cube< eT > & | x | ) | [inline, static, inherited] |
prefix --
Definition at line 1487 of file Cube_meat.hpp.
References Cube< eT >::memptr(), and Cube< eT >::n_elem.
Referenced by Cube< eT >::operator--().
arma_inline void Cube_aux::prefix_mm | ( | Cube< std::complex< T > > & | x | ) | [inline, static, inherited] |
prefix -- for complex numbers (work around for limitations of the std::complex class)
Definition at line 1504 of file Cube_meat.hpp.
arma_inline void Cube_aux::postfix_mm | ( | Cube< eT > & | x | ) | [inline, static, inherited] |
postfix --
Definition at line 1515 of file Cube_meat.hpp.
References Cube< eT >::memptr(), and Cube< eT >::n_elem.
Referenced by Cube< eT >::operator--().
arma_inline void Cube_aux::postfix_mm | ( | Cube< std::complex< T > > & | x | ) | [inline, static, inherited] |
postfix ++ for complex numbers (work around for limitations of the std::complex class)
Definition at line 1532 of file Cube_meat.hpp.