Row_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 Row
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 //! construct a row vector from a given auxiliary array
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 //! construct a row vector from a given auxiliary array
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 //! construct a row vector from a given auxiliary array
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 //   Mat<eT>::set_size(1, aux_length);
00206 //   arma_check( (Mat<eT>::n_elem != aux_length), "Row(): don't know how to handle the given array" );
00207 // 
00208 //   syslib::copy_elem( Mat<eT>::memptr(), aux_mem, Mat<eT>::n_elem );
00209   }
00210 
00211 
00212 
00213 //! construct a row vector from a given auxiliary array
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 //   Mat<eT>::set_size(1, aux_length);
00222 //   arma_check( (Mat<eT>::n_elem != aux_length), "Row(): don't know how to handle the given array" );
00223 // 
00224 //   syslib::copy_elem( Mat<eT>::memptr(), aux_mem, Mat<eT>::n_elem );
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 //! construct a row vector from given a diagview
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 //! construct a row vector from given a diagview
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   //std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
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 op_type>
00529 inline
00530 Row<eT>::Row(const mtOp<eT, T1, op_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 op_type>
00542 inline
00543 const Row<eT>&
00544 Row<eT>::operator=(const mtOp<eT, T1, op_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 op_type>
00559 inline
00560 const Row<eT>&
00561 Row<eT>::operator*=(const mtOp<eT, T1, op_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 glue_type>
00576 inline
00577 Row<eT>::Row(const Glue<T1, T2, glue_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 glue_type>
00589 inline
00590 const Row<eT>&
00591 Row<eT>::operator=(const Glue<T1, T2, glue_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 glue_type>
00606 inline
00607 const Row<eT>&
00608 Row<eT>::operator*=(const Glue<T1, T2, glue_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 template<typename T1, typename T2, typename eglue_type>
00623 inline
00624 Row<eT>::Row(const eGlue<T1, T2, eglue_type>& X)
00625   : Mat<eT>(X)
00626   {
00627   arma_extra_debug_sigprint();
00628   
00629   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00630   }
00631 
00632 
00633 
00634 template<typename eT>
00635 template<typename T1, typename T2, typename eglue_type>
00636 inline
00637 const Row<eT>&
00638 Row<eT>::operator=(const eGlue<T1, T2, eglue_type>& X)
00639   {
00640   arma_extra_debug_sigprint();
00641   
00642   Mat<eT>::operator=(X);
00643   
00644   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00645   
00646   return *this;
00647   }
00648 
00649 
00650 
00651 template<typename eT>
00652 template<typename T1, typename T2, typename eglue_type>
00653 inline
00654 const Row<eT>&
00655 Row<eT>::operator*=(const eGlue<T1, T2, eglue_type>& X)
00656   {
00657   arma_extra_debug_sigprint();
00658   
00659   Mat<eT>::operator*=(X);
00660   
00661   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00662   
00663   return *this;
00664   }
00665 
00666 
00667 
00668 template<typename eT>
00669 template<typename T1, typename T2, typename glue_type>
00670 inline
00671 Row<eT>::Row(const mtGlue<eT, T1, T2, glue_type>& X)
00672   : Mat<eT>(X)
00673   {
00674   arma_extra_debug_sigprint();
00675   
00676   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00677   }
00678 
00679 
00680 
00681 template<typename eT>
00682 template<typename T1, typename T2, typename glue_type>
00683 inline
00684 const Row<eT>&
00685 Row<eT>::operator=(const mtGlue<eT, T1, T2, glue_type>& X)
00686   {
00687   arma_extra_debug_sigprint();
00688   
00689   Mat<eT>::operator=(X);
00690   
00691   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00692   
00693   return *this;
00694   }
00695 
00696 
00697 
00698 template<typename eT>
00699 template<typename T1, typename T2, typename glue_type>
00700 inline
00701 const Row<eT>&
00702 Row<eT>::operator*=(const mtGlue<eT, T1, T2, glue_type>& X)
00703   {
00704   arma_extra_debug_sigprint();
00705   
00706   Mat<eT>::operator*=(X);
00707   
00708   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00709   
00710   return *this;
00711   }
00712 
00713 
00714 
00715 template<typename eT>
00716 inline
00717 void
00718 Row<eT>::set_size(const u32 in_n_elem)
00719   {
00720   arma_extra_debug_sigprint();
00721   
00722   Mat<eT>::set_size(1,in_n_elem);
00723   }
00724 
00725 
00726 
00727 template<typename eT>
00728 inline
00729 void
00730 Row<eT>::set_size(const u32 in_n_rows, const u32 in_n_cols)
00731   {
00732   arma_extra_debug_sigprint();
00733   
00734   // min is used in case in_n_rows is zero
00735   Mat<eT>::set_size( (std::min)( u32(1), in_n_rows), in_n_cols );
00736   
00737   arma_debug_check( (in_n_rows > 1), "Row::set_size(): incompatible dimensions" );
00738   }
00739 
00740 
00741 
00742 template<typename eT>
00743 template<typename eT2>
00744 inline
00745 void
00746 Row<eT>::copy_size(const Mat<eT2>& x)
00747   {
00748   arma_extra_debug_sigprint();
00749   
00750   // min is used in case x.n_rows is zero
00751   Mat<eT>::set_size( (std::min)( u32(1), x.n_rows), x.n_cols );
00752   
00753   arma_debug_check( (x.n_rows > 1), "Row::copy_size(): incompatible dimensions" );
00754   }
00755 
00756 
00757 
00758 template<typename eT>
00759 inline
00760 void
00761 Row<eT>::zeros()
00762   {
00763   arma_extra_debug_sigprint();
00764   
00765   Mat<eT>::zeros();
00766   }
00767 
00768 
00769 
00770 template<typename eT>
00771 inline
00772 void
00773 Row<eT>::zeros(const u32 in_n_elem)
00774   {
00775   arma_extra_debug_sigprint();
00776   
00777   Mat<eT>::zeros(1, in_n_elem);
00778   }
00779 
00780 
00781 
00782 template<typename eT>
00783 inline
00784 void
00785 Row<eT>::zeros(const u32 in_n_rows, const u32 in_n_cols)
00786   {
00787   arma_extra_debug_sigprint();
00788   
00789   // min is used in case in_n_rows is zero
00790   Mat<eT>::zeros( (std::min)( u32(1), in_n_rows), in_n_cols );
00791   
00792   arma_debug_check( (in_n_rows > 1), "Row<eT>::zeros(): incompatible dimensions" );
00793   }
00794 
00795 
00796 
00797 template<typename eT>
00798 inline
00799 void
00800 Row<eT>::ones()
00801   {
00802   arma_extra_debug_sigprint();
00803   
00804   Mat<eT>::ones();
00805   }
00806 
00807 
00808 
00809 template<typename eT>
00810 inline
00811 void
00812 Row<eT>::ones(const u32 in_n_elem)
00813   {
00814   arma_extra_debug_sigprint();
00815   
00816   Mat<eT>::ones(1, in_n_elem);
00817   }
00818 
00819 
00820 
00821 template<typename eT>
00822 inline
00823 void
00824 Row<eT>::ones(const u32 in_n_rows, const u32 in_n_cols)
00825   {
00826   arma_extra_debug_sigprint();
00827   
00828   // min is used in case in_n_rows is zero
00829   Mat<eT>::ones( (std::min)( u32(1), in_n_rows), in_n_cols );
00830   
00831   arma_debug_check( (in_n_rows > 1), "Row<eT>::ones(): incompatible dimensions" );
00832   }
00833 
00834 
00835 
00836 template<typename eT>
00837 inline
00838 void
00839 Row<eT>::load(const std::string name, const file_type type, const bool print_status)
00840   {
00841   arma_extra_debug_sigprint();
00842   
00843   Mat<eT>::load(name, type, print_status);
00844   
00845   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00846   }
00847 
00848 
00849 
00850 template<typename eT>
00851 inline
00852 void
00853 Row<eT>::load(std::istream& is, const file_type type, const bool print_status)
00854   {
00855   arma_extra_debug_sigprint();
00856   
00857   Mat<eT>::load(is, type, print_status);
00858   
00859   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00860   }
00861 
00862 
00863 
00864 template<typename eT>
00865 inline
00866 void
00867 Row<eT>::quiet_load(const std::string name, const file_type type)
00868   {
00869   arma_extra_debug_sigprint();
00870   
00871   Mat<eT>::quiet_load(name, type);
00872   
00873   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00874   }
00875 
00876 
00877 
00878 template<typename eT>
00879 inline
00880 void
00881 Row<eT>::quiet_load(std::istream& is, const file_type type)
00882   {
00883   arma_extra_debug_sigprint();
00884   
00885   Mat<eT>::quiet_load(is, type);
00886   
00887   arma_debug_check( (Mat<eT>::n_rows > 1), "Row(): incompatible dimensions" );
00888   }
00889 
00890 
00891 
00892 template<typename eT>
00893 inline
00894 typename Row<eT>::row_iterator
00895 Row<eT>::begin_row(const u32 row_num)
00896   {
00897   arma_extra_debug_sigprint();
00898   
00899   arma_debug_check( (row_num >= Mat<eT>::n_rows), "begin_row(): index out of bounds");
00900   
00901   return Mat<eT>::memptr();
00902   }
00903 
00904 
00905 
00906 template<typename eT>
00907 inline
00908 typename Row<eT>::const_row_iterator
00909 Row<eT>::begin_row(const u32 row_num) const
00910   {
00911   arma_extra_debug_sigprint();
00912   
00913   arma_debug_check( (row_num >= Mat<eT>::n_rows), "begin_row(): index out of bounds");
00914   
00915   return Mat<eT>::memptr();
00916   }
00917 
00918 
00919 
00920 template<typename eT>
00921 inline
00922 typename Row<eT>::row_iterator
00923 Row<eT>::end_row(const u32 row_num)
00924   {
00925   arma_extra_debug_sigprint();
00926   
00927   arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds");
00928   
00929   return Mat<eT>::memptr() + Mat<eT>::n_cols;
00930   }
00931 
00932 
00933 
00934 template<typename eT>
00935 inline
00936 typename Row<eT>::const_row_iterator
00937 Row<eT>::end_row(const u32 row_num) const
00938   {
00939   arma_extra_debug_sigprint();
00940   
00941   arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds");
00942   
00943   return Mat<eT>::memptr() + Mat<eT>::n_cols;
00944   }
00945 
00946 
00947 
00948 //! @}