@@ -431,64 +431,6 @@ Col<eT>::operator=(Col<eT>&& X)
431431
432432
433433
434- // template<typename eT>
435- // inline
436- // Col<eT>::Col(Mat<eT>&& X)
437- // : Mat<eT>(arma_vec_indicator(), 1)
438- // {
439- // arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X);
440- //
441- // if(X.n_cols != 1) { const Mat<eT>& XX = X; Mat<eT>::operator=(XX); return; }
442- //
443- // access::rw(Mat<eT>::n_rows) = X.n_rows;
444- // access::rw(Mat<eT>::n_cols) = 1;
445- // access::rw(Mat<eT>::n_elem) = X.n_elem;
446- // access::rw(Mat<eT>::n_alloc) = X.n_alloc;
447- //
448- // if( (X.n_alloc > arma_config::mat_prealloc) || (X.mem_state == 1) || (X.mem_state == 2) )
449- // {
450- // access::rw(Mat<eT>::mem_state) = X.mem_state;
451- // access::rw(Mat<eT>::mem) = X.mem;
452- //
453- // access::rw(X.n_rows) = 0;
454- // access::rw(X.n_elem) = 0;
455- // access::rw(X.n_alloc) = 0;
456- // access::rw(X.mem_state) = 0;
457- // access::rw(X.mem) = nullptr;
458- // }
459- // else // condition: (X.n_alloc <= arma_config::mat_prealloc) || (X.mem_state == 0) || (X.mem_state == 3)
460- // {
461- // (*this).init_cold();
462- //
463- // arrayops::copy( (*this).memptr(), X.mem, X.n_elem );
464- //
465- // if( (X.mem_state == 0) && (X.n_alloc <= arma_config::mat_prealloc) )
466- // {
467- // access::rw(X.n_rows) = 0;
468- // access::rw(X.n_elem) = 0;
469- // access::rw(X.mem) = nullptr;
470- // }
471- // }
472- // }
473- //
474- //
475- //
476- // template<typename eT>
477- // inline
478- // Col<eT>&
479- // Col<eT>::operator=(Mat<eT>&& X)
480- // {
481- // arma_debug_sigprint(arma_str::format("this: %x; X: %x") % this % &X);
482- //
483- // if(X.n_cols != 1) { const Mat<eT>& XX = X; Mat<eT>::operator=(XX); return *this; }
484- //
485- // (*this).steal_mem(X, true);
486- //
487- // return *this;
488- // }
489-
490-
491-
492434template <typename eT>
493435inline
494436Col<eT>&
@@ -1208,6 +1150,25 @@ Col<eT>::at(const uword in_row, const uword) const
12081150
12091151
12101152
1153+ template <typename eT>
1154+ inline
1155+ void
1156+ Col<eT>::push_back(const eT val)
1157+ {
1158+ arma_debug_sigprint ();
1159+
1160+ if (Mat<eT>::mem_state != 0 )
1161+ {
1162+ arma_conform_check (true , " Col::push_back(): unsupported operation as auxiliary memory is in use" );
1163+
1164+ return ;
1165+ }
1166+
1167+ Mat<eT>::vec_push_back (val, arma_colvec_indicator ());
1168+ }
1169+
1170+
1171+
12111172template <typename eT>
12121173inline
12131174typename Col<eT>::row_iterator
0 commit comments