Esempio n. 1
0
arma_inline
Col<eT>::fixed<fixed_n_elem>::fixed()
  {
  arma_extra_debug_sigprint_this(this);
  
  mem_setup();
  }
Esempio n. 2
0
inline
podarray<eT>::podarray()
  : n_elem(0)
  , mem   (0)
  {
  arma_extra_debug_sigprint_this(this);
  }
inline
arma_counter<eT>::arma_counter()
  : d_count(   eT(0))
  , i_count(uword(0))
  {
  arma_extra_debug_sigprint_this(this);
  }
Esempio n. 4
0
inline
Row<eT>::fixed<fixed_n_elem>::fixed(const std::string& text)
    : Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
{
    arma_extra_debug_sigprint_this(this);

    Row<eT>::operator=(text);
}
Esempio n. 5
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const subview_cube<eT>& X)
  : Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
  {
  arma_extra_debug_sigprint_this(this);
  
  Col<eT>::operator=(X);
  }
Esempio n. 6
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const Base<eT,T1>& A)
  : Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
  {
  arma_extra_debug_sigprint_this(this);
  
  Col<eT>::operator=(A.get_ref());
  }
Esempio n. 7
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B)
  : Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
  {
  arma_extra_debug_sigprint_this(this);
  
  Col<eT>::init(A,B);
  }
Esempio n. 8
0
 inline
 Col<eT>::fixed<fixed_n_elem>::fixed(const std::initializer_list<eT>& list)
   : Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
   {
   arma_extra_debug_sigprint_this(this);
   
   (*this).operator=(list);
   }
Esempio n. 9
0
arma_hot
arma_inline
podarray<eT>::podarray(const uword new_n_elem)
  : n_elem(new_n_elem)
  {
  arma_extra_debug_sigprint_this(this);
  
  init_cold(new_n_elem);
  }
Esempio n. 10
0
inline
field<oT>::field()
  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , mem(0)
  {
  arma_extra_debug_sigprint_this(this);
  }
Esempio n. 11
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const Base<eT,T1>& A)
  {
  arma_extra_debug_sigprint_this(this);
  
  mem_setup();
  
  Col<eT>::operator=(A.get_ref());
  }
Esempio n. 12
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B)
  {
  arma_extra_debug_sigprint_this(this);
  
  mem_setup();
  
  Col<eT>::init(A,B);
  }
Esempio n. 13
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const eT* aux_mem)
  {
  arma_extra_debug_sigprint_this(this);
  
  mem_setup();
  
  arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem );
  }
Esempio n. 14
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const subview_cube<eT>& X)
  {
  arma_extra_debug_sigprint_this(this);
  
  mem_setup();
  
  Col<eT>::operator=(X);
  }
Esempio n. 15
0
arma_inline
podarray<eT>::podarray(const eT* X, const uword new_n_elem)
  : n_elem(new_n_elem)
  {
  arma_extra_debug_sigprint_this(this);
  
  init_cold(new_n_elem);
  
  arrayops::copy( memptr(), X, new_n_elem );
  }
Esempio n. 16
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const char* text)
  : Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
  {
  arma_extra_debug_sigprint_this(this);
  
  change_to_row();
  
  Col<eT>::operator=(text);
  }
Esempio n. 17
0
running_stat<eT>::running_stat()
  : r_mean      (                          eT(0))
  , r_var       (typename running_stat<eT>::T(0))
  , min_val     (                          eT(0))
  , max_val     (                          eT(0))
  , min_val_norm(typename running_stat<eT>::T(0))
  , max_val_norm(typename running_stat<eT>::T(0))
  {
  arma_extra_debug_sigprint_this(this);
  }
Esempio n. 18
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const eT* aux_mem)
  : Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
  {
  arma_extra_debug_sigprint_this(this);
  
  eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local;
  
  arrayops::copy( dest, aux_mem, fixed_n_elem );
  }
Esempio n. 19
0
inline
podarray<eT>::podarray(const Proxy<T1>& P)
  : n_elem(P.get_n_elem())
  {
  arma_extra_debug_sigprint_this(this);
  
  const uword P_n_elem = P.get_n_elem();
    
  init_cold(P_n_elem);
  
  eT* out_mem = (*this).memptr();
    
  if(Proxy<T1>::use_at == false)
    {
    typename Proxy<T1>::ea_type A = P.get_ea();
    
    uword i,j;
    for(i=0, j=1; j < P_n_elem; i+=2, j+=2)
      {
      const eT val_i = A[i];
      const eT val_j = A[j];
      
      out_mem[i] = val_i;
      out_mem[j] = val_j;
      }
    
    if(i < P_n_elem)
      {
      out_mem[i] = A[i];
      }
    }
  else
    {
    const uword P_n_rows = P.get_n_rows();
    const uword P_n_cols = P.get_n_cols();
    
    if(P_n_rows != 1)
      {
      uword count = 0;
      
      for(uword col=0; col < P_n_cols; ++col)
      for(uword row=0; row < P_n_rows; ++row, ++count)
        {
        out_mem[count] = P.at(row,col);
        }
      }
    else
      {
      for(uword col=0; col < P_n_cols; ++col)
        {
        out_mem[col] = P.at(0,col);
        }
      }
    }
  }
