Col_meat.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2010 NICTA and the authors listed below
00002 // http://nicta.com.au
00003 // 
00004 // Authors:
00005 // - Conrad Sanderson (conradsand at ieee dot org)
00006 // 
00007 // This file is part of the Armadillo C++ library.
00008 // It is provided without any warranty of fitness
00009 // for any purpose. You can redistribute this file
00010 // and/or modify it under the terms of the GNU
00011 // Lesser General Public License (LGPL) as published
00012 // by the Free Software Foundation, either version 3
00013 // of the License or (at your option) any later version.
00014 // (see http://www.opensource.org/licenses for more info)
00015 
00016 
00017 //! \addtogroup Col
00018 //! @{
00019 
00020 
00021 //! construct an empty column vector
00022 template<typename eT>
00023 inline
00024 Col<eT>::Col()
00025   : Mat<eT>()
00026   {
00027   arma_extra_debug_sigprint();
00028   }
00029 
00030 
00031 
00032 //! construct a column vector with the specified number of n_elem
00033 template<typename eT>
00034 inline
00035 Col<eT>::Col(const u32 in_n_elem)
00036   : Mat<eT>(in_n_elem, 1)
00037   {
00038   arma_extra_debug_sigprint();
00039   }
00040 
00041 
00042 
00043 template<typename eT>
00044 inline
00045 Col<eT>::Col(const u32 in_n_rows, const u32 in_n_cols)
00046   : Mat<eT>(in_n_rows, in_n_cols)
00047   {
00048   arma_extra_debug_sigprint();
00049   
00050   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00051   }
00052 
00053 
00054 
00055 //! construct a column vector from specified text
00056 template<typename eT>
00057 inline
00058 Col<eT>::Col(const char* text)
00059   : Mat<eT>(text)
00060   {
00061   arma_extra_debug_sigprint();
00062   
00063   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00064   
00065   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00066   }
00067 
00068 
00069 
00070 //! construct a column vector from specified text
00071 template<typename eT>
00072 inline
00073 const Col<eT>&
00074 Col<eT>::operator=(const char* text)
00075   {
00076   arma_extra_debug_sigprint();
00077   
00078   Mat<eT>::operator=(text);
00079   
00080   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00081   
00082   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00083   
00084   return *this;
00085   }
00086 
00087 
00088 
00089 //! construct a column vector from specified text
00090 template<typename eT>
00091 inline
00092 Col<eT>::Col(const std::string& text)
00093   : Mat<eT>(text)
00094   {
00095   arma_extra_debug_sigprint();
00096   
00097   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00098   
00099   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00100   }
00101 
00102 
00103 
00104 //! construct a column vector from specified text
00105 template<typename eT>
00106 inline
00107 const Col<eT>&
00108 Col<eT>::operator=(const std::string& text)
00109   {
00110   arma_extra_debug_sigprint();
00111   
00112   Mat<eT>::operator=(text);
00113   
00114   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00115   
00116   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00117   
00118   return *this;
00119   }
00120 
00121 
00122 
00123 //! construct a column vector from a given column vector
00124 template<typename eT>
00125 inline
00126 Col<eT>::Col(const Col<eT>& X)
00127   : Mat<eT>(X)
00128   {
00129   arma_extra_debug_sigprint();
00130   }
00131 
00132 
00133 
00134 //! construct a column vector from a given column vector
00135 template<typename eT>
00136 inline
00137 const Col<eT>&
00138 Col<eT>::operator=(const Col<eT>& X)
00139   {
00140   arma_extra_debug_sigprint();
00141   
00142   Mat<eT>::operator=(X);
00143   
00144   return *this;
00145   }
00146 
00147 
00148 
00149 //! construct a column vector from a given matrix; the matrix must have exactly one column
00150 template<typename eT>
00151 inline
00152 Col<eT>::Col(const Mat<eT>& X)
00153   : Mat<eT>(X)
00154   {
00155   arma_extra_debug_sigprint();
00156   
00157   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00158   }
00159 
00160 
00161 
00162 //! construct a column vector from a given matrix; the matrix must have exactly one column
00163 template<typename eT>
00164 inline
00165 const Col<eT>&
00166 Col<eT>::operator=(const Mat<eT>& X)
00167   {
00168   arma_extra_debug_sigprint();
00169   
00170   Mat<eT>::operator=(X);
00171   
00172   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00173   
00174   return *this;
00175   }
00176 
00177 
00178 
00179 template<typename eT>
00180 inline
00181 const Col<eT>&
00182 Col<eT>::operator*=(const Mat<eT>& X)
00183   {
00184   arma_extra_debug_sigprint();
00185   
00186   Mat<eT>::operator*=(X);
00187   
00188   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00189   
00190   return *this;
00191   }
00192 
00193 
00194 
00195 //! construct a column vector from a given auxiliary array of eTs
00196 template<typename eT>
00197 inline
00198 Col<eT>::Col(eT* aux_mem, const u32 aux_n_rows, const u32 aux_n_cols, const bool copy_aux_mem)
00199   : Mat<eT>(aux_mem, aux_n_rows, aux_n_cols, copy_aux_mem)
00200   {
00201   arma_extra_debug_sigprint();
00202   
00203   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00204   }
00205 
00206 
00207 
00208 //! construct a column vector from a given auxiliary array of eTs
00209 template<typename eT>
00210 inline
00211 Col<eT>::Col(const eT* aux_mem, const u32 aux_n_rows, const u32 aux_n_cols)
00212   : Mat<eT>(aux_mem, aux_n_rows, aux_n_cols)
00213   {
00214   arma_extra_debug_sigprint();
00215   
00216   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00217   }
00218 
00219 
00220 
00221 //! construct a column vector from a given auxiliary array of eTs
00222 template<typename eT>
00223 inline
00224 Col<eT>::Col(eT* aux_mem, const u32 aux_length, const bool copy_aux_mem)
00225   : Mat<eT>(aux_mem, aux_length, 1, copy_aux_mem)
00226   {
00227   arma_extra_debug_sigprint();
00228   
00229 //   set_size(aux_length, 1);
00230 // 
00231 //   arma_check( (Mat<eT>::n_elem != aux_length), "Col::Col(): don't know how to handle the given array" );
00232 // 
00233 //   syslib::copy_elem( Mat<eT>::memptr(), aux_mem, Mat<eT>::n_elem );
00234   }
00235 
00236 
00237 
00238 //! construct a column vector from a given auxiliary array of eTs
00239 template<typename eT>
00240 inline
00241 Col<eT>::Col(const eT* aux_mem, const u32 aux_length)
00242   : Mat<eT>(aux_mem, aux_length, 1)
00243   {
00244   arma_extra_debug_sigprint();
00245   
00246 //   set_size(aux_length, 1);
00247 // 
00248 //   arma_check( (Mat<eT>::n_elem != aux_length), "Col::Col(): don't know how to handle the given array" );
00249 // 
00250 //   syslib::copy_elem( Mat<eT>::memptr(), aux_mem, Mat<eT>::n_elem );
00251   }
00252 
00253 
00254 
00255 template<typename eT>
00256 template<typename T1, typename T2>
00257 inline
00258 Col<eT>::Col
00259   (
00260   const Base<typename Col<eT>::pod_type, T1>& A,
00261   const Base<typename Col<eT>::pod_type, T2>& B
00262   )
00263   : Mat<eT>(A,B)
00264   {
00265   arma_extra_debug_sigprint();
00266   
00267   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00268   }
00269 
00270 
00271 
00272 //! construct a column vector from given a submatrix; the submatrix must have exactly one column
00273 template<typename eT>
00274 inline
00275 Col<eT>::Col(const subview<eT>& X)
00276   : Mat<eT>(X)
00277   {
00278   arma_extra_debug_sigprint();
00279   
00280   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00281   }
00282 
00283 
00284 
00285 //! construct a column vector from given a submatrix; the submatrix must have exactly one column
00286 template<typename eT>
00287 inline
00288 const Col<eT>&
00289 Col<eT>::operator=(const subview<eT>& X)
00290   {
00291   arma_extra_debug_sigprint();
00292   
00293   Mat<eT>::operator=(X);
00294   
00295   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00296   
00297   return *this;
00298   }
00299 
00300 
00301 
00302 template<typename eT>
00303 inline
00304 const Col<eT>&
00305 Col<eT>::operator*=(const subview<eT>& X)
00306   {
00307   arma_extra_debug_sigprint();
00308   
00309   Mat<eT>::operator*=(X);
00310   
00311   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00312   
00313   return *this;
00314   }
00315 
00316 
00317 
00318 //! construct a column vector from given a subcube; the subcube must have exactly one column
00319 template<typename eT>
00320 inline
00321 Col<eT>::Col(const subview_cube<eT>& X)
00322   : Mat<eT>(X)
00323   {
00324   arma_extra_debug_sigprint();
00325   
00326   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00327   }
00328 
00329 
00330 
00331 //! construct a column vector from given a subcube; the subcube must have exactly one column
00332 template<typename eT>
00333 inline
00334 const Col<eT>&
00335 Col<eT>::operator=(const subview_cube<eT>& X)
00336   {
00337   arma_extra_debug_sigprint();
00338   
00339   Mat<eT>::operator=(X);
00340   
00341   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00342   
00343   return *this;
00344   }
00345 
00346 
00347 
00348 template<typename eT>
00349 inline
00350 const Col<eT>&
00351 Col<eT>::operator*=(const subview_cube<eT>& X)
00352   {
00353   arma_extra_debug_sigprint();
00354   
00355   Mat<eT>::operator*=(X);
00356   
00357   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00358   
00359   return *this;
00360   }
00361 
00362 
00363 
00364 //! construct a column vector from given a diagview
00365 template<typename eT>
00366 inline
00367 Col<eT>::Col(const diagview<eT>& X)
00368   : Mat<eT>(X)
00369   {
00370   arma_extra_debug_sigprint();
00371   
00372   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00373   }
00374 
00375 
00376 
00377 //! construct a column vector from given a diagview
00378 template<typename eT>
00379 inline
00380 const Col<eT>&
00381 Col<eT>::operator=(const diagview<eT>& X)
00382   {
00383   arma_extra_debug_sigprint();
00384   
00385   Mat<eT>::operator=(X);
00386   
00387   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00388   
00389   return *this;
00390   }
00391 
00392 
00393 
00394 template<typename eT>
00395 inline
00396 const Col<eT>&
00397 Col<eT>::operator*=(const diagview<eT>& X)
00398   {
00399   arma_extra_debug_sigprint();
00400   
00401   Mat<eT>::operator*=(X);
00402   
00403   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00404   
00405   return *this;
00406   }
00407 
00408 
00409 
00410 template<typename eT>
00411 arma_inline
00412 eT&
00413 Col<eT>::row(const u32 row_num)
00414   {
00415   arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::row(): out of bounds" );
00416   
00417   return access::rw(Mat<eT>::mem[row_num]);
00418   }
00419 
00420 
00421 
00422 template<typename eT>
00423 arma_inline
00424 eT
00425 Col<eT>::row(const u32 row_num)
00426   const
00427   {
00428   arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::row(): out of bounds" );
00429   
00430   return Mat<eT>::mem[row_num];
00431   }
00432 
00433 
00434 
00435 template<typename eT>
00436 arma_inline
00437 subview_col<eT>
00438 Col<eT>::rows(const u32 in_row1, const u32 in_row2)
00439   {
00440   arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Col::rows(): indices out of bounds or incorrectly used");
00441   
00442   return subview_col<eT>(*this, 0, in_row1, in_row2);
00443   }
00444 
00445 
00446 
00447 template<typename eT>
00448 arma_inline
00449 const subview_col<eT>
00450 Col<eT>::rows(const u32 in_row1, const u32 in_row2)
00451   const
00452   {
00453   arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Col::rows(): indices out of bounds or incorrectly used");
00454   
00455   return subview_col<eT>(*this, 0, in_row1, in_row2);
00456   }
00457 
00458 
00459 
00460 //! construct a column vector from Op, i.e. run the previously delayed operations; the result of the operations must have exactly one column
00461 template<typename eT>
00462 template<typename T1, typename op_type>
00463 inline
00464 Col<eT>::Col(const Op<T1, op_type>& X)
00465   : Mat<eT>(X)
00466   {
00467   arma_extra_debug_sigprint();
00468   
00469   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00470   }
00471 
00472 
00473 
00474 //! construct a column vector from Op, i.e. run the previously delayed operations; the result of the operations must have exactly one column
00475 template<typename eT>
00476 template<typename T1, typename op_type>
00477 inline
00478 const Col<eT>&
00479 Col<eT>::operator=(const Op<T1, op_type>& X)
00480   {
00481   arma_extra_debug_sigprint();
00482   
00483   Mat<eT>::operator=(X);
00484   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00485   return *this;
00486   }
00487 
00488 
00489 
00490 template<typename eT>
00491 template<typename T1, typename op_type>
00492 inline
00493 const Col<eT>&
00494 Col<eT>::operator*=(const Op<T1, op_type>& X)
00495   {
00496   arma_extra_debug_sigprint();
00497   
00498   Mat<eT>::operator*=(X);
00499   
00500   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00501   
00502   return *this;
00503   }
00504 
00505 
00506 
00507 template<typename eT>
00508 template<typename T1, typename eop_type>
00509 inline
00510 Col<eT>::Col(const eOp<T1, eop_type>& X)
00511   : Mat<eT>(X)
00512   {
00513   arma_extra_debug_sigprint();
00514   
00515   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00516   }
00517 
00518 
00519 
00520 template<typename eT>
00521 template<typename T1, typename eop_type>
00522 inline
00523 const Col<eT>&
00524 Col<eT>::operator=(const eOp<T1, eop_type>& X)
00525   {
00526   arma_extra_debug_sigprint();
00527   
00528   Mat<eT>::operator=(X);
00529   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00530   return *this;
00531   }
00532 
00533 
00534 
00535 template<typename eT>
00536 template<typename T1, typename eop_type>
00537 inline
00538 const Col<eT>&
00539 Col<eT>::operator*=(const eOp<T1, eop_type>& X)
00540   {
00541   arma_extra_debug_sigprint();
00542   
00543   Mat<eT>::operator*=(X);
00544   
00545   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00546   
00547   return *this;
00548   }
00549 
00550 
00551 
00552 template<typename eT>
00553 template<typename T1, typename op_type>
00554 inline
00555 Col<eT>::Col(const mtOp<eT, T1, op_type>& X)
00556   : Mat<eT>(X)
00557   {
00558   arma_extra_debug_sigprint();
00559   
00560   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00561   }
00562 
00563 
00564 
00565 template<typename eT>
00566 template<typename T1, typename op_type>
00567 inline
00568 const Col<eT>&
00569 Col<eT>::operator=(const mtOp<eT, T1, op_type>& X)
00570   {
00571   arma_extra_debug_sigprint();
00572   
00573   Mat<eT>::operator=(X);
00574   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00575   return *this;
00576   }
00577 
00578 
00579 
00580 template<typename eT>
00581 template<typename T1, typename op_type>
00582 inline
00583 const Col<eT>&
00584 Col<eT>::operator*=(const mtOp<eT, T1, op_type>& X)
00585   {
00586   arma_extra_debug_sigprint();
00587   
00588   Mat<eT>::operator*=(X);
00589   
00590   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00591   
00592   return *this;
00593   }
00594 
00595 
00596 
00597 //! construct a column vector from Glue, i.e. run the previously delayed operations; the result of the operations must have exactly one column
00598 template<typename eT>
00599 template<typename T1, typename T2, typename glue_type>
00600 inline
00601 Col<eT>::Col(const Glue<T1, T2, glue_type>& X)
00602   : Mat<eT>(X)
00603   {
00604   arma_extra_debug_sigprint();
00605   
00606   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00607   }
00608 
00609 
00610 
00611 //! construct a column vector from Glue, i.e. run the previously delayed operations; the result of the operations must have exactly one column
00612 template<typename eT>
00613 template<typename T1, typename T2, typename glue_type>
00614 inline
00615 const Col<eT>&
00616 Col<eT>::operator=(const Glue<T1, T2, glue_type>& X)
00617   {
00618   arma_extra_debug_sigprint();
00619   
00620   Mat<eT>::operator=(X);
00621   
00622   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00623   
00624   return *this;
00625   }
00626 
00627 
00628 
00629 template<typename eT>
00630 template<typename T1, typename T2, typename glue_type>
00631 inline
00632 const Col<eT>&
00633 Col<eT>::operator*=(const Glue<T1, T2, glue_type>& X)
00634   {
00635   arma_extra_debug_sigprint();
00636   
00637   Mat<eT>::operator*=(X);
00638   
00639   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00640   
00641   return *this;
00642   }
00643 
00644 
00645 
00646 template<typename eT>
00647 template<typename T1, typename T2, typename eglue_type>
00648 inline
00649 Col<eT>::Col(const eGlue<T1, T2, eglue_type>& X)
00650   : Mat<eT>(X)
00651   {
00652   arma_extra_debug_sigprint();
00653   
00654   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00655   }
00656 
00657 
00658 
00659 template<typename eT>
00660 template<typename T1, typename T2, typename eglue_type>
00661 inline
00662 const Col<eT>&
00663 Col<eT>::operator=(const eGlue<T1, T2, eglue_type>& X)
00664   {
00665   arma_extra_debug_sigprint();
00666   
00667   Mat<eT>::operator=(X);
00668   
00669   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00670   
00671   return *this;
00672   }
00673 
00674 
00675 
00676 template<typename eT>
00677 template<typename T1, typename T2, typename eglue_type>
00678 inline
00679 const Col<eT>&
00680 Col<eT>::operator*=(const eGlue<T1, T2, eglue_type>& X)
00681   {
00682   arma_extra_debug_sigprint();
00683   
00684   Mat<eT>::operator*=(X);
00685   
00686   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00687   
00688   return *this;
00689   }
00690 
00691 
00692 
00693 template<typename eT>
00694 template<typename T1, typename T2, typename glue_type>
00695 inline
00696 Col<eT>::Col(const mtGlue<eT, T1, T2, glue_type>& X)
00697   : Mat<eT>(X)
00698   {
00699   arma_extra_debug_sigprint();
00700   
00701   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00702   }
00703 
00704 
00705 
00706 template<typename eT>
00707 template<typename T1, typename T2, typename glue_type>
00708 inline
00709 const Col<eT>&
00710 Col<eT>::operator=(const mtGlue<eT, T1, T2, glue_type>& X)
00711   {
00712   arma_extra_debug_sigprint();
00713   
00714   Mat<eT>::operator=(X);
00715   
00716   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00717   
00718   return *this;
00719   }
00720 
00721 
00722 
00723 template<typename eT>
00724 template<typename T1, typename T2, typename glue_type>
00725 inline
00726 const Col<eT>&
00727 Col<eT>::operator*=(const mtGlue<eT, T1, T2, glue_type>& X)
00728   {
00729   arma_extra_debug_sigprint();
00730   
00731   Mat<eT>::operator*=(X);
00732   
00733   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00734   
00735   return *this;
00736   }
00737 
00738 
00739 
00740 //! change the number of rows
00741 template<typename eT>
00742 inline
00743 void
00744 Col<eT>::set_size(const u32 in_n_elem)
00745   {
00746   arma_extra_debug_sigprint();
00747   
00748   Mat<eT>::set_size(in_n_elem,1);
00749   }
00750 
00751 
00752 
00753 //! change the number of n_rows  (this function re-implements mat::set_size() in order to check the number of columns)
00754 template<typename eT>
00755 inline
00756 void
00757 Col<eT>::set_size(const u32 in_n_rows, const u32 in_n_cols)
00758   {
00759   arma_extra_debug_sigprint();
00760 
00761   // min() is used in case in_n_cols is zero
00762   Mat<eT>::set_size( in_n_rows, (std::min)( u32(1), in_n_cols ) );
00763   
00764   arma_debug_check( (in_n_cols > 1), "Col::set_size(): incompatible dimensions" );
00765   }
00766 
00767 
00768 
00769 //! change the number of n_rows  (this function re-implements mat::copy_size() in order to check the number of columns)
00770 template<typename eT>
00771 template<typename eT2>
00772 inline
00773 void
00774 Col<eT>::copy_size(const Mat<eT2>& x)
00775   {
00776   arma_extra_debug_sigprint();
00777   
00778   // min() is used in case x.n_cols is zero
00779   Mat<eT>::set_size( x.n_rows, (std::min)( u32(1), x.n_cols ) );
00780   
00781   arma_debug_check( (x.n_cols > 1), "Col::copy_size(): incompatible dimensions" );
00782   }
00783 
00784 
00785 
00786 template<typename eT>
00787 inline
00788 void
00789 Col<eT>::zeros()
00790   {
00791   arma_extra_debug_sigprint();
00792   
00793   Mat<eT>::zeros();
00794   }
00795 
00796 
00797 
00798 template<typename eT>
00799 inline
00800 void
00801 Col<eT>::zeros(const u32 in_n_elem)
00802   {
00803   arma_extra_debug_sigprint();
00804   
00805   Mat<eT>::zeros(in_n_elem, 1);
00806   }
00807 
00808 
00809 
00810 template<typename eT>
00811 inline
00812 void
00813 Col<eT>::zeros(const u32 in_n_rows, const u32 in_n_cols)
00814   {
00815   arma_extra_debug_sigprint();
00816   
00817   // min() is used in case in_n_cols is zero
00818   Mat<eT>::zeros( in_n_rows, (std::min)( u32(1), in_n_cols ) );
00819   
00820   arma_debug_check( (in_n_cols > 1), "Col::zeros(): incompatible dimensions" );
00821   }
00822 
00823 
00824 
00825 template<typename eT>
00826 inline
00827 void
00828 Col<eT>::ones()
00829   {
00830   arma_extra_debug_sigprint();
00831   
00832   Mat<eT>::ones();
00833   }
00834 
00835 
00836 
00837 template<typename eT>
00838 inline
00839 void
00840 Col<eT>::ones(const u32 in_n_elem)
00841   {
00842   arma_extra_debug_sigprint();
00843   
00844   Mat<eT>::ones(in_n_elem, 1);
00845   }
00846 
00847 
00848 
00849 template<typename eT>
00850 inline
00851 void
00852 Col<eT>::ones(const u32 in_n_rows, const u32 in_n_cols)
00853   {
00854   arma_extra_debug_sigprint();
00855   
00856   // min() is used in case in_n_cols is zero
00857   Mat<eT>::ones( in_n_rows, (std::min)( u32(1), in_n_cols ) );
00858   
00859   arma_debug_check( (in_n_cols > 1), "Col::ones(): incompatible dimensions" );
00860   }
00861 
00862 
00863 
00864 template<typename eT>
00865 inline
00866 void
00867 Col<eT>::load(const std::string name, const file_type type, const bool print_status)
00868   {
00869   arma_extra_debug_sigprint();
00870   
00871   Mat<eT>::load(name, type, print_status);
00872   
00873   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00874   }
00875 
00876 
00877 
00878 template<typename eT>
00879 inline
00880 void
00881 Col<eT>::load(std::istream& is, const file_type type, const bool print_status)
00882   {
00883   arma_extra_debug_sigprint();
00884   
00885   Mat<eT>::load(is, type, print_status);
00886   
00887   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00888   }
00889 
00890 
00891 
00892 template<typename eT>
00893 inline
00894 void
00895 Col<eT>::quiet_load(const std::string name, const file_type type)
00896   {
00897   arma_extra_debug_sigprint();
00898   
00899   Mat<eT>::quiet_load(name, type);
00900   
00901   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00902   }
00903 
00904 
00905 
00906 template<typename eT>
00907 inline
00908 void
00909 Col<eT>::quiet_load(std::istream& is, const file_type type)
00910   {
00911   arma_extra_debug_sigprint();
00912   
00913   Mat<eT>::quiet_load(is, type);
00914   
00915   arma_debug_check( (Mat<eT>::n_cols > 1), "Col(): incompatible dimensions" );
00916   }
00917 
00918 
00919 
00920 template<typename eT>
00921 inline
00922 typename Col<eT>::row_iterator
00923 Col<eT>::begin_row(const u32 row_num)
00924   {
00925   arma_extra_debug_sigprint();
00926   
00927   arma_debug_check( (row_num >= Mat<eT>::n_rows), "begin_row(): index out of bounds");
00928   
00929   return Mat<eT>::memptr() + row_num;
00930   }
00931 
00932 
00933 
00934 template<typename eT>
00935 inline
00936 typename Col<eT>::const_row_iterator
00937 Col<eT>::begin_row(const u32 row_num) const
00938   {
00939   arma_extra_debug_sigprint();
00940   
00941   arma_debug_check( (row_num >= Mat<eT>::n_rows), "begin_row(): index out of bounds");
00942   
00943   return Mat<eT>::memptr() + row_num;
00944   }
00945 
00946 
00947 
00948 template<typename eT>
00949 inline
00950 typename Col<eT>::row_iterator
00951 Col<eT>::end_row(const u32 row_num)
00952   {
00953   arma_extra_debug_sigprint();
00954   
00955   arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds");
00956   
00957   return Mat<eT>::memptr() + row_num + 1;
00958   }
00959 
00960 
00961 
00962 template<typename eT>
00963 inline
00964 typename Col<eT>::const_row_iterator
00965 Col<eT>::end_row(const u32 row_num) const
00966   {
00967   arma_extra_debug_sigprint();
00968   
00969   arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds");
00970   
00971   return Mat<eT>::memptr() + row_num + 1;
00972   }
00973 
00974 
00975 
00976 //! @}