Functions

Fn_mean

//! More...

Functions

template<typename T1 >
arma_inline const Op< T1, op_meanmean (const Base< typename T1::elem_type, T1 > &X, const u32 dim=0)
template<typename eT >
arma_warn_unused eT mean (const Row< eT > &A)
 Immediate 'find the mean value of a row vector' operation.
template<typename eT >
arma_warn_unused eT mean (const Col< eT > &A)
 Immediate 'find the mean value of a column vector' operation.
template<typename T1 >
arma_warn_unused T1::elem_type mean (const Op< T1, op_mean > &in)
 //! Immediate 'find mean value' operation, //! invoked, for example, by: mean(mean(A))
template<typename T1 >
arma_inline const Op< Op< T1,
op_mean >, op_mean
mean (const Op< T1, op_mean > &in, const u32 dim)
template<typename eT >
arma_warn_unused eT mean (const subview_row< eT > &A)
template<typename eT >
arma_warn_unused eT mean (const subview_col< eT > &A)
template<typename eT >
arma_warn_unused eT mean (const Op< subview< eT >, op_mean > &in)
template<typename eT >
arma_warn_unused eT mean (const diagview< eT > &A)

Detailed Description

//!


Function Documentation

template<typename T1 >
arma_inline const Op<T1, op_mean> mean ( const Base< typename T1::elem_type, T1 > &  X,
const u32  dim = 0 
)

Definition at line 25 of file fn_mean.hpp.

References Base< elem_type, derived >::get_ref().

Referenced by op_princomp::direct_princomp().

  {
  arma_extra_debug_sigprint();
  
  return Op<T1, op_mean>(X.get_ref(), dim, 0);
  }

template<typename eT >
arma_warn_unused eT mean ( const Row< eT > &  A  )  [inline]

Immediate 'find the mean value of a row vector' operation.

Definition at line 39 of file fn_mean.hpp.

References op_mean::direct_mean(), Mat< eT >::mem, and Mat< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "mean(): given vector has no elements" );
  
  return op_mean::direct_mean(A.mem, A.n_elem);
  }

template<typename eT >
arma_warn_unused eT mean ( const Col< eT > &  A  )  [inline]

Immediate 'find the mean value of a column vector' operation.

Definition at line 55 of file fn_mean.hpp.

References op_mean::direct_mean(), Mat< eT >::mem, and Mat< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "mean(): given vector has no elements" );
  
  return op_mean::direct_mean(A.mem, A.n_elem);
  }

template<typename T1 >
arma_warn_unused T1::elem_type mean ( const Op< T1, op_mean > &  in  )  [inline]

//! Immediate 'find mean value' operation, //! invoked, for example, by: mean(mean(A))

Definition at line 73 of file fn_mean.hpp.

References op_mean::direct_mean(), unwrap< T1 >::M, Op< T1, op_type >::m, Mat< eT >::mem, and Mat< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  arma_extra_debug_print("mean(): two consecutive mean() calls detected");
  
  typedef typename T1::elem_type eT;
  
  const unwrap<T1> tmp1(in.m);
  const Mat<eT>& X = tmp1.M;
  
  arma_debug_check( (X.n_elem == 0), "mean(): given matrix has no elements" );
  
  return op_mean::direct_mean(X.mem, X.n_elem);
  }

template<typename T1 >
arma_inline const Op< Op<T1, op_mean>, op_mean> mean ( const Op< T1, op_mean > &  in,
const u32  dim 
)

Definition at line 93 of file fn_mean.hpp.

  {
  arma_extra_debug_sigprint();
  
  return Op< Op<T1, op_mean>, op_mean>(in, dim, 0);
  }

template<typename eT >
arma_warn_unused eT mean ( const subview_row< eT > &  A  )  [inline]

Definition at line 106 of file fn_mean.hpp.

References op_mean::direct_mean(), and subview< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "mean(): given vector has no elements" );
  
  return op_mean::direct_mean(A);
  }

template<typename eT >
arma_warn_unused eT mean ( const subview_col< eT > &  A  )  [inline]

Definition at line 121 of file fn_mean.hpp.

References op_mean::direct_mean(), and subview< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "mean(): given vector has no elements" );
  
  return op_mean::direct_mean(A);
  }

template<typename eT >
arma_warn_unused eT mean ( const Op< subview< eT >, op_mean > &  in  )  [inline]

Definition at line 136 of file fn_mean.hpp.

References op_mean::direct_mean(), and subview< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  arma_extra_debug_print("mean(): two consecutive mean() calls detected");
  
  const subview<eT>& X = in.m;
  
  arma_debug_check( (X.n_elem == 0), "mean(): given matrix has no elements" );
  
  return op_mean::direct_mean(X);
  }

template<typename eT >
arma_warn_unused eT mean ( const diagview< eT > &  A  )  [inline]

Definition at line 154 of file fn_mean.hpp.

References op_mean::direct_mean(), and diagview< eT >::n_elem.

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "mean(): given vector has no elements" );
  
  return op_mean::direct_mean(A);
  }