Esempio n. 20
0
arma_hot
inline
podarray<eT>::~podarray()
  {
  arma_extra_debug_sigprint_this(this);
  
  if(n_elem > podarray_prealloc_n_elem::val )
    {
    memory::release( mem );
    }
  }
Esempio n. 21
0
arma_inline
Row<eT>::fixed<fixed_n_elem>::fixed(const fixed<fixed_n_elem>& X)
    : Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
{
    arma_extra_debug_sigprint_this(this);

    eT* dest = (use_extra) ?   mem_local_extra : Mat<eT>::mem_local;
    const eT* src  = (use_extra) ? X.mem_local_extra :        X.mem_local;

    arrayops::copy( dest, src, fixed_n_elem );
}
Esempio n. 22
0
inline
field<oT>::field(const uword n_rows_in, const uword n_cols_in)
  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , mem(0)
  {
  arma_extra_debug_sigprint_this(this);
  
  init(n_rows_in, n_cols_in);
  }
Esempio n. 23
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const std::string& text)
  {
  arma_extra_debug_sigprint_this(this);
  
  mem_setup();
  
  change_to_row();
  
  Col<eT>::operator=(text);
  }
Esempio n. 24
0
arma_inline
Col<eT>::fixed<fixed_n_elem>::fixed(const fixed<fixed_n_elem>& X)
  {
  arma_extra_debug_sigprint_this(this);
  
  mem_setup();
  
  eT* dest = (use_extra) ? mem_local_extra : Mat<eT>::mem_local;
  
  arrayops::copy( dest, X.mem, fixed_n_elem );
  }
Esempio n. 25
0
inline
Col<eT>::Col(const SpCol<eT>& X)
  : Mat<eT>(arma_vec_indicator(), X.n_elem, 1, 1)
  {
  arma_extra_debug_sigprint_this(this);

  arrayops::inplace_set(Mat<eT>::memptr(), eT(0), X.n_elem);

  for(typename SpCol<eT>::const_iterator it = X.begin(); it != X.end(); ++it)
    at(it.row()) = (*it);
  }
Esempio n. 26
0
inline
field<oT>::field(const subview_field<oT>& X)
  : n_rows(0)
  , n_cols(0)
  , n_elem(0)
  , mem(0)
  {
  arma_extra_debug_sigprint_this(this);
  
  this->operator=(X);
  }
Esempio n. 27
0
inline
Col<eT>::Col(const std::vector<eT>& x)
  : Mat<eT>(arma_vec_indicator(), uword(x.size()), 1, 1)
  {
  arma_extra_debug_sigprint_this(this);
  
  if(x.size() > 0)
    {
    arrayops::copy( Mat<eT>::memptr(), &(x[0]), uword(x.size()) );
    }
  }
Esempio n. 28
0
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const fill::fill_class<fill_type>&)
  : Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
  {
  arma_extra_debug_sigprint_this(this);
  
  if(is_same_type<fill_type, fill::fill_zeros>::yes)  (*this).zeros();
  if(is_same_type<fill_type, fill::fill_ones >::yes)  (*this).ones();
  if(is_same_type<fill_type, fill::fill_eye  >::yes)  (*this).eye();
  if(is_same_type<fill_type, fill::fill_randu>::yes)  (*this).randu();
  if(is_same_type<fill_type, fill::fill_randn>::yes)  (*this).randn();
  }
running_stat_vec<eT>::running_stat_vec(const running_stat_vec<eT>& in_rsv)
  : calc_cov    (in_rsv.calc_cov)
  , counter     (in_rsv.counter)
  , r_mean      (in_rsv.r_mean)
  , r_var       (in_rsv.r_var)
  , r_cov       (in_rsv.r_cov)
  , min_val     (in_rsv.min_val)
  , max_val     (in_rsv.max_val)
  , min_val_norm(in_rsv.min_val_norm)
  , max_val_norm(in_rsv.max_val_norm)
  {
  arma_extra_debug_sigprint_this(this);
  }
inline
field<oT>::~field()
  {
  arma_extra_debug_sigprint_this(this);
  
  delete_objects();
  
  if(n_elem > sizeof(mem_local)/sizeof(oT*) )
    {
    delete [] mem;
    }
  
  if(arma_config::debug == true)
    {
    // try to expose buggy user code that accesses deleted objects
    mem = 0;
    }
  }