00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 template<typename eT>
00021 inline
00022 Row<eT>::Row()
00023 : Mat<eT>()
00024 {
00025 arma_extra_debug_sigprint();
00026 }
00027
00028
00029
00030 template<typename eT>
00031 inline
00032 Row<eT>::Row(const u32 in_n_elem)
00033 : Mat<eT>(1,in_n_elem)
00034 {
00035 arma_extra_debug_sigprint();
00036 }
00037
00038
00039
00040 template<typename eT>
00041 inline
00042 Row<eT>::Row(const u32 in_n_rows, const u32 in_n_cols)
00043 : Mat<eT>(in_n_rows, in_n_cols)
00044 {
00045 arma_extra_debug_sigprint();
00046
00047 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00048 }
00049
00050
00051
00052 template<typename eT>
00053 inline
00054 Row<eT>::Row(const char* text)
00055 : Mat<eT>(text)
00056 {
00057 arma_extra_debug_sigprint();
00058
00059 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00060 }
00061
00062
00063
00064 template<typename eT>
00065 inline
00066 const Row<eT>&
00067 Row<eT>::operator=(const char* text)
00068 {
00069 arma_extra_debug_sigprint();
00070
00071 Mat<eT>::operator=(text);
00072
00073 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00074
00075 return *this;
00076 }
00077
00078
00079
00080 template<typename eT>
00081 inline
00082 Row<eT>::Row(const std::string& text)
00083 : Mat<eT>(text)
00084 {
00085 arma_extra_debug_sigprint();
00086
00087 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00088 }
00089
00090
00091
00092 template<typename eT>
00093 inline
00094 const Row<eT>&
00095 Row<eT>::operator=(const std::string& text)
00096 {
00097 arma_extra_debug_sigprint();
00098
00099 Mat<eT>::operator=(text);
00100
00101 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00102
00103 return *this;
00104 }
00105
00106
00107
00108 template<typename eT>
00109 inline
00110 Row<eT>::Row(const Row<eT>& X)
00111 : Mat<eT>(X)
00112 {
00113 arma_extra_debug_sigprint();
00114 }
00115
00116
00117
00118 template<typename eT>
00119 inline
00120 const Row<eT>&
00121 Row<eT>::operator=(const Row<eT>& X)
00122 {
00123 arma_extra_debug_sigprint();
00124
00125 Mat<eT>::operator=(X);
00126 return *this;
00127 }
00128
00129
00130
00131 template<typename eT>
00132 inline
00133 Row<eT>::Row(const Mat<eT>& X)
00134 : Mat<eT>(X)
00135 {
00136 arma_extra_debug_sigprint();
00137
00138 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00139 }
00140
00141
00142
00143 template<typename eT>
00144 inline
00145 const Row<eT>&
00146 Row<eT>::operator=(const Mat<eT>& X)
00147 {
00148 arma_extra_debug_sigprint();
00149
00150 Mat<eT>::operator=(X);
00151 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00152 return *this;
00153 }
00154
00155
00156
00157 template<typename eT>
00158 inline
00159 const Row<eT>&
00160 Row<eT>::operator*=(const Mat<eT>& X)
00161 {
00162 arma_extra_debug_sigprint();
00163
00164 Mat<eT>::operator*=(X);
00165 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00166 return *this;
00167 }
00168
00169
00170
00171
00172 template<typename eT>
00173 inline
00174 Row<eT>::Row(eT* aux_mem, const u32 aux_n_rows, const u32 aux_n_cols, const bool copy_aux_mem)
00175 : Mat<eT>(aux_mem, aux_n_rows, aux_n_cols, copy_aux_mem)
00176 {
00177 arma_extra_debug_sigprint();
00178
00179 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00180 }
00181
00182
00183
00184
00185 template<typename eT>
00186 inline
00187 Row<eT>::Row(const eT* aux_mem, const u32 aux_n_rows, const u32 aux_n_cols)
00188 : Mat<eT>(aux_mem, aux_n_rows, aux_n_cols)
00189 {
00190 arma_extra_debug_sigprint();
00191
00192 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00193 }
00194
00195
00196
00197
00198 template<typename eT>
00199 inline
00200 Row<eT>::Row(eT* aux_mem, const u32 aux_length, const bool copy_aux_mem)
00201 : Mat<eT>(aux_mem, 1, aux_length, copy_aux_mem)
00202 {
00203 arma_extra_debug_sigprint();
00204
00205
00206
00207
00208
00209 }
00210
00211
00212
00213
00214 template<typename eT>
00215 inline
00216 Row<eT>::Row(const eT* aux_mem, const u32 aux_length)
00217 : Mat<eT>(aux_mem, 1, aux_length)
00218 {
00219 arma_extra_debug_sigprint();
00220
00221
00222
00223
00224
00225 }
00226
00227
00228
00229 template<typename eT>
00230 template<typename T1, typename T2>
00231 inline
00232 Row<eT>::Row
00233 (
00234 const Base<typename Row<eT>::pod_type, T1>& A,
00235 const Base<typename Row<eT>::pod_type, T2>& B
00236 )
00237 : Mat<eT>(A,B)
00238 {
00239 arma_extra_debug_sigprint();
00240
00241 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00242 }
00243
00244
00245
00246 template<typename eT>
00247 inline
00248 Row<eT>::Row(const subview<eT>& X)
00249 : Mat<eT>(X)
00250 {
00251 arma_extra_debug_sigprint();
00252
00253 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00254 }
00255
00256
00257
00258 template<typename eT>
00259 inline
00260 const Row<eT>&
00261 Row<eT>::operator=(const subview<eT>& X)
00262 {
00263 arma_extra_debug_sigprint();
00264
00265 Mat<eT>::operator=(X);
00266
00267 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00268
00269 return *this;
00270 }
00271
00272
00273
00274 template<typename eT>
00275 inline
00276 const Row<eT>&
00277 Row<eT>::operator*=(const subview<eT>& X)
00278 {
00279 arma_extra_debug_sigprint();
00280
00281 Mat<eT>::operator*=(X);
00282
00283 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00284
00285 return *this;
00286 }
00287
00288
00289
00290 template<typename eT>
00291 inline
00292 Row<eT>::Row(const subview_cube<eT>& X)
00293 : Mat<eT>(X)
00294 {
00295 arma_extra_debug_sigprint();
00296
00297 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00298 }
00299
00300
00301
00302 template<typename eT>
00303 inline
00304 const Row<eT>&
00305 Row<eT>::operator=(const subview_cube<eT>& X)
00306 {
00307 arma_extra_debug_sigprint();
00308
00309 Mat<eT>::operator=(X);
00310
00311 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00312
00313 return *this;
00314 }
00315
00316
00317
00318 template<typename eT>
00319 inline
00320 const Row<eT>&
00321 Row<eT>::operator*=(const subview_cube<eT>& X)
00322 {
00323 arma_extra_debug_sigprint();
00324
00325 Mat<eT>::operator*=(X);
00326
00327 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00328
00329 return *this;
00330 }
00331
00332
00333
00334
00335 template<typename eT>
00336 inline
00337 Row<eT>::Row(const diagview<eT>& X)
00338 : Mat<eT>(X)
00339 {
00340 arma_extra_debug_sigprint();
00341
00342 std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00343
00344 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00345 }
00346
00347
00348
00349
00350 template<typename eT>
00351 inline
00352 const Row<eT>&
00353 Row<eT>::operator=(const diagview<eT>& X)
00354 {
00355 arma_extra_debug_sigprint();
00356
00357 Mat<eT>::operator=(X);
00358
00359
00360 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00361
00362 return *this;
00363 }
00364
00365
00366
00367 template<typename eT>
00368 inline
00369 const Row<eT>&
00370 Row<eT>::operator*=(const diagview<eT>& X)
00371 {
00372 arma_extra_debug_sigprint();
00373
00374 Mat<eT>::operator*=(X);
00375
00376 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00377
00378 return *this;
00379 }
00380
00381
00382
00383 template<typename eT>
00384 arma_inline
00385 eT&
00386 Row<eT>::col(const u32 col_num)
00387 {
00388 arma_debug_check( (col_num >= Mat<eT>::n_cols), "Row::col(): out of bounds" );
00389
00390 return access::rw(Mat<eT>::mem[col_num]);
00391 }
00392
00393
00394
00395 template<typename eT>
00396 arma_inline
00397 eT
00398 Row<eT>::col(const u32 col_num)
00399 const
00400 {
00401 arma_debug_check( (col_num >= Mat<eT>::n_cols), "Row::col(): out of bounds" );
00402
00403 return Mat<eT>::mem[col_num];
00404 }
00405
00406
00407
00408 template<typename eT>
00409 arma_inline
00410 subview_row<eT>
00411 Row<eT>::cols(const u32 in_col1, const u32 in_col2)
00412 {
00413 arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) ), "Row::cols(): indices out of bounds or incorrectly used");
00414
00415 return subview_row<eT>(*this, 0, in_col1, in_col2);
00416 }
00417
00418
00419
00420 template<typename eT>
00421 arma_inline
00422 const subview_row<eT>
00423 Row<eT>::cols(const u32 in_col1, const u32 in_col2)
00424 const
00425 {
00426 arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) ), "Row::cols(): indices out of bounds or incorrectly used");
00427
00428 return subview_row<eT>(*this, 0, in_col1, in_col2);
00429 }
00430
00431
00432
00433 template<typename eT>
00434 template<typename T1, typename op_type>
00435 inline
00436 Row<eT>::Row(const Op<T1, op_type>& X)
00437 : Mat<eT>(X)
00438 {
00439 arma_extra_debug_sigprint();
00440
00441 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00442 }
00443
00444
00445
00446 template<typename eT>
00447 template<typename T1, typename op_type>
00448 inline
00449 const Row<eT>&
00450 Row<eT>::operator=(const Op<T1, op_type>& X)
00451 {
00452 arma_extra_debug_sigprint();
00453
00454 Mat<eT>::operator=(X);
00455
00456 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00457
00458 return *this;
00459 }
00460
00461
00462
00463 template<typename eT>
00464 template<typename T1, typename op_type>
00465 inline
00466 const Row<eT>&
00467 Row<eT>::operator*=(const Op<T1, op_type>& X)
00468 {
00469 arma_extra_debug_sigprint();
00470
00471 Mat<eT>::operator*=(X);
00472
00473 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00474
00475 return *this;
00476 }
00477
00478
00479
00480 template<typename eT>
00481 template<typename T1, typename eop_type>
00482 inline
00483 Row<eT>::Row(const eOp<T1, eop_type>& X)
00484 : Mat<eT>(X)
00485 {
00486 arma_extra_debug_sigprint();
00487
00488 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00489 }
00490
00491
00492
00493 template<typename eT>
00494 template<typename T1, typename eop_type>
00495 inline
00496 const Row<eT>&
00497 Row<eT>::operator=(const eOp<T1, eop_type>& X)
00498 {
00499 arma_extra_debug_sigprint();
00500
00501 Mat<eT>::operator=(X);
00502
00503 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00504
00505 return *this;
00506 }
00507
00508
00509
00510 template<typename eT>
00511 template<typename T1, typename eop_type>
00512 inline
00513 const Row<eT>&
00514 Row<eT>::operator*=(const eOp<T1, eop_type>& X)
00515 {
00516 arma_extra_debug_sigprint();
00517
00518 Mat<eT>::operator*=(X);
00519
00520 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00521
00522 return *this;
00523 }
00524
00525
00526
00527 template<typename eT>
00528 template<typename T1, typename T2, typename glue_type>
00529 inline
00530 Row<eT>::Row(const Glue<T1, T2, glue_type>& X)
00531 : Mat<eT>(X)
00532 {
00533 arma_extra_debug_sigprint();
00534
00535 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00536 }
00537
00538
00539
00540 template<typename eT>
00541 template<typename T1, typename T2, typename glue_type>
00542 inline
00543 const Row<eT>&
00544 Row<eT>::operator=(const Glue<T1, T2, glue_type>& X)
00545 {
00546 arma_extra_debug_sigprint();
00547
00548 Mat<eT>::operator=(X);
00549
00550 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00551
00552 return *this;
00553 }
00554
00555
00556
00557 template<typename eT>
00558 template<typename T1, typename T2, typename glue_type>
00559 inline
00560 const Row<eT>&
00561 Row<eT>::operator*=(const Glue<T1, T2, glue_type>& X)
00562 {
00563 arma_extra_debug_sigprint();
00564
00565 Mat<eT>::operator*=(X);
00566
00567 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00568
00569 return *this;
00570 }
00571
00572
00573
00574 template<typename eT>
00575 template<typename T1, typename T2, typename eglue_type>
00576 inline
00577 Row<eT>::Row(const eGlue<T1, T2, eglue_type>& X)
00578 : Mat<eT>(X)
00579 {
00580 arma_extra_debug_sigprint();
00581
00582 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00583 }
00584
00585
00586
00587 template<typename eT>
00588 template<typename T1, typename T2, typename eglue_type>
00589 inline
00590 const Row<eT>&
00591 Row<eT>::operator=(const eGlue<T1, T2, eglue_type>& X)
00592 {
00593 arma_extra_debug_sigprint();
00594
00595 Mat<eT>::operator=(X);
00596
00597 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00598
00599 return *this;
00600 }
00601
00602
00603
00604 template<typename eT>
00605 template<typename T1, typename T2, typename eglue_type>
00606 inline
00607 const Row<eT>&
00608 Row<eT>::operator*=(const eGlue<T1, T2, eglue_type>& X)
00609 {
00610 arma_extra_debug_sigprint();
00611
00612 Mat<eT>::operator*=(X);
00613
00614 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00615
00616 return *this;
00617 }
00618
00619
00620
00621 template<typename eT>
00622 inline
00623 void
00624 Row<eT>::set_size(const u32 in_n_elem)
00625 {
00626 arma_extra_debug_sigprint();
00627
00628 Mat<eT>::set_size(1,in_n_elem);
00629 }
00630
00631
00632
00633 template<typename eT>
00634 inline
00635 void
00636 Row<eT>::set_size(const u32 in_n_rows, const u32 in_n_cols)
00637 {
00638 arma_extra_debug_sigprint();
00639
00640
00641 Mat<eT>::set_size( (std::min)( u32(1), in_n_rows), in_n_cols );
00642
00643 arma_debug_check( (in_n_rows > 1), "Row::set_size(): incompatible dimensions" );
00644 }
00645
00646
00647
00648 template<typename eT>
00649 template<typename eT2>
00650 inline
00651 void
00652 Row<eT>::copy_size(const Mat<eT2>& x)
00653 {
00654 arma_extra_debug_sigprint();
00655
00656
00657 Mat<eT>::set_size( (std::min)( u32(1), x.n_rows), x.n_cols );
00658
00659 arma_debug_check( (x.n_rows > 1), "Row::copy_size(): incompatible dimensions" );
00660 }
00661
00662
00663
00664 template<typename eT>
00665 inline
00666 void
00667 Row<eT>::zeros()
00668 {
00669 arma_extra_debug_sigprint();
00670
00671 Mat<eT>::zeros();
00672 }
00673
00674
00675
00676 template<typename eT>
00677 inline
00678 void
00679 Row<eT>::zeros(const u32 in_n_elem)
00680 {
00681 arma_extra_debug_sigprint();
00682
00683 Mat<eT>::zeros(1, in_n_elem);
00684 }
00685
00686
00687
00688 template<typename eT>
00689 inline
00690 void
00691 Row<eT>::zeros(const u32 in_n_rows, const u32 in_n_cols)
00692 {
00693 arma_extra_debug_sigprint();
00694
00695
00696 Mat<eT>::zeros( (std::min)( u32(1), in_n_rows), in_n_cols );
00697
00698 arma_debug_check( (in_n_rows > 1), "Row<eT>::zeros(): incompatible dimensions" );
00699 }
00700
00701
00702
00703 template<typename eT>
00704 inline
00705 void
00706 Row<eT>::ones()
00707 {
00708 arma_extra_debug_sigprint();
00709
00710 Mat<eT>::ones();
00711 }
00712
00713
00714
00715 template<typename eT>
00716 inline
00717 void
00718 Row<eT>::ones(const u32 in_n_elem)
00719 {
00720 arma_extra_debug_sigprint();
00721
00722 Mat<eT>::ones(1, in_n_elem);
00723 }
00724
00725
00726
00727 template<typename eT>
00728 inline
00729 void
00730 Row<eT>::ones(const u32 in_n_rows, const u32 in_n_cols)
00731 {
00732 arma_extra_debug_sigprint();
00733
00734
00735 Mat<eT>::ones( (std::min)( u32(1), in_n_rows), in_n_cols );
00736
00737 arma_debug_check( (in_n_rows > 1), "Row<eT>::ones(): incompatible dimensions" );
00738 }
00739
00740
00741
00742 template<typename eT>
00743 inline
00744 void
00745 Row<eT>::load(const std::string name, const file_type type)
00746 {
00747 arma_extra_debug_sigprint();
00748
00749 Mat<eT>::load(name,type);
00750
00751 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00752 }
00753
00754
00755
00756 template<typename eT>
00757 inline
00758 void
00759 Row<eT>::load(std::istream& is, const file_type type)
00760 {
00761 arma_extra_debug_sigprint();
00762
00763 Mat<eT>::load(is, type);
00764
00765 arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00766 }
00767
00768
00769
00770