00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 template<typename T1>
00021 class unwrap
00022 {
00023 public:
00024 inline unwrap(const T1& A)
00025 {
00026 arma_type_check< is_arma_type<T1>::value == false >::apply();
00027 }
00028 };
00029
00030
00031
00032
00033 template<typename eT>
00034 class unwrap< Mat<eT> >
00035 {
00036 public:
00037
00038 inline unwrap(const Mat<eT>& A)
00039 : M(A)
00040 {
00041 arma_extra_debug_sigprint();
00042 }
00043
00044 const Mat<eT>& M;
00045
00046 };
00047
00048
00049
00050
00051 template<typename eT>
00052 class unwrap< Row<eT> >
00053 {
00054 public:
00055
00056 inline unwrap(const Row<eT>& A)
00057 : M(A)
00058 {
00059 arma_extra_debug_sigprint();
00060 }
00061
00062 const Row<eT>& M;
00063
00064 };
00065
00066
00067
00068
00069 template<typename eT>
00070 class unwrap< Col<eT> >
00071 {
00072 public:
00073
00074 inline unwrap(const Col<eT>& A)
00075 : M(A)
00076 {
00077 arma_extra_debug_sigprint();
00078 }
00079
00080 const Col<eT>& M;
00081
00082 };
00083
00084
00085
00086 template<typename T1, typename op_type>
00087 class unwrap< Op<T1, op_type> >
00088 {
00089 public:
00090
00091 inline unwrap(const Op<T1, op_type>& A)
00092 : M(A)
00093 {
00094 arma_extra_debug_sigprint();
00095 }
00096
00097 typedef typename T1::elem_type elem_type;
00098 const Mat<elem_type> M;
00099
00100 };
00101
00102
00103
00104 template<typename T1, typename T2, typename glue_type>
00105 class unwrap< Glue<T1, T2, glue_type> >
00106 {
00107 public:
00108
00109 inline unwrap(const Glue<T1, T2, glue_type>& A)
00110 : M(A)
00111 {
00112 arma_extra_debug_sigprint();
00113 }
00114
00115 typedef typename T1::elem_type elem_type;
00116 const Mat<elem_type> M;
00117
00118 };
00119
00120
00121
00122 template<typename eT>
00123 class unwrap< subview<eT> >
00124 {
00125 public:
00126
00127 inline unwrap(const subview<eT>& A)
00128 : M(A)
00129 {
00130 arma_extra_debug_sigprint();
00131 }
00132
00133 const Mat<eT> M;
00134
00135 };
00136
00137
00138
00139 template<typename eT>
00140 class unwrap< diagview<eT> >
00141 {
00142 public:
00143
00144 inline unwrap(const diagview<eT> & A)
00145 : M(A)
00146 {
00147 arma_extra_debug_sigprint();
00148 }
00149
00150 const Mat<eT> M;
00151
00152 };
00153
00154
00155
00156
00157
00158
00159
00160
00161 template<typename T1>
00162 class unwrap_to_elem_access
00163 {
00164 public:
00165 inline unwrap_to_elem_access(const T1& A)
00166 {
00167 arma_type_check< is_arma_type<T1>::value == false >::apply();
00168 }
00169 };
00170
00171
00172
00173
00174 template<typename eT>
00175 class unwrap_to_elem_access< Mat<eT> >
00176 {
00177 public:
00178
00179 inline unwrap_to_elem_access(const Mat<eT>& A)
00180 : M(A)
00181 {
00182 arma_extra_debug_sigprint();
00183 }
00184
00185 inline eT operator[](const u32 i) const { return M[i]; }
00186 inline eT operator()(const u32 i) const { return M(i); }
00187
00188 inline eT operator()(const u32 in_row, const u32 in_col) const { return M(in_row,in_col); }
00189 inline eT at(const u32 in_row, const u32 in_col) const { return M.at(in_row,in_col); }
00190
00191
00192 const Mat<eT>& M;
00193
00194 };
00195
00196
00197
00198
00199 template<typename eT>
00200 class unwrap_to_elem_access< Row<eT> >
00201 {
00202 public:
00203
00204 inline unwrap_to_elem_access(const Row<eT>& A)
00205 : M(A)
00206 {
00207 arma_extra_debug_sigprint();
00208 }
00209
00210 inline eT operator[](const u32 i) const { return M[i]; }
00211 inline eT operator()(const u32 i) const { return M(i); }
00212
00213 inline eT operator()(const u32 in_row, const u32 in_col) const { return M(in_row,in_col); }
00214 inline eT at(const u32 in_row, const u32 in_col) const { return M.at(in_row,in_col); }
00215
00216 const Row<eT>& M;
00217
00218 };
00219
00220
00221
00222
00223 template<typename eT>
00224 class unwrap_to_elem_access< Op< Row<eT>, op_trans> >
00225 {
00226 public:
00227
00228
00229
00230
00231 inline unwrap_to_elem_access(const Op<Row<eT>, op_trans>& A)
00232 : M(A.m)
00233 {
00234 arma_extra_debug_sigprint();
00235 }
00236
00237 inline eT operator[](const u32 i) const { return M[i]; }
00238 inline eT operator()(const u32 i) const { return M(i); }
00239
00240 inline eT operator()(const u32 in_row, const u32 in_col) const { return M(in_row,in_col); }
00241 inline eT at(const u32 in_row, const u32 in_col) const { return M.at(in_row,in_col); }
00242
00243 const Row<eT>& M;
00244
00245 };
00246
00247
00248
00249
00250 template<typename eT>
00251 class unwrap_to_elem_access< Col<eT> >
00252 {
00253 public:
00254
00255 inline unwrap_to_elem_access(const Col<eT>& A)
00256 : M(A)
00257 {
00258 arma_extra_debug_sigprint();
00259 }
00260
00261 inline eT operator[](const u32 i) const { return M[i]; }
00262 inline eT operator()(const u32 i) const { return M(i); }
00263
00264 inline eT operator()(const u32 in_row, const u32 in_col) const { return M(in_row,in_col); }
00265 inline eT at(const u32 in_row, const u32 in_col) const { return M.at(in_row,in_col); }
00266
00267 const Col<eT>& M;
00268
00269 };
00270
00271
00272
00273
00274 template<typename eT>
00275 class unwrap_to_elem_access< Op<Col<eT>, op_trans> >
00276 {
00277 public:
00278
00279 inline unwrap_to_elem_access(const Op<Col<eT>, op_trans>& A)
00280 : M(A.m)
00281 {
00282 arma_extra_debug_sigprint();
00283 }
00284
00285 inline eT operator[](const u32 i) const { return M[i]; }
00286 inline eT operator()(const u32 i) const { return M(i); }
00287
00288
00289 inline eT at(const u32 in_row, const u32 in_col) const { return M.at(in_col,in_row); }
00290 inline eT operator()(const u32 in_row, const u32 in_col) const { return M(in_col,in_row); }
00291
00292 const Col<eT>& M;
00293
00294 };
00295
00296
00297
00298 template<typename T1, typename op_type>
00299 class unwrap_to_elem_access< Op<T1, op_type> >
00300 {
00301 public:
00302 typedef typename T1::elem_type elem_type;
00303
00304 inline unwrap_to_elem_access(const Op<T1, op_type>& A)
00305 : M(A)
00306 {
00307 arma_extra_debug_sigprint();
00308 }
00309
00310 inline elem_type operator[](const u32 i) const { return M[i]; }
00311 inline elem_type operator()(const u32 i) const { return M(i); }
00312
00313 inline elem_type operator()(const u32 in_row, const u32 in_col) const { return M(in_row,in_col); }
00314 inline elem_type at(const u32 in_row, const u32 in_col) const { return M.at(in_row,in_col); }
00315
00316 const Mat<elem_type> M;
00317
00318 };
00319
00320
00321
00322 template<typename T1, typename T2, typename glue_type>
00323 class unwrap_to_elem_access< Glue<T1, T2, glue_type> >
00324 {
00325 public:
00326 typedef typename T1::elem_type elem_type;
00327
00328 inline unwrap_to_elem_access(const Glue<T1, T2, glue_type>& A)
00329 : M(A)
00330 {
00331 arma_extra_debug_sigprint();
00332 }
00333
00334 inline elem_type operator[](const u32 i) const { return M[i]; }
00335 inline elem_type operator()(const u32 i) const { return M(i); }
00336
00337 inline elem_type operator()(const u32 in_row, const u32 in_col) const { return M(in_row,in_col); }
00338 inline elem_type at(const u32 in_row, const u32 in_col) const { return M.at(in_row,in_col); }
00339
00340 const Mat<elem_type> M;
00341
00342 };
00343
00344
00345
00346 template<typename eT>
00347 class unwrap_to_elem_access< subview<eT> >
00348 {
00349 public:
00350
00351 inline unwrap_to_elem_access(const subview<eT>& A)
00352 : M(A)
00353 {
00354 arma_extra_debug_sigprint();
00355 }
00356
00357 inline eT operator[](const u32 i) const { return M[i]; }
00358 inline eT operator()(const u32 i) const { return M(i); }
00359
00360 inline eT operator()(const u32 in_row, const u32 in_col) const { return M(in_row,in_col); }
00361 inline eT at(const u32 in_row, const u32 in_col) const { return M.at(in_row,in_col); }
00362
00363 const subview<eT>& M;
00364
00365 };
00366
00367
00368
00369
00370
00371
00372 template<typename T1>
00373 class unwrap_check
00374 {
00375 private:
00376 template<typename eT> inline unwrap_check(const T1& A, const Mat<eT>& B);
00377 template<typename eT> inline unwrap_check(const T1& A, const Row<eT>& B);
00378 template<typename eT> inline unwrap_check(const T1& A, const Col<eT>& B);
00379 template<typename eT> inline unwrap_check(const T1& A, const subview<eT>& B);
00380 template<typename eT> inline unwrap_check(const T1& A, const diagview<eT>& B);
00381 };
00382
00383
00384
00385 template<typename eT>
00386 class unwrap_check< Mat<eT> >
00387 {
00388 public:
00389
00390 inline
00391 unwrap_check(const Mat<eT>& A, const Mat<eT>& B)
00392 : M_local( (&A == reinterpret_cast<const Mat<eT>*>(&B)) ? new Mat<eT>(A) : 0 )
00393 , M ( (&A == reinterpret_cast<const Mat<eT>*>(&B)) ? (*M_local) : A )
00394 {
00395 arma_extra_debug_sigprint();
00396 }
00397
00398
00399 inline
00400 unwrap_check(const Mat<eT>& A, const Row<eT>& B)
00401 : M_local( (&A == reinterpret_cast<const Mat<eT>*>(&B)) ? new Mat<eT>(A) : 0 )
00402 , M ( (&A == reinterpret_cast<const Mat<eT>*>(&B)) ? (*M_local) : A )
00403 {
00404 arma_extra_debug_sigprint();
00405 }
00406
00407
00408 inline
00409 unwrap_check(const Mat<eT>& A, const Col<eT>& B)
00410 : M_local( (&A == reinterpret_cast<const Mat<eT>*>(&B)) ? new Mat<eT>(A) : 0 )
00411 , M ( (&A == reinterpret_cast<const Mat<eT>*>(&B)) ? (*M_local) : A )
00412 {
00413 arma_extra_debug_sigprint();
00414 }
00415
00416
00417 inline
00418 unwrap_check(const Mat<eT>& A, const subview<eT>& B)
00419 : M_local( (&A == reinterpret_cast<const Mat<eT>*>(&B.m)) ? new Mat<eT>(A) : 0 )
00420 , M ( (&A == reinterpret_cast<const Mat<eT>*>(&B.m)) ? (*M_local) : A )
00421 {
00422 arma_extra_debug_sigprint();
00423 }
00424
00425
00426 inline
00427 unwrap_check(const Mat<eT>& A, const diagview<eT>& B)
00428 : M_local( (&A == reinterpret_cast<const Mat<eT>*>(&B.m)) ? new Mat<eT>(A) : 0 )
00429 , M ( (&A == reinterpret_cast<const Mat<eT>*>(&B.m)) ? (*M_local) : A )
00430 {
00431 arma_extra_debug_sigprint();
00432 }
00433
00434
00435 inline
00436 ~unwrap_check()
00437 {
00438 arma_extra_debug_sigprint();
00439
00440 if(M_local)
00441 {
00442 delete M_local;
00443 }
00444 }
00445
00446
00447
00448 const Mat<eT>* M_local;
00449 const Mat<eT>& M;
00450
00451 };
00452
00453
00454
00455
00456 template<typename eT>
00457 class unwrap_check< Row<eT> >
00458 {
00459 public:
00460
00461 inline
00462 unwrap_check(const Row<eT>& A, const Mat<eT>& B)
00463 : M_local( (&A == reinterpret_cast<const Row<eT>*>(&B)) ? new Row<eT>(A) : 0 )
00464 , M ( (&A == reinterpret_cast<const Row<eT>*>(&B)) ? (*M_local) : A )
00465 {
00466 arma_extra_debug_sigprint();
00467 }
00468
00469
00470 inline
00471 unwrap_check(const Row<eT>& A, const Row<eT>& B)
00472 : M_local( (&A == reinterpret_cast<const Row<eT>*>(&B)) ? new Row<eT>(A) : 0 )
00473 , M ( (&A == reinterpret_cast<const Row<eT>*>(&B)) ? (*M_local) : A )
00474 {
00475 arma_extra_debug_sigprint();
00476 }
00477
00478 inline
00479 unwrap_check(const Row<eT>& A, const Col<eT>& B)
00480 : M_local( (&A == reinterpret_cast<const Row<eT>*>(&B)) ? new Row<eT>(A) : 0 )
00481 , M ( (&A == reinterpret_cast<const Row<eT>*>(&B)) ? (*M_local) : A )
00482 {
00483 arma_extra_debug_sigprint();
00484 }
00485
00486
00487 inline
00488 unwrap_check(const Row<eT>& A, const subview<eT>& B)
00489 : M_local( (&A == reinterpret_cast<const Row<eT>*>(&B.m)) ? new Row<eT>(A) : 0 )
00490 , M ( (&A == reinterpret_cast<const Row<eT>*>(&B.m)) ? (*M_local) : A )
00491 {
00492 arma_extra_debug_sigprint();
00493 }
00494
00495
00496 inline
00497 unwrap_check(const Row<eT>& A, const diagview<eT>& B)
00498 : M_local( (&A == reinterpret_cast<const Row<eT>*>(&B.m)) ? new Row<eT>(A) : 0 )
00499 , M ( (&A == reinterpret_cast<const Row<eT>*>(&B.m)) ? (*M_local) : A )
00500 {
00501 arma_extra_debug_sigprint();
00502 }
00503
00504
00505 inline
00506 ~unwrap_check()
00507 {
00508 arma_extra_debug_sigprint();
00509
00510 if(M_local)
00511 delete M_local;
00512 }
00513
00514
00515
00516 const Row<eT>* M_local;
00517 const Row<eT>& M;
00518
00519 };
00520
00521
00522
00523
00524
00525 template<typename eT>
00526 class unwrap_check< Col<eT> >
00527 {
00528 public:
00529
00530 inline
00531 unwrap_check(const Col<eT>& A, const Mat<eT>& B)
00532 : M_local( (&A == reinterpret_cast<const Col<eT>*>(&B)) ? new Col<eT>(A) : 0 )
00533 , M ( (&A == reinterpret_cast<const Col<eT>*>(&B)) ? (*M_local) : A )
00534 {
00535 arma_extra_debug_sigprint();
00536 }
00537
00538
00539 inline
00540 unwrap_check(const Col<eT>& A, const Row<eT>& B)
00541 : M_local( (&A == reinterpret_cast<const Col<eT>*>(&B)) ? new Col<eT>(A) : 0 )
00542 , M ( (&A == reinterpret_cast<const Col<eT>*>(&B)) ? (*M_local) : A )
00543 {
00544 arma_extra_debug_sigprint();
00545 }
00546
00547
00548 inline
00549 unwrap_check(const Col<eT>& A, const Col<eT>& B)
00550 : M_local( (&A == reinterpret_cast<const Col<eT>*>(&B)) ? new Col<eT>(A) : 0 )
00551 , M ( (&A == reinterpret_cast<const Col<eT>*>(&B)) ? (*M_local) : A )
00552 {
00553 arma_extra_debug_sigprint();
00554 }
00555
00556
00557 inline
00558 unwrap_check(const Col<eT>& A, const subview<eT>& B)
00559 : M_local( (&A == reinterpret_cast<const Col<eT>*>(&B.m)) ? new Col<eT>(A) : 0 )
00560 , M ( (&A == reinterpret_cast<const Col<eT>*>(&B.m)) ? (*M_local) : A )
00561 {
00562 arma_extra_debug_sigprint();
00563 }
00564
00565
00566 inline
00567 unwrap_check(const Col<eT>& A, const diagview<eT>& B)
00568 : M_local( (&A == reinterpret_cast<const Col<eT>*>(&B.m)) ? new Col<eT>(A) : 0 )
00569 , M ( (&A == reinterpret_cast<const Col<eT>*>(&B.m)) ? (*M_local) : A )
00570 {
00571 arma_extra_debug_sigprint();
00572 }
00573
00574
00575 inline
00576 ~unwrap_check()
00577 {
00578 arma_extra_debug_sigprint();
00579
00580 if(M_local)
00581 delete M_local;
00582 }
00583
00584
00585
00586 const Col<eT>* M_local;
00587 const Col<eT>& M;
00588
00589 };
00590
00591
00592
00593 template<typename T1, typename op_type>
00594 class unwrap_check< Op<T1, op_type> >
00595 {
00596 public:
00597 typedef typename T1::elem_type elem_type;
00598
00599
00600 inline
00601 unwrap_check(const Op<T1,op_type>& A, const Mat<elem_type>& B)
00602 : M(A)
00603 {
00604 arma_extra_debug_sigprint();
00605 }
00606
00607
00608
00609 inline
00610 unwrap_check(const Op<T1,op_type>& A, const Row<elem_type>& B)
00611 : M(A)
00612 {
00613 arma_extra_debug_sigprint();
00614 }
00615
00616
00617 inline
00618 unwrap_check(const Op<T1,op_type>& A, const Col<elem_type>& B)
00619 : M(A)
00620 {
00621 arma_extra_debug_sigprint();
00622 }
00623
00624
00625 inline
00626 ~unwrap_check()
00627 {
00628 arma_extra_debug_sigprint();
00629
00630 }
00631
00632 const Mat<elem_type> M;
00633
00634 };
00635
00636
00637
00638 template<typename T1, typename T2, typename glue_type>
00639 class unwrap_check< Glue<T1, T2, glue_type> >
00640 {
00641 public:
00642 typedef typename T1::elem_type elem_type;
00643
00644 inline
00645 unwrap_check(const Glue<T1, T2, glue_type>& A, const Mat<elem_type>& B)
00646 : M(A)
00647 {
00648 arma_extra_debug_sigprint();
00649 }
00650
00651
00652 inline
00653 unwrap_check(const Glue<T1, T2, glue_type>& A, const Row<elem_type>& B)
00654 : M(A)
00655 {
00656 arma_extra_debug_sigprint();
00657 }
00658
00659
00660 inline
00661 unwrap_check(const Glue<T1, T2, glue_type>& A, const Col<elem_type>& B)
00662 : M(A)
00663 {
00664 arma_extra_debug_sigprint();
00665 }
00666
00667
00668 inline
00669 ~unwrap_check()
00670 {
00671 arma_extra_debug_sigprint();
00672
00673 }
00674
00675
00676 const Mat<elem_type> M;
00677
00678 };
00679
00680
00681
00682
00683
00684 template<typename eT>
00685 class unwrap_check< subview<eT> >
00686 {
00687 public:
00688
00689 template<typename T2>
00690 inline unwrap_check(const subview<eT>& A, const T2& junk)
00691 : M(A)
00692 {
00693 arma_extra_debug_sigprint();
00694 }
00695
00696 const Mat<eT> M;
00697
00698 };
00699
00700
00701
00702 template<typename eT>
00703 class unwrap_check< diagview<eT> >
00704 {
00705 public:
00706
00707 template<typename T2>
00708 inline unwrap_check(const diagview<eT> & A, const T2& junk)
00709 : M(A)
00710 {
00711 arma_extra_debug_sigprint();
00712 }
00713
00714 const Mat<eT> M;
00715
00716 };
00717
00718
00719
00720
00721
00722
00723
00724 template<typename T1>
00725 class unwrap_write
00726 {
00727 private:
00728 template<typename eT> inline unwrap_write(Mat<eT>& out, const T1& in);
00729 template<typename eT> inline unwrap_write(Row<eT>& out, const T1& in);
00730 template<typename eT> inline unwrap_write(Col<eT>& out, const T1& in);
00731 template<typename eT> inline unwrap_write(subview<eT>& out, const T1& in);
00732 template<typename eT> inline unwrap_write(diagview<eT>& out, const T1& in);
00733 };
00734
00735
00736
00737 template<typename eT>
00738 class unwrap_write< Mat<eT> >
00739 {
00740 public:
00741
00742 inline
00743 unwrap_write(Mat<eT>& out, const Mat<eT>& A)
00744 : M(A)
00745 {
00746 arma_extra_debug_sigprint();
00747 out.copy_size(A);
00748 }
00749
00750
00751 inline
00752 unwrap_write(Row<eT>& out, const Mat<eT>& A)
00753 : M(A)
00754 {
00755 arma_extra_debug_sigprint();
00756 out.copy_size(A);
00757 }
00758
00759
00760 inline
00761 unwrap_write(Col<eT>& out, const Mat<eT>& A)
00762 : M(A)
00763 {
00764 arma_extra_debug_sigprint();
00765 out.copy_size(A);
00766 }
00767
00768
00769 inline
00770 ~unwrap_write()
00771 {
00772 arma_extra_debug_sigprint();
00773 }
00774
00775
00776 const Mat<eT>& M;
00777 };
00778
00779
00780
00781
00782 template<typename eT>
00783 class unwrap_write< Row<eT> >
00784 {
00785 public:
00786
00787 inline
00788 unwrap_write(Mat<eT>& out, const Row<eT>& A)
00789 : M(A)
00790 {
00791 arma_extra_debug_sigprint();
00792 out.copy_size(A);
00793 }
00794
00795
00796 inline
00797 unwrap_write(Row<eT>& out, const Row<eT>& A)
00798 : M(A)
00799 {
00800 arma_extra_debug_sigprint();
00801 out.copy_size(A);
00802 }
00803
00804 inline
00805 unwrap_write(Col<eT>& out, const Row<eT>& A)
00806 : M(A)
00807 {
00808 arma_extra_debug_sigprint();
00809 out.copy_size(A);
00810 }
00811
00812
00813 inline
00814 ~unwrap_write()
00815 {
00816 }
00817
00818
00819 const Row<eT>& M;
00820 };
00821
00822
00823
00824
00825
00826 template<typename eT>
00827 class unwrap_write< Col<eT> >
00828 {
00829 public:
00830
00831 inline
00832 unwrap_write(Mat<eT>& out, const Col<eT>& A)
00833 : M(A)
00834 {
00835 arma_extra_debug_sigprint();
00836 out.copy_size(A);
00837 }
00838
00839
00840 inline
00841 unwrap_write(Row<eT>& out, const Col<eT>& A)
00842 : M(A)
00843 {
00844 arma_extra_debug_sigprint();
00845 out.copy_size(A);
00846 }
00847
00848
00849 inline
00850 unwrap_write(Col<eT>& out, const Col<eT>& A)
00851 : M(A)
00852 {
00853 arma_extra_debug_sigprint();
00854 out.copy_size(A);
00855 }
00856
00857
00858 inline
00859 ~unwrap_write()
00860 {
00861 }
00862
00863
00864 const Col<eT>& M;
00865 };
00866
00867
00868
00869 template<typename T1, typename op_type>
00870 class unwrap_write< Op<T1, op_type> >
00871 {
00872 public:
00873 typedef typename T1::elem_type eT;
00874
00875
00876 inline
00877 unwrap_write(Mat<eT>& out, const Op<T1,op_type>& A)
00878 : M(out)
00879 {
00880 arma_extra_debug_sigprint();
00881 out = A;
00882 }
00883
00884
00885
00886 inline
00887 unwrap_write(Row<eT>& out, const Op<T1,op_type>& A)
00888 : M(out)
00889 {
00890 arma_extra_debug_sigprint();
00891 out = A;
00892 }
00893
00894
00895 inline
00896 unwrap_write(Col<eT>& out, const Op<T1,op_type>& A)
00897 : M(out)
00898 {
00899 arma_extra_debug_sigprint();
00900 out = A;
00901 }
00902
00903
00904 inline
00905 ~unwrap_write()
00906 {
00907 arma_extra_debug_sigprint();
00908 }
00909
00910 const Mat<eT>& M;
00911 };
00912
00913
00914
00915 template<typename T1, typename T2, typename glue_type>
00916 class unwrap_write< Glue<T1, T2, glue_type> >
00917 {
00918 public:
00919 typedef typename T1::elem_type eT;
00920
00921 inline
00922 unwrap_write(Mat<eT>& out, const Glue<T1, T2, glue_type>& A)
00923 : M(out)
00924 {
00925 arma_extra_debug_sigprint();
00926 out = A;
00927 }
00928
00929
00930 inline
00931 unwrap_write(Row<eT>& out, const Glue<T1, T2, glue_type>& A)
00932 : M(out)
00933 {
00934 arma_extra_debug_sigprint();
00935 out = A;
00936 }
00937
00938
00939 inline
00940 unwrap_write(Col<eT>& out, const Glue<T1, T2, glue_type>& A)
00941 : M(out)
00942 {
00943 arma_extra_debug_sigprint();
00944 out = A;
00945 }
00946
00947
00948 inline
00949 ~unwrap_write()
00950 {
00951 arma_extra_debug_sigprint();
00952 }
00953
00954
00955 const Mat<eT>& M;
00956 };
00957
00958
00959
00960
00961
00962 template<typename eT>
00963 class unwrap_write< subview<eT> >
00964 {
00965 public:
00966
00967 inline
00968 unwrap_write(Mat<eT>& out, const subview<eT>& A)
00969 : M(out)
00970 {
00971 arma_extra_debug_sigprint();
00972 out = A;
00973 }
00974
00975
00976 inline
00977 unwrap_write(Row<eT>& out, const subview<eT>& A)
00978 : M(out)
00979 {
00980 arma_extra_debug_sigprint();
00981 out = A;
00982 }
00983
00984
00985 inline
00986 unwrap_write(Col<eT>& out, const subview<eT>& A)
00987 : M(out)
00988 {
00989 arma_extra_debug_sigprint();
00990 out = A;
00991 }
00992
00993
00994 inline
00995 ~unwrap_write()
00996 {
00997 arma_extra_debug_sigprint();
00998 }
00999
01000
01001 const Mat<eT>& M;
01002 };
01003
01004
01005
01006 template<typename eT>
01007 class unwrap_write< diagview<eT> >
01008 {
01009 public:
01010
01011 inline
01012 unwrap_write(Mat<eT>& out, const diagview<eT>& A)
01013 : M(out)
01014 {
01015 arma_extra_debug_sigprint();
01016 out = A;
01017 }
01018
01019
01020 inline
01021 unwrap_write(Row<eT>& out, const diagview<eT>& A)
01022 : M(out)
01023 {
01024 arma_extra_debug_sigprint();
01025 out = A;
01026 }
01027
01028
01029 inline
01030 unwrap_write(Col<eT>& out, const diagview<eT>& A)
01031 : M(out)
01032 {
01033 arma_extra_debug_sigprint();
01034 out = A;
01035 }
01036
01037
01038 inline
01039 ~unwrap_write()
01040 {
01041 arma_extra_debug_sigprint();
01042 }
01043
01044
01045 const Mat<eT>& M;
01046 };
01047
01048
01049
01050