Col_meat.hpp
Go to the documentation of this file.
00001 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
00002 // Copyright (C) 2008-2011 Conrad Sanderson
00003 // 
00004 // This file is part of the Armadillo C++ library.
00005 // It is provided without any warranty of fitness
00006 // for any purpose. You can redistribute this file
00007 // and/or modify it under the terms of the GNU
00008 // Lesser General Public License (LGPL) as published
00009 // by the Free Software Foundation, either version 3
00010 // of the License or (at your option) any later version.
00011 // (see http://www.opensource.org/licenses for more info)
00012 
00013 
00016 
00017 
00019 template<typename eT>
00020 inline
00021 Col<eT>::Col()
00022   : Mat<eT>(0, 1)
00023   {
00024   arma_extra_debug_sigprint();
00025   
00026   access::rw(Mat<eT>::vec_state) = 1;
00027   }
00028 
00029 
00030 
00031 template<typename eT>
00032 inline
00033 Col<eT>::Col(const Col<eT>& X)
00034   : Mat<eT>(X.n_elem, 1)
00035   {
00036   arma_extra_debug_sigprint();
00037   
00038   access::rw(Mat<eT>::vec_state) = 1;
00039   
00040   arrayops::copy((*this).memptr(), X.memptr(), X.n_elem);
00041   }
00042 
00043 
00044 
00046 template<typename eT>
00047 inline
00048 Col<eT>::Col(const uword in_n_elem)
00049   : Mat<eT>(in_n_elem, 1)
00050   {
00051   arma_extra_debug_sigprint();
00052   
00053   access::rw(Mat<eT>::vec_state) = 1;
00054   }
00055 
00056 
00057 
00058 template<typename eT>
00059 inline
00060 Col<eT>::Col(const uword in_n_rows, const uword in_n_cols)
00061   {
00062   arma_extra_debug_sigprint();
00063   
00064   access::rw(Mat<eT>::vec_state) = 1;
00065   
00066   Mat<eT>::init_warm(in_n_rows, in_n_cols);
00067   }
00068 
00069 
00070 
00072 template<typename eT>
00073 inline
00074 Col<eT>::Col(const char* text)
00075   {
00076   arma_extra_debug_sigprint();
00077   
00078   access::rw(Mat<eT>::vec_state) = 2;
00079   
00080   Mat<eT>::operator=(text);
00081   
00082   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00083   
00084   access::rw(Mat<eT>::vec_state) = 1;
00085   }
00086 
00087 
00088 
00090 template<typename eT>
00091 inline
00092 const Col<eT>&
00093 Col<eT>::operator=(const char* text)
00094   {
00095   arma_extra_debug_sigprint();
00096   
00097   access::rw(Mat<eT>::vec_state) = 2;
00098   
00099   Mat<eT>::operator=(text);
00100   
00101   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00102   
00103   access::rw(Mat<eT>::vec_state) = 1;
00104   
00105   return *this;
00106   }
00107 
00108 
00109 
00111 template<typename eT>
00112 inline
00113 Col<eT>::Col(const std::string& text)
00114   {
00115   arma_extra_debug_sigprint();
00116   
00117   access::rw(Mat<eT>::vec_state) = 2;
00118   
00119   Mat<eT>::operator=(text);
00120   
00121   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00122   
00123   access::rw(Mat<eT>::vec_state) = 1;
00124   }
00125 
00126 
00127 
00129 template<typename eT>
00130 inline
00131 const Col<eT>&
00132 Col<eT>::operator=(const std::string& text)
00133   {
00134   arma_extra_debug_sigprint();
00135   
00136   access::rw(Mat<eT>::vec_state) = 2;
00137   
00138   Mat<eT>::operator=(text);
00139   
00140   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00141   
00142   access::rw(Mat<eT>::vec_state) = 1;
00143   
00144   return *this;
00145   }
00146 
00147 
00148 
00149 #if defined(ARMA_USE_CXX11)
00150 
00151 template<typename eT>
00152 inline
00153 Col<eT>::Col(const std::initializer_list<eT>& list)
00154   {
00155   arma_extra_debug_sigprint();
00156   
00157   access::rw(Mat<eT>::vec_state) = 2;
00158   
00159   Mat<eT>::operator=(list);
00160   
00161   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00162   
00163   access::rw(Mat<eT>::vec_state) = 1;
00164   }
00165 
00166 
00167 
00168 template<typename eT>
00169 inline
00170 const Col<eT>&
00171 Col<eT>::operator=(const std::initializer_list<eT>& list)
00172   {
00173   arma_extra_debug_sigprint();
00174   
00175   access::rw(Mat<eT>::vec_state) = 2;
00176   
00177   Mat<eT>::operator=(list);
00178   
00179   std::swap( access::rw(Mat<eT>::n_rows), access::rw(Mat<eT>::n_cols) );
00180   
00181   access::rw(Mat<eT>::vec_state) = 1;
00182   
00183   return *this;
00184   }
00185 
00186 #endif
00187 
00188 
00189 
00190 template<typename eT>
00191 inline
00192 const Col<eT>&
00193 Col<eT>::operator=(const eT val)
00194   {
00195   arma_extra_debug_sigprint();
00196   
00197   Mat<eT>::operator=(val);
00198   
00199   return *this;
00200   }
00201 
00202 
00203 
00204 template<typename eT>
00205 template<typename T1>
00206 inline
00207 Col<eT>::Col(const Base<eT,T1>& X)
00208   {
00209   arma_extra_debug_sigprint();
00210   
00211   access::rw(Mat<eT>::vec_state) = 1;
00212   
00213   Mat<eT>::operator=(X.get_ref());
00214   }
00215 
00216 
00217 
00218 template<typename eT>
00219 template<typename T1>
00220 inline
00221 const Col<eT>&
00222 Col<eT>::operator=(const Base<eT,T1>& X)
00223   {
00224   arma_extra_debug_sigprint();
00225   
00226   Mat<eT>::operator=(X.get_ref());
00227   
00228   return *this;
00229   }
00230 
00231 
00232 
00234 template<typename eT>
00235 inline
00236 Col<eT>::Col(eT* aux_mem, const uword aux_length, const bool copy_aux_mem, const bool strict)
00237   : Mat<eT>(aux_mem, aux_length, 1, copy_aux_mem, strict)
00238   {
00239   arma_extra_debug_sigprint();
00240   
00241   access::rw(Mat<eT>::vec_state) = 1;
00242   }
00243 
00244 
00245 
00247 template<typename eT>
00248 inline
00249 Col<eT>::Col(const eT* aux_mem, const uword aux_length)
00250   : Mat<eT>(aux_mem, aux_length, 1)
00251   {
00252   arma_extra_debug_sigprint();
00253   
00254   access::rw(Mat<eT>::vec_state) = 1;
00255   }
00256 
00257 
00258 
00259 template<typename eT>
00260 template<typename T1, typename T2>
00261 inline
00262 Col<eT>::Col
00263   (
00264   const Base<typename Col<eT>::pod_type, T1>& A,
00265   const Base<typename Col<eT>::pod_type, T2>& B
00266   )
00267   {
00268   arma_extra_debug_sigprint();
00269   
00270   access::rw(Mat<eT>::vec_state) = 1;
00271   
00272   Mat<eT>::init(A,B);
00273   }
00274 
00275 
00276 
00277 template<typename eT>
00278 template<typename T1>
00279 inline
00280 Col<eT>::Col(const BaseCube<eT,T1>& X)
00281   {
00282   arma_extra_debug_sigprint();
00283   
00284   access::rw(Mat<eT>::vec_state) = 1;
00285   
00286   Mat<eT>::operator=(X);
00287   }
00288 
00289 
00290 
00291 template<typename eT>
00292 template<typename T1>
00293 inline
00294 const Col<eT>&
00295 Col<eT>::operator=(const BaseCube<eT,T1>& X)
00296   {
00297   arma_extra_debug_sigprint();
00298   
00299   Mat<eT>::operator=(X);
00300   
00301   return *this;
00302   }
00303 
00304 
00305 
00306 template<typename eT>
00307 inline
00308 Col<eT>::Col(const subview_cube<eT>& X)
00309   {
00310   arma_extra_debug_sigprint();
00311   
00312   access::rw(Mat<eT>::vec_state) = 1;
00313   
00314   Mat<eT>::operator=(X);
00315   }
00316 
00317 
00318 
00319 template<typename eT>
00320 inline
00321 const Col<eT>&
00322 Col<eT>::operator=(const subview_cube<eT>& X)
00323   {
00324   arma_extra_debug_sigprint();
00325   
00326   Mat<eT>::operator=(X);
00327   
00328   return *this;
00329   }
00330 
00331 
00332 
00333 template<typename eT>
00334 inline
00335 mat_injector< Col<eT> >
00336 Col<eT>::operator<<(const eT val)
00337   {
00338   return mat_injector< Col<eT> >(*this, val);
00339   }
00340 
00341 
00342 
00343 template<typename eT>
00344 arma_inline
00345 eT&
00346 Col<eT>::row(const uword row_num)
00347   {
00348   arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::row(): out of bounds" );
00349   
00350   return access::rw(Mat<eT>::mem[row_num]);
00351   }
00352 
00353 
00354 
00355 template<typename eT>
00356 arma_inline
00357 eT
00358 Col<eT>::row(const uword row_num) const
00359   {
00360   arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::row(): out of bounds" );
00361   
00362   return Mat<eT>::mem[row_num];
00363   }
00364 
00365 
00366 
00367 template<typename eT>
00368 arma_inline
00369 subview_col<eT>
00370 Col<eT>::rows(const uword in_row1, const uword in_row2)
00371   {
00372   arma_extra_debug_sigprint();
00373   
00374   arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Col::rows(): indices out of bounds or incorrectly used");
00375   
00376   const uword subview_n_rows = in_row2 - in_row1 + 1;
00377   
00378   return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
00379   }
00380 
00381 
00382 
00383 template<typename eT>
00384 arma_inline
00385 const subview_col<eT>
00386 Col<eT>::rows(const uword in_row1, const uword in_row2) const
00387   {
00388   arma_extra_debug_sigprint();
00389   
00390   arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Col::rows(): indices out of bounds or incorrectly used");
00391   
00392   const uword subview_n_rows = in_row2 - in_row1 + 1;
00393   
00394   return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
00395   }
00396 
00397 
00398 
00399 template<typename eT>
00400 arma_inline
00401 subview_col<eT>
00402 Col<eT>::subvec(const uword in_row1, const uword in_row2)
00403   {
00404   arma_extra_debug_sigprint();
00405   
00406   arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Col::subvec(): indices out of bounds or incorrectly used");
00407   
00408   const uword subview_n_rows = in_row2 - in_row1 + 1;
00409   
00410   return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
00411   }
00412 
00413 
00414 
00415 template<typename eT>
00416 arma_inline
00417 const subview_col<eT>
00418 Col<eT>::subvec(const uword in_row1, const uword in_row2) const
00419   {
00420   arma_extra_debug_sigprint();
00421   
00422   arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Col::subvec(): indices out of bounds or incorrectly used");
00423   
00424   const uword subview_n_rows = in_row2 - in_row1 + 1;
00425   
00426   return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
00427   }
00428 
00429 
00430 
00431 template<typename eT>
00432 arma_inline
00433 subview_col<eT>
00434 Col<eT>::subvec(const span& row_span)
00435   {
00436   arma_extra_debug_sigprint();
00437   
00438   const bool row_all = row_span.whole;
00439 
00440   const uword local_n_rows = Mat<eT>::n_rows;
00441   
00442   const uword in_row1       = row_all ? 0            : row_span.a;
00443   const uword in_row2       =                          row_span.b;
00444   const uword subvec_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1;
00445 
00446   arma_debug_check( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used");
00447   
00448   return subview_col<eT>(*this, 0, in_row1, subvec_n_rows);
00449   }
00450 
00451 
00452 
00453 template<typename eT>
00454 arma_inline
00455 const subview_col<eT>
00456 Col<eT>::subvec(const span& row_span) const
00457   {
00458   arma_extra_debug_sigprint();
00459   
00460   const bool row_all = row_span.whole;
00461 
00462   const uword local_n_rows = Mat<eT>::n_rows;
00463   
00464   const uword in_row1       = row_all ? 0            : row_span.a;
00465   const uword in_row2       =                          row_span.b;
00466   const uword subvec_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1;
00467 
00468   arma_debug_check( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used");
00469   
00470   return subview_col<eT>(*this, 0, in_row1, subvec_n_rows);
00471   }
00472 
00473 
00474 
00475 // template<typename eT>
00476 // arma_inline
00477 // subview_col<eT>
00478 // Col<eT>::operator()(const span& row_span)
00479 //   {
00480 //   arma_extra_debug_sigprint();
00481 //   
00482 //   return subvec(row_span);
00483 //   }
00484 // 
00485 // 
00486 // 
00487 // template<typename eT>
00488 // arma_inline
00489 // const subview_col<eT>
00490 // Col<eT>::operator()(const span& row_span) const
00491 //   {
00492 //   arma_extra_debug_sigprint();
00493 //   
00494 //   return subvec(row_span);
00495 //   }
00496 
00497 
00498 
00500 template<typename eT>
00501 inline
00502 void
00503 Col<eT>::shed_row(const uword row_num)
00504   {
00505   arma_extra_debug_sigprint();
00506   
00507   arma_debug_check( row_num >= Mat<eT>::n_rows, "Col::shed_row(): out of bounds");
00508   
00509   shed_rows(row_num, row_num);
00510   }
00511 
00512 
00513 
00515 template<typename eT>
00516 inline
00517 void
00518 Col<eT>::shed_rows(const uword in_row1, const uword in_row2)
00519   {
00520   arma_extra_debug_sigprint();
00521   
00522   arma_debug_check
00523     (
00524     (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows),
00525     "Col::shed_rows(): indices out of bounds or incorrectly used"
00526     );
00527   
00528   const uword n_keep_front = in_row1;
00529   const uword n_keep_back  = Mat<eT>::n_rows - (in_row2 + 1);
00530   
00531   Col<eT> X(n_keep_front + n_keep_back);
00532   
00533         eT* X_mem = X.memptr();
00534   const eT* t_mem = (*this).memptr();
00535   
00536   if(n_keep_front > 0)
00537     {
00538     arrayops::copy( X_mem, t_mem, n_keep_front );
00539     }
00540   
00541   if(n_keep_back > 0)
00542     {
00543     arrayops::copy( &(X_mem[n_keep_front]), &(t_mem[in_row2+1]), n_keep_back);
00544     }
00545   
00546   Mat<eT>::steal_mem(X);
00547   }
00548 
00549 
00550 
00553 template<typename eT>
00554 inline
00555 void
00556 Col<eT>::insert_rows(const uword row_num, const uword N, const bool set_to_zero)
00557   {
00558   arma_extra_debug_sigprint();
00559   
00560   const uword t_n_rows = Mat<eT>::n_rows;
00561   
00562   const uword A_n_rows = row_num;
00563   const uword B_n_rows = t_n_rows - row_num;
00564   
00565   // insertion at row_num == n_rows is in effect an append operation
00566   arma_debug_check( (row_num > t_n_rows), "Col::insert_rows(): out of bounds");
00567   
00568   if(N > 0)
00569     {
00570     Col<eT> out(t_n_rows + N);
00571     
00572           eT* out_mem = out.memptr();
00573     const eT*   t_mem = (*this).memptr();
00574     
00575     if(A_n_rows > 0)
00576       {
00577       arrayops::copy( out_mem, t_mem, A_n_rows );
00578       }
00579     
00580     if(B_n_rows > 0)
00581       {
00582       arrayops::copy( &(out_mem[row_num + N]), &(t_mem[row_num]), B_n_rows );
00583       }
00584     
00585     if(set_to_zero == true)
00586       {
00587       arrayops::inplace_set( &(out_mem[row_num]), eT(0), N );
00588       }
00589     
00590     Mat<eT>::steal_mem(out);
00591     }
00592   }
00593 
00594 
00595 
00598 template<typename eT>
00599 template<typename T1>
00600 inline
00601 void
00602 Col<eT>::insert_rows(const uword row_num, const Base<eT,T1>& X)
00603   {
00604   arma_extra_debug_sigprint();
00605   
00606   Mat<eT>::insert_rows(row_num, X);
00607   }
00608 
00609 
00610 
00611 template<typename eT>
00612 inline
00613 typename Col<eT>::row_iterator
00614 Col<eT>::begin_row(const uword row_num)
00615   {
00616   arma_extra_debug_sigprint();
00617   
00618   arma_debug_check( (row_num >= Mat<eT>::n_rows), "begin_row(): index out of bounds");
00619   
00620   return Mat<eT>::memptr() + row_num;
00621   }
00622 
00623 
00624 
00625 template<typename eT>
00626 inline
00627 typename Col<eT>::const_row_iterator
00628 Col<eT>::begin_row(const uword row_num) const
00629   {
00630   arma_extra_debug_sigprint();
00631   
00632   arma_debug_check( (row_num >= Mat<eT>::n_rows), "begin_row(): index out of bounds");
00633   
00634   return Mat<eT>::memptr() + row_num;
00635   }
00636 
00637 
00638 
00639 template<typename eT>
00640 inline
00641 typename Col<eT>::row_iterator
00642 Col<eT>::end_row(const uword row_num)
00643   {
00644   arma_extra_debug_sigprint();
00645   
00646   arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds");
00647   
00648   return Mat<eT>::memptr() + row_num + 1;
00649   }
00650 
00651 
00652 
00653 template<typename eT>
00654 inline
00655 typename Col<eT>::const_row_iterator
00656 Col<eT>::end_row(const uword row_num) const
00657   {
00658   arma_extra_debug_sigprint();
00659   
00660   arma_debug_check( (row_num >= Mat<eT>::n_rows), "end_row(): index out of bounds");
00661   
00662   return Mat<eT>::memptr() + row_num + 1;
00663   }
00664 
00665 
00666 
00667 template<typename eT>
00668 template<uword fixed_n_elem>
00669 arma_inline
00670 void
00671 Col<eT>::fixed<fixed_n_elem>::mem_setup()
00672   {
00673   arma_extra_debug_sigprint();
00674   
00675   access::rw(Mat<eT>::n_rows)    = fixed_n_elem;
00676   access::rw(Mat<eT>::n_cols)    = 1;
00677   access::rw(Mat<eT>::n_elem)    = fixed_n_elem;
00678   access::rw(Mat<eT>::vec_state) = 1;
00679   access::rw(Mat<eT>::mem_state) = 3;
00680   access::rw(Mat<eT>::mem)       = (use_extra) ? mem_local_extra : Mat<eT>::mem_local;
00681   }
00682 
00683 
00684 
00685 template<typename eT>
00686 template<uword fixed_n_elem>
00687 arma_inline
00688 void
00689 Col<eT>::fixed<fixed_n_elem>::change_to_row()
00690   {
00691   arma_extra_debug_sigprint();
00692   
00693   access::rw(Mat<eT>::n_cols) = fixed_n_elem;
00694   access::rw(Mat<eT>::n_rows) = 1;
00695   }
00696 
00697 
00698 
00699 template<typename eT>
00700 template<uword fixed_n_elem>
00701 arma_inline
00702 Col<eT>::fixed<fixed_n_elem>::fixed()
00703   {
00704   arma_extra_debug_sigprint_this(this);
00705   
00706   mem_setup();
00707   }
00708 
00709 
00710 
00711 template<typename eT>
00712 template<uword fixed_n_elem>
00713 arma_inline
00714 Col<eT>::fixed<fixed_n_elem>::fixed(const fixed<fixed_n_elem>& X)
00715   {
00716   arma_extra_debug_sigprint_this(this);
00717   
00718   mem_setup();
00719   
00720   eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local;
00721   
00722   arrayops::copy( dest, X.mem, fixed_n_elem );
00723   }
00724 
00725 
00726 
00727 template<typename eT>
00728 template<uword fixed_n_elem>
00729 inline
00730 Col<eT>::fixed<fixed_n_elem>::fixed(const subview_cube<eT>& X)
00731   {
00732   arma_extra_debug_sigprint_this(this);
00733   
00734   mem_setup();
00735   
00736   Col<eT>::operator=(X);
00737   }
00738 
00739 
00740 
00741 template<typename eT>
00742 template<uword fixed_n_elem>
00743 template<typename T1>
00744 inline
00745 Col<eT>::fixed<fixed_n_elem>::fixed(const Base<eT,T1>& A)
00746   {
00747   arma_extra_debug_sigprint_this(this);
00748   
00749   mem_setup();
00750   
00751   Col<eT>::operator=(A.get_ref());
00752   }
00753 
00754 
00755 
00756 template<typename eT>
00757 template<uword fixed_n_elem>
00758 template<typename T1, typename T2>
00759 inline
00760 Col<eT>::fixed<fixed_n_elem>::fixed(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B)
00761   {
00762   arma_extra_debug_sigprint_this(this);
00763   
00764   mem_setup();
00765   
00766   Col<eT>::init(A,B);
00767   }
00768 
00769 
00770 
00771 template<typename eT>
00772 template<uword fixed_n_elem>
00773 inline
00774 Col<eT>::fixed<fixed_n_elem>::fixed(eT* aux_mem, const bool copy_aux_mem)
00775   {
00776   arma_extra_debug_sigprint_this(this);
00777   
00778   access::rw(Mat<eT>::n_rows)    = fixed_n_elem;
00779   access::rw(Mat<eT>::n_cols)    = 1;
00780   access::rw(Mat<eT>::n_elem)    = fixed_n_elem;
00781   access::rw(Mat<eT>::vec_state) = 1;
00782   access::rw(Mat<eT>::mem_state) = 3;
00783   
00784   if(copy_aux_mem == true)
00785     {
00786     eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local;
00787     
00788     access::rw(Mat<eT>::mem) = dest;
00789     
00790     arrayops::copy( dest, aux_mem, fixed_n_elem );
00791     }
00792   else
00793     {
00794     access::rw(Mat<eT>::mem) = aux_mem;
00795     }
00796   }
00797 
00798 
00799 
00800 template<typename eT>
00801 template<uword fixed_n_elem>
00802 inline
00803 Col<eT>::fixed<fixed_n_elem>::fixed(const eT* aux_mem)
00804   {
00805   arma_extra_debug_sigprint_this(this);
00806   
00807   mem_setup();
00808   
00809   arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem );
00810   }
00811 
00812 
00813 
00817 template<typename eT>
00818 template<uword fixed_n_elem>
00819 inline
00820 Col<eT>::fixed<fixed_n_elem>::fixed(const char* text)
00821   {
00822   arma_extra_debug_sigprint_this(this);
00823   
00824   mem_setup();
00825   
00826   change_to_row();
00827   
00828   Col<eT>::operator=(text);
00829   }
00830 
00831 
00832 
00836 template<typename eT>
00837 template<uword fixed_n_elem>
00838 inline
00839 Col<eT>::fixed<fixed_n_elem>::fixed(const std::string& text)
00840   {
00841   arma_extra_debug_sigprint_this(this);
00842   
00843   mem_setup();
00844   
00845   change_to_row();
00846   
00847   Col<eT>::operator=(text);
00848   }
00849 
00850 
00851 
00852 template<typename eT>
00853 template<uword fixed_n_elem>
00854 template<typename T1>
00855 const Col<eT>&
00856 Col<eT>::fixed<fixed_n_elem>::operator=(const Base<eT,T1>& A)
00857   {
00858   arma_extra_debug_sigprint();
00859   
00860   Col<eT>::operator=(A.get_ref());
00861   
00862   return *this;
00863   }
00864 
00865 
00866 
00867 template<typename eT>
00868 template<uword fixed_n_elem>
00869 const Col<eT>&
00870 Col<eT>::fixed<fixed_n_elem>::operator=(const eT val)
00871   {
00872   arma_extra_debug_sigprint();
00873   
00874   Col<eT>::operator=(val);
00875   
00876   return *this;
00877   }
00878 
00879 
00880 
00881 template<typename eT>
00882 template<uword fixed_n_elem>
00883 const Col<eT>&
00884 Col<eT>::fixed<fixed_n_elem>::operator=(const char* text)
00885   {
00886   arma_extra_debug_sigprint();
00887   
00888   change_to_row();
00889   
00890   Col<eT>::operator=(text);
00891   
00892   return *this; 
00893   }
00894 
00895 
00896 
00897 template<typename eT>
00898 template<uword fixed_n_elem>
00899 const Col<eT>&
00900 Col<eT>::fixed<fixed_n_elem>::operator=(const std::string& text)
00901   {
00902   arma_extra_debug_sigprint();
00903   
00904   change_to_row();
00905   
00906   Col<eT>::operator=(text);
00907   
00908   return *this; 
00909   }
00910 
00911 
00912 
00913 template<typename eT>
00914 template<uword fixed_n_elem>
00915 const Col<eT>&
00916 Col<eT>::fixed<fixed_n_elem>::operator=(const subview_cube<eT>& X)
00917   {
00918   arma_extra_debug_sigprint();
00919   
00920   Col<eT>::operator=(X);
00921   
00922   return *this; 
00923   }
00924 
00925 
00926 
00927 template<typename eT>
00928 template<uword fixed_n_elem>
00929 inline
00930 subview_row<eT>
00931 Col<eT>::fixed<fixed_n_elem>::operator()(const uword row_num, const span& col_span)
00932   {
00933   arma_extra_debug_sigprint();
00934   
00935   return Mat<eT>::operator()(row_num, col_span);
00936   }
00937 
00938 
00939 
00940 template<typename eT>
00941 template<uword fixed_n_elem>
00942 inline
00943 const subview_row<eT>
00944 Col<eT>::fixed<fixed_n_elem>::operator()(const uword row_num, const span& col_span) const
00945   {
00946   arma_extra_debug_sigprint();
00947   
00948   return Mat<eT>::operator()(row_num, col_span);
00949   }
00950 
00951 
00952 
00953 template<typename eT>
00954 template<uword fixed_n_elem>
00955 inline
00956 subview_col<eT>
00957 Col<eT>::fixed<fixed_n_elem>::operator()(const span& row_span, const uword col_num)
00958   {
00959   arma_extra_debug_sigprint();
00960   
00961   return Mat<eT>::operator()(row_span, col_num);
00962   }
00963 
00964 
00965 
00966 template<typename eT>
00967 template<uword fixed_n_elem>
00968 inline
00969 const subview_col<eT>
00970 Col<eT>::fixed<fixed_n_elem>::operator()(const span& row_span, const uword col_num) const
00971   {
00972   arma_extra_debug_sigprint();
00973   
00974   return Mat<eT>::operator()(row_span, col_num);
00975   }
00976 
00977 
00978 
00979 template<typename eT>
00980 template<uword fixed_n_elem>
00981 inline
00982 subview<eT>
00983 Col<eT>::fixed<fixed_n_elem>::operator()(const span& row_span, const span& col_span)
00984   {
00985   arma_extra_debug_sigprint();
00986   
00987   return Mat<eT>::operator()(row_span, col_span);
00988   }
00989 
00990 
00991 
00992 template<typename eT>
00993 template<uword fixed_n_elem>
00994 inline
00995 const subview<eT>
00996 Col<eT>::fixed<fixed_n_elem>::operator()(const span& row_span, const span& col_span) const
00997   {
00998   arma_extra_debug_sigprint();
00999   
01000   return Mat<eT>::operator()(row_span, col_span);
01001   }
01002 
01003 
01004 
01005 template<typename eT>
01006 template<uword fixed_n_elem>
01007 arma_inline
01008 arma_warn_unused
01009 eT&
01010 Col<eT>::fixed<fixed_n_elem>::operator[] (const uword i)
01011   {
01012   return access::rw( Mat<eT>::mem[i] );
01013   }
01014 
01015 
01016 
01017 template<typename eT>
01018 template<uword fixed_n_elem>
01019 arma_inline
01020 arma_warn_unused
01021 eT
01022 Col<eT>::fixed<fixed_n_elem>::operator[] (const uword i) const
01023   {
01024   return ( Mat<eT>::mem[i] );
01025   }
01026 
01027 
01028 
01029 template<typename eT>
01030 template<uword fixed_n_elem>
01031 arma_inline
01032 arma_warn_unused
01033 eT&
01034 Col<eT>::fixed<fixed_n_elem>::at(const uword i)
01035   {
01036   return access::rw( Mat<eT>::mem[i] );
01037   }
01038 
01039 
01040 
01041 template<typename eT>
01042 template<uword fixed_n_elem>
01043 arma_inline
01044 arma_warn_unused
01045 eT
01046 Col<eT>::fixed<fixed_n_elem>::at(const uword i) const
01047   {
01048   return ( Mat<eT>::mem[i] );
01049   }
01050 
01051 
01052 
01053 template<typename eT>
01054 template<uword fixed_n_elem>
01055 arma_inline
01056 arma_warn_unused
01057 eT&
01058 Col<eT>::fixed<fixed_n_elem>::operator() (const uword i)
01059   {
01060   arma_debug_check( (i >= fixed_n_elem), "Col::fixed::operator(): out of bounds");
01061   
01062   return access::rw( Mat<eT>::mem[i] );
01063   }
01064 
01065 
01066 
01067 template<typename eT>
01068 template<uword fixed_n_elem>
01069 arma_inline
01070 arma_warn_unused
01071 eT
01072 Col<eT>::fixed<fixed_n_elem>::operator() (const uword i) const
01073   {
01074   arma_debug_check( (i >= fixed_n_elem), "Col::fixed::operator(): out of bounds");
01075   
01076   return ( Mat<eT>::mem[i] );
01077   }
01078 
01079 
01080 
01081 template<typename eT>
01082 template<uword fixed_n_elem>
01083 arma_inline
01084 arma_warn_unused
01085 eT&
01086 Col<eT>::fixed<fixed_n_elem>::at(const uword in_row, const uword in_col)
01087   {
01088   return access::rw( Mat<eT>::mem[in_row] );
01089   }
01090 
01091 
01092 
01093 template<typename eT>
01094 template<uword fixed_n_elem>
01095 arma_inline
01096 arma_warn_unused
01097 eT
01098 Col<eT>::fixed<fixed_n_elem>::at(const uword in_row, const uword in_col) const
01099   {
01100   return ( Mat<eT>::mem[in_row] );
01101   }
01102 
01103 
01104 
01105 template<typename eT>
01106 template<uword fixed_n_elem>
01107 arma_inline
01108 arma_warn_unused
01109 eT&
01110 Col<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword in_col)
01111   {
01112   arma_debug_check( ((in_row >= fixed_n_elem) || (in_col >= 1)), "Col::fixed::operator(): out of bounds" );
01113   
01114   return access::rw( Mat<eT>::mem[in_row] );
01115   }
01116 
01117 
01118 
01119 template<typename eT>
01120 template<uword fixed_n_elem>
01121 arma_inline
01122 arma_warn_unused
01123 eT
01124 Col<eT>::fixed<fixed_n_elem>::operator() (const uword in_row, const uword in_col) const
01125   {
01126   arma_debug_check( ((in_row >= fixed_n_elem) || (in_col >= 1)), "Col::fixed::operator(): out of bounds" );
01127   
01128   return ( Mat<eT>::mem[in_row] );
01129   }
01130 
01131 
01132 
01133 template<typename eT>
01134 template<uword fixed_n_elem>
01135 arma_hot
01136 inline
01137 const Col<eT>&
01138 Col<eT>::fixed<fixed_n_elem>::fill(const eT val)
01139   {
01140   arma_extra_debug_sigprint();
01141   
01142   arrayops::inplace_set( const_cast<eT*>(Mat<eT>::mem), val, fixed_n_elem );
01143   
01144   return *this;
01145   }
01146 
01147 
01148 
01149 template<typename eT>
01150 template<uword fixed_n_elem>
01151 arma_hot
01152 inline
01153 const Col<eT>&
01154 Col<eT>::fixed<fixed_n_elem>::zeros()
01155   {
01156   arma_extra_debug_sigprint();
01157   
01158   arrayops::inplace_set( const_cast<eT*>(Mat<eT>::mem), eT(0), fixed_n_elem );
01159   
01160   return *this;
01161   }
01162 
01163 
01164 
01165 template<typename eT>
01166 template<uword fixed_n_elem>
01167 arma_hot
01168 inline
01169 const Col<eT>&
01170 Col<eT>::fixed<fixed_n_elem>::ones()
01171   {
01172   arma_extra_debug_sigprint();
01173   
01174   arrayops::inplace_set( const_cast<eT*>(Mat<eT>::mem), eT(1), fixed_n_elem );
01175   
01176   return *this;
01177   }
01178 
01179 
01180 
01181 #ifdef ARMA_EXTRA_COL_MEAT
01182   #include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_MEAT)
01183 #endif
01184 
01185 
01186 


armadillo_matrix
Author(s): Conrad Sanderson - NICTA (www.nicta.com.au), (Wrapper by Sjoerd van den Dries)
autogenerated on Tue Jan 7 2014 11:42:03