Classes | |
class | subview_cube< eT > |
Class for storing data required to construct or apply operations to a subcube (i.e. where the subcube starts and ends as well as a reference/pointer to the original cube),. More... | |
Functions | |
subview_cube::~subview_cube () | |
arma_inline | subview_cube::subview_cube (const Cube< eT > &in_m, const u32 in_row1, const u32 in_col1, const u32 in_slice1, const u32 in_row2, const u32 in_col2, const u32 in_slice2) |
arma_inline | subview_cube::subview_cube (Cube< eT > &in_m, const u32 in_row1, const u32 in_col1, const u32 in_slice1, const u32 in_row2, const u32 in_col2, const u32 in_slice2) |
void | subview_cube::operator+= (const eT val) |
void | subview_cube::operator-= (const eT val) |
void | subview_cube::operator*= (const eT val) |
void | subview_cube::operator/= (const eT val) |
template<typename T1 > | |
void | subview_cube::operator= (const BaseCube< eT, T1 > &x) |
template<typename T1 > | |
void | subview_cube::operator+= (const BaseCube< eT, T1 > &x) |
template<typename T1 > | |
void | subview_cube::operator-= (const BaseCube< eT, T1 > &x) |
template<typename T1 > | |
void | subview_cube::operator%= (const BaseCube< eT, T1 > &x) |
template<typename T1 > | |
void | subview_cube::operator/= (const BaseCube< eT, T1 > &x) |
void | subview_cube::operator= (const subview_cube &x) |
x.subcube(...) = y.subcube(...) | |
void | subview_cube::operator+= (const subview_cube &x) |
void | subview_cube::operator-= (const subview_cube &x) |
void | subview_cube::operator%= (const subview_cube &x) |
void | subview_cube::operator/= (const subview_cube &x) |
template<typename T1 > | |
void | subview_cube::operator= (const Base< eT, T1 > &x) |
template<typename T1 > | |
void | subview_cube::operator+= (const Base< eT, T1 > &x) |
template<typename T1 > | |
void | subview_cube::operator-= (const Base< eT, T1 > &x) |
template<typename T1 > | |
void | subview_cube::operator%= (const Base< eT, T1 > &x) |
template<typename T1 > | |
void | subview_cube::operator/= (const Base< eT, T1 > &x) |
void | subview_cube::fill (const eT val) |
void | subview_cube::zeros () |
void | subview_cube::ones () |
arma_inline eT & | subview_cube::operator[] (const u32 i) |
arma_inline eT | subview_cube::operator[] (const u32 i) const |
arma_inline eT & | subview_cube::operator() (const u32 i) |
arma_inline eT | subview_cube::operator() (const u32 i) const |
arma_inline eT & | subview_cube::operator() (const u32 in_row, const u32 in_col, const u32 in_slice) |
arma_inline eT | subview_cube::operator() (const u32 in_row, const u32 in_col, const u32 in_slice) const |
arma_inline eT & | subview_cube::at (const u32 in_row, const u32 in_col, const u32 in_slice) |
arma_inline eT | subview_cube::at (const u32 in_row, const u32 in_col, const u32 in_slice) const |
arma_inline eT * | subview_cube::slice_colptr (const u32 in_slice, const u32 in_col) |
arma_inline const eT * | subview_cube::slice_colptr (const u32 in_slice, const u32 in_col) const |
bool | subview_cube::check_overlap (const subview_cube &x) const |
bool | subview_cube::check_overlap (const Mat< eT > &x) const |
static void | subview_cube::extract (Cube< eT > &out, const subview_cube &in) |
cube X = Y.subcube(...) | |
static void | subview_cube::extract (Mat< eT > &out, const subview_cube &in) |
mat X = Y.subcube(...) | |
static void | subview_cube::plus_inplace (Cube< eT > &out, const subview_cube &in) |
cube X += Y.subcube(...) | |
static void | subview_cube::minus_inplace (Cube< eT > &out, const subview_cube &in) |
cube X -= Y.subcube(...) | |
static void | subview_cube::schur_inplace (Cube< eT > &out, const subview_cube &in) |
cube X = Y.subcube(...) | |
static void | subview_cube::div_inplace (Cube< eT > &out, const subview_cube &in) |
cube X /= Y.subcube(...) | |
static void | subview_cube::plus_inplace (Mat< eT > &out, const subview_cube &in) |
mat X += Y.subcube(...) | |
static void | subview_cube::minus_inplace (Mat< eT > &out, const subview_cube &in) |
mat X -= Y.subcube(...) | |
static void | subview_cube::schur_inplace (Mat< eT > &out, const subview_cube &in) |
mat X = Y.subcube(...) | |
static void | subview_cube::div_inplace (Mat< eT > &out, const subview_cube &in) |
mat X /= Y.subcube(...) |
subview_cube< eT >::~subview_cube | ( | ) | [inline, inherited] |
Definition at line 23 of file subview_cube_meat.hpp.
arma_inline subview_cube< eT >::subview_cube | ( | const Cube< eT > & | in_m, | |
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, protected, inherited] |
Definition at line 33 of file subview_cube_meat.hpp.
00042 : m (in_m) 00043 , m_ptr (0) 00044 , aux_row1 (in_row1) 00045 , aux_col1 (in_col1) 00046 , aux_slice1 (in_slice1) 00047 , aux_row2 (in_row2) 00048 , aux_col2 (in_col2) 00049 , aux_slice2 (in_slice2) 00050 , n_rows (1 + in_row2 - in_row1) 00051 , n_cols (1 + in_col2 - in_col1) 00052 , n_elem_slice(n_rows * n_cols) 00053 , n_slices (1 + in_slice2 - in_slice1) 00054 , n_elem (n_elem_slice * n_slices) 00055 { 00056 arma_extra_debug_sigprint(); 00057 }
arma_inline subview_cube< eT >::subview_cube | ( | Cube< eT > & | in_m, | |
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, protected, inherited] |
Definition at line 64 of file subview_cube_meat.hpp.
00073 : m (in_m) 00074 , m_ptr (&in_m) 00075 , aux_row1 (in_row1) 00076 , aux_col1 (in_col1) 00077 , aux_slice1 (in_slice1) 00078 , aux_row2 (in_row2) 00079 , aux_col2 (in_col2) 00080 , aux_slice2 (in_slice2) 00081 , n_rows (1 + in_row2 - in_row1) 00082 , n_cols (1 + in_col2 - in_col1) 00083 , n_elem_slice(n_rows * n_cols) 00084 , n_slices (1 + in_slice2 - in_slice1) 00085 , n_elem (n_elem_slice * n_slices) 00086 { 00087 arma_extra_debug_sigprint(); 00088 }
void subview_cube< eT >::operator+= | ( | const eT | val | ) | [inline, inherited] |
Definition at line 95 of file subview_cube_meat.hpp.
References subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00096 { 00097 arma_extra_debug_sigprint(); 00098 00099 for(u32 slice = 0; slice < n_slices; ++slice) 00100 { 00101 for(u32 col = 0; col < n_cols; ++col) 00102 { 00103 eT* coldata = slice_colptr(slice,col); 00104 00105 for(u32 row = 0; row < n_rows; ++row) 00106 { 00107 coldata[row] += val; 00108 } 00109 00110 } 00111 } 00112 00113 }
void subview_cube< eT >::operator-= | ( | const eT | val | ) | [inline, inherited] |
Definition at line 120 of file subview_cube_meat.hpp.
References subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00121 { 00122 arma_extra_debug_sigprint(); 00123 00124 for(u32 slice = 0; slice < n_slices; ++slice) 00125 { 00126 for(u32 col = 0; col<n_cols; ++col) 00127 { 00128 eT* coldata = slice_colptr(slice,col); 00129 00130 for(u32 row = 0; row<n_rows; ++row) 00131 { 00132 coldata[row] -= val; 00133 } 00134 00135 } 00136 } 00137 }
void subview_cube< eT >::operator*= | ( | const eT | val | ) | [inline, inherited] |
Definition at line 144 of file subview_cube_meat.hpp.
References subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00145 { 00146 arma_extra_debug_sigprint(); 00147 00148 for(u32 slice = 0; slice < n_slices; ++slice) 00149 { 00150 for(u32 col = 0; col<n_cols; ++col) 00151 { 00152 eT* coldata = slice_colptr(slice,col); 00153 00154 for(u32 row = 0; row<n_rows; ++row) 00155 { 00156 coldata[row] *= val; 00157 } 00158 00159 } 00160 } 00161 }
void subview_cube< eT >::operator/= | ( | const eT | val | ) | [inline, inherited] |
Definition at line 168 of file subview_cube_meat.hpp.
References subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00169 { 00170 arma_extra_debug_sigprint(); 00171 00172 for(u32 slice = 0; slice < n_slices; ++slice) 00173 { 00174 for(u32 col = 0; col<n_cols; ++col) 00175 { 00176 eT* coldata = slice_colptr(slice,col); 00177 00178 for(u32 row = 0; row<n_rows; ++row) 00179 { 00180 coldata[row] /= val; 00181 } 00182 00183 } 00184 } 00185 }
void subview_cube< eT >::operator= | ( | const BaseCube< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 193 of file subview_cube_meat.hpp.
References BaseCube< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00194 { 00195 arma_extra_debug_sigprint(); 00196 00197 const unwrap_cube<T1> tmp(in.get_ref()); 00198 00199 const Cube<eT>& x = tmp.M; 00200 subview_cube<eT>& t = *this; 00201 00202 arma_debug_assert_same_size(t, x, "copy into subcube"); 00203 00204 00205 for(u32 slice = 0; slice < t.n_slices; ++slice) 00206 { 00207 for(u32 col = 0; col < t.n_cols; ++col) 00208 { 00209 eT* t_coldata = t.slice_colptr(slice,col); 00210 const eT* x_coldata = x.slice_colptr(slice,col); 00211 00212 for(u32 row = 0; row < t.n_rows; ++row) 00213 { 00214 t_coldata[row] = x_coldata[row]; 00215 } 00216 00217 } 00218 } 00219 }
void subview_cube< eT >::operator+= | ( | const BaseCube< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 227 of file subview_cube_meat.hpp.
References BaseCube< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00228 { 00229 arma_extra_debug_sigprint(); 00230 00231 const unwrap_cube<T1> tmp(in.get_ref()); 00232 00233 const Cube<eT>& x = tmp.M; 00234 subview_cube<eT>& t = *this; 00235 00236 arma_debug_assert_same_size(t, x, "cube addition"); 00237 00238 for(u32 slice = 0; slice < t.n_slices; ++slice) 00239 { 00240 for(u32 col = 0; col < t.n_cols; ++col) 00241 { 00242 eT* t_coldata = t.slice_colptr(slice,col); 00243 const eT* x_coldata = x.slice_colptr(slice,col); 00244 00245 for(u32 row = 0; row < t.n_rows; ++row) 00246 { 00247 t_coldata[row] += x_coldata[row]; 00248 } 00249 } 00250 } 00251 00252 }
void subview_cube< eT >::operator-= | ( | const BaseCube< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 260 of file subview_cube_meat.hpp.
References BaseCube< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00261 { 00262 arma_extra_debug_sigprint(); 00263 00264 const unwrap_cube<T1> tmp(in.get_ref()); 00265 00266 const Cube<eT>& x = tmp.M; 00267 subview_cube<eT>& t = *this; 00268 00269 arma_debug_assert_same_size(t, x, "cube subtraction"); 00270 00271 00272 for(u32 slice = 0; slice < t.n_slices; ++slice) 00273 { 00274 for(u32 col = 0; col < t.n_cols; ++col) 00275 { 00276 eT* t_coldata = t.slice_colptr(slice,col); 00277 const eT* x_coldata = x.slice_colptr(slice,col); 00278 00279 for(u32 row = 0; row < t.n_rows; ++row) 00280 { 00281 t_coldata[row] -= x_coldata[row]; 00282 } 00283 } 00284 } 00285 }
void subview_cube< eT >::operator%= | ( | const BaseCube< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 293 of file subview_cube_meat.hpp.
References BaseCube< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00294 { 00295 arma_extra_debug_sigprint(); 00296 00297 const unwrap_cube<T1> tmp(in.get_ref()); 00298 00299 const Cube<eT>& x = tmp.M; 00300 subview_cube<eT>& t = *this; 00301 00302 arma_debug_assert_same_size(t, x, "cube schur product"); 00303 00304 for(u32 slice = 0; slice < t.n_slices; ++slice) 00305 { 00306 for(u32 col = 0; col<t.n_cols; ++col) 00307 { 00308 eT* t_coldata = t.slice_colptr(slice,col); 00309 const eT* x_coldata = x.slice_colptr(slice,col); 00310 00311 for(u32 row = 0; row<t.n_rows; ++row) 00312 { 00313 t_coldata[row] *= x_coldata[row]; 00314 } 00315 } 00316 } 00317 00318 }
void subview_cube< eT >::operator/= | ( | const BaseCube< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 326 of file subview_cube_meat.hpp.
References BaseCube< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00327 { 00328 arma_extra_debug_sigprint(); 00329 00330 const unwrap_cube<T1> tmp(in.get_ref()); 00331 00332 const Cube<eT>& x = tmp.M; 00333 subview_cube<eT>& t = *this; 00334 00335 arma_debug_assert_same_size(t, x, "element-wise cube division"); 00336 00337 00338 for(u32 slice = 0; slice < t.n_slices; ++slice) 00339 { 00340 for(u32 col = 0; col<t.n_cols; ++col) 00341 { 00342 eT* t_coldata = t.slice_colptr(slice,col); 00343 const eT* x_coldata = x.slice_colptr(slice,col); 00344 00345 for(u32 row = 0; row<t.n_rows; ++row) 00346 { 00347 t_coldata[row] /= x_coldata[row]; 00348 } 00349 } 00350 } 00351 00352 }
void subview_cube< eT >::operator= | ( | const subview_cube< eT > & | x | ) | [inline, inherited] |
x.subcube(...) = y.subcube(...)
Definition at line 360 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_col2, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_row2, subview_cube< eT >::aux_slice1, subview_cube< eT >::aux_slice2, subview_cube< eT >::check_overlap(), subview_cube< eT >::m, subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00361 { 00362 arma_extra_debug_sigprint(); 00363 00364 const bool overlap = check_overlap(x_in); 00365 00366 Cube<eT>* tmp_cube = overlap ? new Cube<eT>(x_in.m) : 0; 00367 const subview_cube<eT>* tmp_subview_cube = overlap ? new subview_cube<eT>(*tmp_cube, x_in.aux_row1, x_in.aux_col1, x_in.aux_slice1, x_in.aux_row2, x_in.aux_col2, x_in.aux_slice2) : 0; 00368 const subview_cube<eT>& x = overlap ? (*tmp_subview_cube) : x_in; 00369 00370 subview_cube<eT>& t = *this; 00371 00372 arma_debug_assert_same_size(t, x, "copy into subcube"); 00373 00374 00375 for(u32 slice = 0; slice < t.n_slices; ++slice) 00376 { 00377 for(u32 col = 0; col < t.n_cols; ++col) 00378 { 00379 eT* t_coldata = t.slice_colptr(slice,col); 00380 const eT* x_coldata = x.slice_colptr(slice,col); 00381 00382 for(u32 row = 0; row < t.n_rows; ++row) 00383 { 00384 t_coldata[row] = x_coldata[row]; 00385 } 00386 } 00387 } 00388 00389 if(overlap) 00390 { 00391 delete tmp_subview_cube; 00392 delete tmp_cube; 00393 } 00394 00395 }
void subview_cube< eT >::operator+= | ( | const subview_cube< eT > & | x | ) | [inline, inherited] |
Definition at line 402 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_col2, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_row2, subview_cube< eT >::aux_slice1, subview_cube< eT >::aux_slice2, subview_cube< eT >::check_overlap(), subview_cube< eT >::m, subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00403 { 00404 arma_extra_debug_sigprint(); 00405 00406 const bool overlap = check_overlap(x_in); 00407 00408 Cube<eT>* tmp_cube = overlap ? new Cube<eT>(x_in.m) : 0; 00409 const subview_cube<eT>* tmp_subview_cube = overlap ? new subview_cube<eT>(*tmp_cube, x_in.aux_row1, x_in.aux_col1, x_in.aux_slice1, x_in.aux_row2, x_in.aux_col2, x_in.aux_slice2) : 0; 00410 const subview_cube<eT>& x = overlap ? (*tmp_subview_cube) : x_in; 00411 00412 subview_cube<eT>& t = *this; 00413 00414 arma_debug_assert_same_size(t, x, "cube addition"); 00415 00416 00417 for(u32 slice = 0; slice < t.n_slices; ++slice) 00418 { 00419 for(u32 col = 0; col < t.n_cols; ++col) 00420 { 00421 eT* t_coldata = t.slice_colptr(slice,col); 00422 const eT* x_coldata = x.slice_colptr(slice,col); 00423 00424 for(u32 row = 0; row < t.n_rows; ++row) 00425 { 00426 t_coldata[row] += x_coldata[row]; 00427 } 00428 } 00429 } 00430 00431 if(overlap) 00432 { 00433 delete tmp_subview_cube; 00434 delete tmp_cube; 00435 } 00436 00437 }
void subview_cube< eT >::operator-= | ( | const subview_cube< eT > & | x | ) | [inline, inherited] |
Definition at line 444 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_col2, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_row2, subview_cube< eT >::aux_slice1, subview_cube< eT >::aux_slice2, subview_cube< eT >::check_overlap(), subview_cube< eT >::m, subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00445 { 00446 arma_extra_debug_sigprint(); 00447 00448 const bool overlap = check_overlap(x_in); 00449 00450 Cube<eT>* tmp_cube = overlap ? new Cube<eT>(x_in.m) : 0; 00451 const subview_cube<eT>* tmp_subview_cube = overlap ? new subview_cube<eT>(*tmp_cube, x_in.aux_row1, x_in.aux_col1, x_in.aux_slice1, x_in.aux_row2, x_in.aux_col2, x_in.aux_slice2) : 0; 00452 const subview_cube<eT>& x = overlap ? (*tmp_subview_cube) : x_in; 00453 00454 subview_cube<eT>& t = *this; 00455 00456 arma_debug_assert_same_size(t, x, "cube subtraction"); 00457 00458 00459 for(u32 slice = 0; slice < t.n_slices; ++slice) 00460 { 00461 for(u32 col = 0; col < t.n_cols; ++col) 00462 { 00463 eT* t_coldata = t.slice_colptr(slice,col); 00464 const eT* x_coldata = x.slice_colptr(slice,col); 00465 00466 for(u32 row = 0; row < t.n_rows; ++row) 00467 { 00468 t_coldata[row] -= x_coldata[row]; 00469 } 00470 } 00471 } 00472 00473 if(overlap) 00474 { 00475 delete tmp_subview_cube; 00476 delete tmp_cube; 00477 } 00478 00479 }
void subview_cube< eT >::operator%= | ( | const subview_cube< eT > & | x | ) | [inline, inherited] |
Definition at line 486 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_col2, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_row2, subview_cube< eT >::aux_slice1, subview_cube< eT >::aux_slice2, subview_cube< eT >::check_overlap(), subview_cube< eT >::m, subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00487 { 00488 arma_extra_debug_sigprint(); 00489 00490 const bool overlap = check_overlap(x_in); 00491 00492 Cube<eT>* tmp_cube = overlap ? new Cube<eT>(x_in.m) : 0; 00493 const subview_cube<eT>* tmp_subview_cube = overlap ? new subview_cube<eT>(*tmp_cube, x_in.aux_row1, x_in.aux_col1, x_in.aux_slice1, x_in.aux_row2, x_in.aux_col2, x_in.aux_slice2) : 0; 00494 const subview_cube<eT>& x = overlap ? (*tmp_subview_cube) : x_in; 00495 00496 subview_cube<eT>& t = *this; 00497 00498 arma_debug_assert_same_size(t, x, "element-wise cube multiplication"); 00499 00500 00501 for(u32 slice = 0; slice < t.n_slices; ++slice) 00502 { 00503 for(u32 col = 0; col < t.n_cols; ++col) 00504 { 00505 eT* t_coldata = t.slice_colptr(slice,col); 00506 const eT* x_coldata = x.slice_colptr(slice,col); 00507 00508 for(u32 row = 0; row < t.n_rows; ++row) 00509 { 00510 t_coldata[row] *= x_coldata[row]; 00511 } 00512 } 00513 } 00514 00515 if(overlap) 00516 { 00517 delete tmp_subview_cube; 00518 delete tmp_cube; 00519 } 00520 00521 }
void subview_cube< eT >::operator/= | ( | const subview_cube< eT > & | x | ) | [inline, inherited] |
Definition at line 528 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_col2, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_row2, subview_cube< eT >::aux_slice1, subview_cube< eT >::aux_slice2, subview_cube< eT >::check_overlap(), subview_cube< eT >::m, subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
00529 { 00530 arma_extra_debug_sigprint(); 00531 00532 const bool overlap = check_overlap(x_in); 00533 00534 Cube<eT>* tmp_cube = overlap ? new Cube<eT>(x_in.m) : 0; 00535 const subview_cube<eT>* tmp_subview_cube = overlap ? new subview_cube<eT>(*tmp_cube, x_in.aux_row1, x_in.aux_col1, x_in.aux_slice1, x_in.aux_row2, x_in.aux_col2, x_in.aux_slice2) : 0; 00536 const subview_cube<eT>& x = overlap ? (*tmp_subview_cube) : x_in; 00537 00538 subview_cube<eT>& t = *this; 00539 00540 arma_debug_assert_same_size(t, x, "element-wise cube division"); 00541 00542 00543 for(u32 slice = 0; slice < t.n_slices; ++slice) 00544 { 00545 for(u32 col = 0; col < t.n_cols; ++col) 00546 { 00547 eT* t_coldata = t.slice_colptr(slice,col); 00548 const eT* x_coldata = x.slice_colptr(slice,col); 00549 00550 for(u32 row = 0; row < t.n_rows; ++row) 00551 { 00552 t_coldata[row] /= x_coldata[row]; 00553 } 00554 } 00555 } 00556 00557 if(overlap) 00558 { 00559 delete tmp_subview_cube; 00560 delete tmp_cube; 00561 } 00562 00563 }
void subview_cube< eT >::operator= | ( | const Base< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 571 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Base< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::slice_colptr().
00572 { 00573 arma_extra_debug_sigprint(); 00574 00575 const unwrap<T1> tmp(in.get_ref()); 00576 00577 const Mat<eT>& x = tmp.M; 00578 subview_cube<eT>& t = *this; 00579 00580 arma_debug_assert_same_size(t, x, "copy into subcube"); 00581 00582 00583 for(u32 col = 0; col < t.n_cols; ++col) 00584 { 00585 eT* t_coldata = t.slice_colptr(t.aux_slice1, col); 00586 const eT* x_coldata = x.colptr(col); 00587 00588 for(u32 row = 0; row < t.n_rows; ++row) 00589 { 00590 t_coldata[row] = x_coldata[row]; 00591 } 00592 00593 } 00594 }
void subview_cube< eT >::operator+= | ( | const Base< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 602 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Base< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::slice_colptr().
00603 { 00604 arma_extra_debug_sigprint(); 00605 00606 const unwrap<T1> tmp(in.get_ref()); 00607 00608 const Mat<eT>& x = tmp.M; 00609 subview_cube<eT>& t = *this; 00610 00611 arma_debug_assert_same_size(t, x, "cube addition"); 00612 00613 for(u32 col = 0; col < t.n_cols; ++col) 00614 { 00615 eT* t_coldata = t.slice_colptr(t.aux_slice1, col); 00616 const eT* x_coldata = x.colptr(col); 00617 00618 for(u32 row = 0; row < t.n_rows; ++row) 00619 { 00620 t_coldata[row] += x_coldata[row]; 00621 } 00622 } 00623 }
void subview_cube< eT >::operator-= | ( | const Base< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 631 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Base< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::slice_colptr().
00632 { 00633 arma_extra_debug_sigprint(); 00634 00635 const unwrap<T1> tmp(in.get_ref()); 00636 00637 const Mat<eT>& x = tmp.M; 00638 subview_cube<eT>& t = *this; 00639 00640 arma_debug_assert_same_size(t, x, "cube subtraction"); 00641 00642 for(u32 col = 0; col < t.n_cols; ++col) 00643 { 00644 eT* t_coldata = t.slice_colptr(t.aux_slice1, col); 00645 const eT* x_coldata = x.colptr(col); 00646 00647 for(u32 row = 0; row < t.n_rows; ++row) 00648 { 00649 t_coldata[row] -= x_coldata[row]; 00650 } 00651 } 00652 }
void subview_cube< eT >::operator%= | ( | const Base< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 660 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Base< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::slice_colptr().
00661 { 00662 arma_extra_debug_sigprint(); 00663 00664 const unwrap<T1> tmp(in.get_ref()); 00665 00666 const Mat<eT>& x = tmp.M; 00667 subview_cube<eT>& t = *this; 00668 00669 arma_debug_assert_same_size(t, x, "cube schur product"); 00670 00671 for(u32 col = 0; col<t.n_cols; ++col) 00672 { 00673 eT* t_coldata = t.slice_colptr(t.aux_slice1, col); 00674 const eT* x_coldata = x.colptr(col); 00675 00676 for(u32 row = 0; row<t.n_rows; ++row) 00677 { 00678 t_coldata[row] *= x_coldata[row]; 00679 } 00680 } 00681 }
void subview_cube< eT >::operator/= | ( | const Base< eT, T1 > & | x | ) | [inline, inherited] |
Definition at line 689 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Base< elem_type, derived >::get_ref(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::slice_colptr().
00690 { 00691 arma_extra_debug_sigprint(); 00692 00693 const unwrap<T1> tmp(in.get_ref()); 00694 00695 const Mat<eT>& x = tmp.M; 00696 subview_cube<eT>& t = *this; 00697 00698 arma_debug_assert_same_size(t, x, "element-wise cube division"); 00699 00700 00701 for(u32 col = 0; col<t.n_cols; ++col) 00702 { 00703 eT* t_coldata = t.slice_colptr(t.aux_slice1, col); 00704 const eT* x_coldata = x.colptr(col); 00705 00706 for(u32 row = 0; row<t.n_rows; ++row) 00707 { 00708 t_coldata[row] /= x_coldata[row]; 00709 } 00710 } 00711 }
void subview_cube< eT >::fill | ( | const eT | val | ) | [inline, inherited] |
Definition at line 718 of file subview_cube_meat.hpp.
References subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and subview_cube< eT >::slice_colptr().
Referenced by subview_cube< eT >::ones(), and subview_cube< eT >::zeros().
00719 { 00720 arma_extra_debug_sigprint(); 00721 00722 for(u32 slice = 0; slice < n_slices; ++slice) 00723 { 00724 for(u32 col = 0; col < n_cols; ++col) 00725 { 00726 eT* coldata = slice_colptr(slice,col); 00727 00728 for(u32 row = 0; row < n_rows; ++row) 00729 { 00730 coldata[row] = val; 00731 } 00732 } 00733 } 00734 00735 }
void subview_cube< eT >::zeros | ( | ) | [inline, inherited] |
Definition at line 742 of file subview_cube_meat.hpp.
References subview_cube< eT >::fill().
00743 { 00744 arma_extra_debug_sigprint(); 00745 00746 fill(eT(0)); 00747 }
void subview_cube< eT >::ones | ( | ) | [inline, inherited] |
Definition at line 754 of file subview_cube_meat.hpp.
References subview_cube< eT >::fill().
00755 { 00756 arma_extra_debug_sigprint(); 00757 00758 fill(eT(1)); 00759 }
arma_inline eT & subview_cube< eT >::operator[] | ( | const u32 | i | ) | [inline, inherited] |
Definition at line 766 of file subview_cube_meat.hpp.
References arma_check(), subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, subview_cube< eT >::m, subview_cube< eT >::m_ptr, subview_cube< eT >::n_elem_slice, subview_cube< eT >::n_rows, and access::rw().
00767 { 00768 arma_check( (m_ptr == 0), "subview_cube::operator[]: cube is read-only"); 00769 00770 const u32 in_slice = i / n_elem_slice; 00771 const u32 offset = in_slice * n_elem_slice; 00772 const u32 j = i - offset; 00773 00774 const u32 in_col = j / n_rows; 00775 const u32 in_row = j % n_rows; 00776 00777 const u32 index = (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; 00778 return access::rw( (*m_ptr).mem[index] ); 00779 }
arma_inline eT subview_cube< eT >::operator[] | ( | const u32 | i | ) | const [inline, inherited] |
Definition at line 786 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, subview_cube< eT >::m, subview_cube< eT >::n_elem_slice, and subview_cube< eT >::n_rows.
00787 { 00788 const u32 in_slice = i / n_elem_slice; 00789 const u32 offset = in_slice * n_elem_slice; 00790 const u32 j = i - offset; 00791 00792 const u32 in_col = j / n_rows; 00793 const u32 in_row = j % n_rows; 00794 00795 const u32 index = (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; 00796 return m.mem[index]; 00797 }
arma_inline eT & subview_cube< eT >::operator() | ( | const u32 | i | ) | [inline, inherited] |
Definition at line 804 of file subview_cube_meat.hpp.
References arma_check(), subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, subview_cube< eT >::m, subview_cube< eT >::m_ptr, subview_cube< eT >::n_elem, subview_cube< eT >::n_elem_slice, subview_cube< eT >::n_rows, and access::rw().
00805 { 00806 arma_check( (m_ptr == 0), "subview_cube::operator(): matrix is read-only"); 00807 arma_debug_check( (i >= n_elem), "subview_cube::operator(): index out of bounds"); 00808 00809 const u32 in_slice = i / n_elem_slice; 00810 const u32 offset = in_slice * n_elem_slice; 00811 const u32 j = i - offset; 00812 00813 const u32 in_col = j / n_rows; 00814 const u32 in_row = j % n_rows; 00815 00816 const u32 index = (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; 00817 return access::rw( (*m_ptr).mem[index] ); 00818 }
arma_inline eT subview_cube< eT >::operator() | ( | const u32 | i | ) | const [inline, inherited] |
Definition at line 825 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, subview_cube< eT >::m, subview_cube< eT >::n_elem, subview_cube< eT >::n_elem_slice, and subview_cube< eT >::n_rows.
00826 { 00827 arma_debug_check( (i >= n_elem), "subview_cube::operator(): index out of bounds"); 00828 00829 const u32 in_slice = i / n_elem_slice; 00830 const u32 offset = in_slice * n_elem_slice; 00831 const u32 j = i - offset; 00832 00833 const u32 in_col = j / n_rows; 00834 const u32 in_row = j % n_rows; 00835 00836 const u32 index = (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; 00837 return m.mem[index]; 00838 }
arma_inline eT & subview_cube< eT >::operator() | ( | const u32 | in_row, | |
const u32 | in_col, | |||
const u32 | in_slice | |||
) | [inline, inherited] |
Definition at line 845 of file subview_cube_meat.hpp.
References arma_check(), subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, subview_cube< eT >::m, subview_cube< eT >::m_ptr, subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, and access::rw().
00846 { 00847 arma_check( (m_ptr == 0), "subview_cube::operator(): matrix is read-only"); 00848 arma_debug_check( ( (in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices) ), "subview_cube::operator(): location out of bounds"); 00849 00850 const u32 index = (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; 00851 return access::rw( (*m_ptr).mem[index] ); 00852 }
arma_inline eT subview_cube< eT >::operator() | ( | const u32 | in_row, | |
const u32 | in_col, | |||
const u32 | in_slice | |||
) | const [inline, inherited] |
Definition at line 859 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, subview_cube< eT >::m, subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::n_slices.
00860 { 00861 arma_debug_check( ( (in_row >= n_rows) || (in_col >= n_cols) || (in_slice >= n_slices) ), "subview_cube::operator(): location out of bounds"); 00862 00863 const u32 index = (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; 00864 return m.mem[index]; 00865 }
arma_inline eT & subview_cube< eT >::at | ( | const u32 | in_row, | |
const u32 | in_col, | |||
const u32 | in_slice | |||
) | [inline, inherited] |
Definition at line 872 of file subview_cube_meat.hpp.
References arma_check(), subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, subview_cube< eT >::m, subview_cube< eT >::m_ptr, and access::rw().
00873 { 00874 arma_check( (m_ptr == 0), "subview_cube::at(): cube is read-only"); 00875 00876 const u32 index = (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; 00877 return access::rw( (*m_ptr).mem[index] ); 00878 }
arma_inline eT subview_cube< eT >::at | ( | const u32 | in_row, | |
const u32 | in_col, | |||
const u32 | in_slice | |||
) | const [inline, inherited] |
Definition at line 885 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, and subview_cube< eT >::m.
arma_inline eT * subview_cube< eT >::slice_colptr | ( | const u32 | in_slice, | |
const u32 | in_col | |||
) | [inline, inherited] |
Definition at line 896 of file subview_cube_meat.hpp.
References arma_check(), subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, subview_cube< eT >::m, subview_cube< eT >::m_ptr, and access::rw().
Referenced by subview_cube< eT >::div_inplace(), subview_cube< eT >::extract(), subview_cube< eT >::fill(), subview_cube< eT >::minus_inplace(), subview_cube< eT >::operator%=(), subview_cube< eT >::operator*=(), subview_cube< eT >::operator+=(), subview_cube< eT >::operator-=(), subview_cube< eT >::operator/=(), subview_cube< eT >::operator=(), subview_cube< eT >::plus_inplace(), and subview_cube< eT >::schur_inplace().
00897 { 00898 arma_check( (m_ptr == 0), "subview_cube::slice_colptr(): cube is read-only"); 00899 00900 return & access::rw((*m_ptr).mem[ (in_slice + aux_slice1)*m.n_elem_slice + (in_col + aux_col1)*m.n_rows + aux_row1 ]); 00901 }
arma_inline const eT * subview_cube< eT >::slice_colptr | ( | const u32 | in_slice, | |
const u32 | in_col | |||
) | const [inline, inherited] |
Definition at line 908 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_slice1, and subview_cube< eT >::m.
bool subview_cube< eT >::check_overlap | ( | const subview_cube< eT > & | x | ) | const [inline, inherited] |
Definition at line 918 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_col1, subview_cube< eT >::aux_col2, subview_cube< eT >::aux_row1, subview_cube< eT >::aux_row2, subview_cube< eT >::aux_slice1, subview_cube< eT >::aux_slice2, and subview_cube< eT >::m.
Referenced by subview_cube< eT >::operator%=(), subview_cube< eT >::operator+=(), subview_cube< eT >::operator-=(), subview_cube< eT >::operator/=(), and subview_cube< eT >::operator=().
00919 { 00920 const subview_cube<eT>& t = *this; 00921 00922 if(&t.m != &x.m) 00923 { 00924 return false; 00925 } 00926 else 00927 { 00928 const bool row_overlap = 00929 ( 00930 ( (x.aux_row1 >= t.aux_row1) && (x.aux_row1 <= t.aux_row2) ) 00931 || 00932 ( (x.aux_row2 >= t.aux_row1) && (x.aux_row2 <= t.aux_row2) ) 00933 ); 00934 00935 const bool col_overlap = 00936 ( 00937 ( (x.aux_col1 >= t.aux_col1) && (x.aux_col1 <= t.aux_col2) ) 00938 || 00939 ( (x.aux_col2 >= t.aux_col1) && (x.aux_col2 <= t.aux_col2) ) 00940 ); 00941 00942 const bool slice_overlap = 00943 ( 00944 ( (x.aux_slice1 >= t.aux_slice1) && (x.aux_slice1 <= t.aux_slice2) ) 00945 || 00946 ( (x.aux_slice2 >= t.aux_slice1) && (x.aux_slice2 <= t.aux_slice2) ) 00947 ); 00948 00949 return (row_overlap & col_overlap & slice_overlap); 00950 } 00951 }
bool subview_cube< eT >::check_overlap | ( | const Mat< eT > & | x | ) | const [inline, inherited] |
Definition at line 958 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, subview_cube< eT >::aux_slice2, subview_cube< eT >::m, and Mat< eT >::memptr().
00959 { 00960 const subview_cube<eT>& t = *this; 00961 00962 for(u32 slice = t.aux_slice1; slice <= t.aux_slice2; ++slice) 00963 { 00964 const Mat<eT>& y = *(t.m.mat_ptrs[slice]); 00965 00966 if( x.memptr() == y.memptr() ) 00967 { 00968 return true; 00969 } 00970 } 00971 00972 return false; 00973 }
void subview_cube< eT >::extract | ( | Cube< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
cube X = Y.subcube(...)
Definition at line 981 of file subview_cube_meat.hpp.
References subview_cube< eT >::m, Cube< eT >::n_cols, subview_cube< eT >::n_cols, Cube< eT >::n_rows, subview_cube< eT >::n_rows, Cube< eT >::n_slices, subview_cube< eT >::n_slices, Cube< eT >::set_size(), subview_cube< eT >::slice_colptr(), and Cube< eT >::slice_colptr().
00982 { 00983 arma_extra_debug_sigprint(); 00984 00985 // 00986 const bool alias = (&actual_out == &in.m); 00987 00988 Cube<eT>* tmp = (alias) ? new Cube<eT> : 0; 00989 Cube<eT>& out = (alias) ? (*tmp) : actual_out; 00990 00991 // 00992 00993 const u32 n_rows = in.n_rows; 00994 const u32 n_cols = in.n_cols; 00995 const u32 n_slices = in.n_slices; 00996 00997 out.set_size(n_rows, n_cols, n_slices); 00998 00999 arma_extra_debug_print(arma_boost::format("out.n_rows = %d out.n_cols = %d out.n_slices = %d in.m.n_rows = %d in.m.n_cols = %d in.m.n_slices = %d") % out.n_rows % out.n_cols % out.n_slices % in.m.n_rows % in.m.n_cols % in.m.n_slices); 01000 01001 01002 for(u32 slice = 0; slice<n_slices; ++slice) 01003 { 01004 for(u32 col = 0; col<n_cols; ++col) 01005 { 01006 eT* out_coldata = out.slice_colptr(slice,col); 01007 const eT* in_coldata = in.slice_colptr(slice,col); 01008 01009 for(u32 row = 0; row<n_rows; ++row) 01010 { 01011 out_coldata[row] = in_coldata[row]; 01012 } 01013 01014 } 01015 } 01016 01017 01018 if(alias) 01019 { 01020 actual_out = out; 01021 delete tmp; 01022 } 01023 01024 }
void subview_cube< eT >::extract | ( | Mat< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
mat X = Y.subcube(...)
Definition at line 1032 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Mat< eT >::colptr(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, subview_cube< eT >::n_slices, Mat< eT >::set_size(), and subview_cube< eT >::slice_colptr().
01033 { 01034 arma_extra_debug_sigprint(); 01035 01036 arma_debug_check( (in.n_slices != 1), "subview_cube::extract(): given subcube doesn't have exactly one slice" ); 01037 01038 out.set_size(in.n_rows, in.n_cols); 01039 01040 for(u32 col = 0; col < in.n_cols; ++col) 01041 { 01042 const eT* in_coldata = in.slice_colptr(in.aux_slice1, col); 01043 eT* out_coldata = out.colptr(col); 01044 01045 for(u32 row = 0; row < in.n_rows; ++row) 01046 { 01047 out_coldata[row] = in_coldata[row]; 01048 } 01049 } 01050 }
void subview_cube< eT >::plus_inplace | ( | Cube< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
cube X += Y.subcube(...)
Definition at line 1058 of file subview_cube_meat.hpp.
References Cube< eT >::n_cols, subview_cube< eT >::n_cols, Cube< eT >::n_rows, subview_cube< eT >::n_rows, Cube< eT >::n_slices, subview_cube< eT >::n_slices, subview_cube< eT >::slice_colptr(), and Cube< eT >::slice_colptr().
01059 { 01060 arma_extra_debug_sigprint(); 01061 01062 arma_debug_assert_same_size(out, in, "cube addition"); 01063 01064 const u32 n_rows = out.n_rows; 01065 const u32 n_cols = out.n_cols; 01066 const u32 n_slices = out.n_slices; 01067 01068 for(u32 slice = 0; slice<n_slices; ++slice) 01069 { 01070 for(u32 col = 0; col<n_cols; ++col) 01071 { 01072 eT* out_coldata = out.slice_colptr(slice,col); 01073 const eT* in_coldata = in.slice_colptr(slice,col); 01074 01075 for(u32 row = 0; row<n_rows; ++row) 01076 { 01077 out_coldata[row] += in_coldata[row]; 01078 } 01079 } 01080 } 01081 }
void subview_cube< eT >::minus_inplace | ( | Cube< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
cube X -= Y.subcube(...)
Definition at line 1089 of file subview_cube_meat.hpp.
References Cube< eT >::n_cols, subview_cube< eT >::n_cols, Cube< eT >::n_rows, subview_cube< eT >::n_rows, Cube< eT >::n_slices, subview_cube< eT >::n_slices, subview_cube< eT >::slice_colptr(), and Cube< eT >::slice_colptr().
01090 { 01091 arma_extra_debug_sigprint(); 01092 01093 arma_debug_assert_same_size(out, in, "cube subtraction"); 01094 01095 const u32 n_rows = out.n_rows; 01096 const u32 n_cols = out.n_cols; 01097 const u32 n_slices = out.n_slices; 01098 01099 for(u32 slice = 0; slice<n_slices; ++slice) 01100 { 01101 for(u32 col = 0; col<n_cols; ++col) 01102 { 01103 eT* out_coldata = out.slice_colptr(slice,col); 01104 const eT* in_coldata = in.slice_colptr(slice,col); 01105 01106 for(u32 row = 0; row<n_rows; ++row) 01107 { 01108 out_coldata[row] -= in_coldata[row]; 01109 } 01110 } 01111 } 01112 }
void subview_cube< eT >::schur_inplace | ( | Cube< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
cube X = Y.subcube(...)
Definition at line 1120 of file subview_cube_meat.hpp.
References Cube< eT >::n_cols, subview_cube< eT >::n_cols, Cube< eT >::n_rows, subview_cube< eT >::n_rows, Cube< eT >::n_slices, subview_cube< eT >::n_slices, subview_cube< eT >::slice_colptr(), and Cube< eT >::slice_colptr().
01121 { 01122 arma_extra_debug_sigprint(); 01123 01124 arma_debug_assert_same_size(out, in, "cube schur product"); 01125 01126 const u32 n_rows = out.n_rows; 01127 const u32 n_cols = out.n_cols; 01128 const u32 n_slices = out.n_slices; 01129 01130 for(u32 slice = 0; slice<n_slices; ++slice) 01131 { 01132 for(u32 col = 0; col<n_cols; ++col) 01133 { 01134 eT* out_coldata = out.slice_colptr(slice,col); 01135 const eT* in_coldata = in.slice_colptr(slice,col); 01136 01137 for(u32 row = 0; row<n_rows; ++row) 01138 { 01139 out_coldata[row] *= in_coldata[row]; 01140 } 01141 } 01142 } 01143 }
void subview_cube< eT >::div_inplace | ( | Cube< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
cube X /= Y.subcube(...)
Definition at line 1151 of file subview_cube_meat.hpp.
References Cube< eT >::n_cols, subview_cube< eT >::n_cols, Cube< eT >::n_rows, subview_cube< eT >::n_rows, Cube< eT >::n_slices, subview_cube< eT >::n_slices, subview_cube< eT >::slice_colptr(), and Cube< eT >::slice_colptr().
01152 { 01153 arma_extra_debug_sigprint(); 01154 01155 arma_debug_assert_same_size(out, in, "element-wise cube division"); 01156 01157 const u32 n_rows = out.n_rows; 01158 const u32 n_cols = out.n_cols; 01159 const u32 n_slices = out.n_slices; 01160 01161 for(u32 slice = 0; slice<n_slices; ++slice) 01162 { 01163 for(u32 col = 0; col<n_cols; ++col) 01164 { 01165 eT* out_coldata = out.slice_colptr(slice,col); 01166 const eT* in_coldata = in.slice_colptr(slice,col); 01167 01168 for(u32 row = 0; row<n_rows; ++row) 01169 { 01170 out_coldata[row] /= in_coldata[row]; 01171 } 01172 } 01173 } 01174 }
void subview_cube< eT >::plus_inplace | ( | Mat< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
mat X += Y.subcube(...)
Definition at line 1182 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Mat< eT >::colptr(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::slice_colptr().
01183 { 01184 arma_extra_debug_sigprint(); 01185 01186 arma_debug_assert_same_size(out, in, "matrix addition"); 01187 01188 for(u32 col = 0; col < in.n_cols; ++col) 01189 { 01190 const eT* in_coldata = in.slice_colptr(in.aux_slice1, col); 01191 eT* out_coldata = out.colptr(col); 01192 01193 for(u32 row = 0; row < in.n_rows; ++row) 01194 { 01195 out_coldata[row] += in_coldata[row]; 01196 } 01197 } 01198 01199 }
void subview_cube< eT >::minus_inplace | ( | Mat< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
mat X -= Y.subcube(...)
Definition at line 1207 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Mat< eT >::colptr(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::slice_colptr().
01208 { 01209 arma_extra_debug_sigprint(); 01210 01211 arma_debug_assert_same_size(out, in, "matrix subtraction"); 01212 01213 for(u32 col = 0; col < in.n_cols; ++col) 01214 { 01215 const eT* in_coldata = in.slice_colptr(in.aux_slice1, col); 01216 eT* out_coldata = out.colptr(col); 01217 01218 for(u32 row = 0; row < in.n_rows; ++row) 01219 { 01220 out_coldata[row] -= in_coldata[row]; 01221 } 01222 } 01223 01224 }
void subview_cube< eT >::schur_inplace | ( | Mat< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
mat X = Y.subcube(...)
Definition at line 1232 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Mat< eT >::colptr(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::slice_colptr().
01233 { 01234 arma_extra_debug_sigprint(); 01235 01236 arma_debug_assert_same_size(out, in, "matrix schur product"); 01237 01238 for(u32 col = 0; col < in.n_cols; ++col) 01239 { 01240 const eT* in_coldata = in.slice_colptr(in.aux_slice1, col); 01241 eT* out_coldata = out.colptr(col); 01242 01243 for(u32 row = 0; row < in.n_rows; ++row) 01244 { 01245 out_coldata[row] *= in_coldata[row]; 01246 } 01247 } 01248 01249 }
void subview_cube< eT >::div_inplace | ( | Mat< eT > & | out, | |
const subview_cube< eT > & | in | |||
) | [inline, static, inherited] |
mat X /= Y.subcube(...)
Definition at line 1257 of file subview_cube_meat.hpp.
References subview_cube< eT >::aux_slice1, Mat< eT >::colptr(), subview_cube< eT >::n_cols, subview_cube< eT >::n_rows, and subview_cube< eT >::slice_colptr().
01258 { 01259 arma_extra_debug_sigprint(); 01260 01261 arma_debug_assert_same_size(out, in, "matrix element-wise division"); 01262 01263 for(u32 col = 0; col < in.n_cols; ++col) 01264 { 01265 const eT* in_coldata = in.slice_colptr(in.aux_slice1, col); 01266 eT* out_coldata = out.colptr(col); 01267 01268 for(u32 row = 0; row < in.n_rows; ++row) 01269 { 01270 out_coldata[row] /= in_coldata[row]; 01271 } 01272 } 01273 01274 }