armadillo  9.800.3
About: Armadillo is a C++ linear algebra library (matrix maths) aiming towards a good balance between speed and ease of use.
  Fossies Dox: armadillo-9.800.3.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

fn_sum.hpp File Reference

Go to the source code of this file.

Functions

template<typename T1 >
arma_warn_unused enable_if2< is_arma_type< T1 >::value &&resolves_to_vector< T1 >::yes, typename T1::elem_type >::result sum (const T1 &X)
 
template<typename T1 >
arma_warn_unused arma_inline enable_if2< is_arma_type< T1 >::value &&resolves_to_vector< T1 >::no, const Op< T1, op_sum > >::result sum (const T1 &X)
 
template<typename T1 >
arma_warn_unused arma_inline enable_if2< is_arma_type< T1 >::value, const Op< T1, op_sum > >::result sum (const T1 &X, const uword dim)
 
template<typename T >
arma_warn_unused arma_inline arma_scalar_only< T >::result sum (const T &x)
 
template<typename T1 >
arma_warn_unused const arma_inline OpCube< T1, op_sumsum (const BaseCube< typename T1::elem_type, T1 > &X, const uword dim=0)
 sum of cube More...
 
template<typename T1 >
arma_warn_unused enable_if2< is_arma_sparse_type< T1 >::value &&resolves_to_sparse_vector< T1 >::yes, typename T1::elem_type >::result sum (const T1 &x)
 sum of sparse object More...
 
template<typename T1 >
arma_warn_unused enable_if2< is_arma_sparse_type< T1 >::value &&resolves_to_sparse_vector< T1 >::no, const SpOp< T1, spop_sum > >::result sum (const T1 &x)
 
template<typename T1 >
arma_warn_unused enable_if2< is_arma_sparse_type< T1 >::value, const SpOp< T1, spop_sum > >::result sum (const T1 &x, const uword dim)
 

Function Documentation

◆ sum() [1/4]

template<typename T1 >
arma_warn_unused arma_inline enable_if2< is_arma_type<T1>::value && resolves_to_vector<T1>::no, const Op<T1, op_sum> >::result sum ( const T1 &  X)

Definition at line 38 of file fn_sum.hpp.

39  {
41 
42  return Op<T1, op_sum>(X, 0, 0);
43  }

References arma_extra_debug_sigprint.

◆ sum() [2/4]

template<typename T1 >
arma_warn_unused enable_if2< is_arma_sparse_type<T1>::value && resolves_to_sparse_vector<T1>::yes, typename T1::elem_type >::result sum ( const T1 &  x)
inline

sum of sparse object

Definition at line 99 of file fn_sum.hpp.

100  {
102 
103  // sum elements
104  return accu(x);
105  }

References accu(), and arma_extra_debug_sigprint.

◆ sum() [3/4]

template<typename T1 >
arma_warn_unused enable_if2< is_arma_sparse_type<T1>::value && resolves_to_sparse_vector<T1>::no, const SpOp<T1,spop_sum> >::result sum ( const T1 &  x)
inline

Definition at line 118 of file fn_sum.hpp.

119  {
121 
122  return SpOp<T1,spop_sum>(x, 0, 0);
123  }

References arma_extra_debug_sigprint.

◆ sum() [4/4]

template<typename T1 >
arma_warn_unused enable_if2< is_arma_sparse_type<T1>::value, const SpOp<T1,spop_sum> >::result sum ( const T1 &  x,
const uword  dim 
)
inline

Definition at line 136 of file fn_sum.hpp.

137  {
139 
140  return SpOp<T1,spop_sum>(x, dim, 0);
141  }

References arma_extra_debug_sigprint.

SpOp
Definition: arma_forward.hpp:314
arma_extra_debug_sigprint
#define arma_extra_debug_sigprint
Definition: debug.hpp:1279
accu
arma_warn_unused arma_hot enable_if2< is_arma_type< T1 >::value, typename T1::elem_type >::result accu(const T1 &X)
accumulate the elements of a matrix
Definition: fn_accu.hpp:255
Op
Definition: arma_forward.hpp:231