Functions

Fn_stddev

//! More...

Functions

template<typename T1 >
Mat< typename T1::pod_type > stddev (const Base< typename T1::elem_type, T1 > &X, const u32 norm_type=0, const u32 dim=0)
template<typename eT >
arma_warn_unused get_pod_type
< eT >::result 
stddev (const Row< eT > &A, const u32 norm_type=0)
 Immediate 'find the standard deviation of a row vector' operation.
template<typename eT >
arma_warn_unused get_pod_type
< eT >::result 
stddev (const Col< eT > &A, const u32 norm_type=0)
 Immediate 'find the standard deviation of a column vector' operation.
template<typename eT >
arma_warn_unused get_pod_type
< eT >::result 
stddev (const subview_row< eT > &A, const u32 norm_type=0)
 find the standard deviation of a subview_row
template<typename eT >
arma_warn_unused get_pod_type
< eT >::result 
stddev (const subview_col< eT > &A, const u32 norm_type=0)
 find the standard deviation of a subview_col
template<typename eT >
arma_warn_unused get_pod_type
< eT >::result 
stddev (const diagview< eT > &A, const u32 norm_type=0)
 find the standard deviation of a diagview

Detailed Description

//!


Function Documentation

template<typename T1 >
Mat<typename T1::pod_type> stddev ( const Base< typename T1::elem_type, T1 > &  X,
const u32  norm_type = 0,
const u32  dim = 0 
) [inline]

Definition at line 25 of file fn_stddev.hpp.

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

Referenced by op_cor::direct_cor(), and glue_cor::direct_cor().

  {
  arma_extra_debug_sigprint();
  
  typedef typename T1::elem_type  in_eT;
  typedef typename T1::pod_type  out_eT;

  const unwrap<T1>      tmp(X.get_ref());
  const Mat<in_eT>& A = tmp.M;
  
  Mat<out_eT> out;
  
  op_stddev::apply(out, A, norm_type, dim);
  
  return out;
  }

template<typename eT >
arma_warn_unused get_pod_type<eT>::result stddev ( const Row< eT > &  A,
const u32  norm_type = 0 
) [inline]

Immediate 'find the standard deviation of a row vector' operation.

Definition at line 49 of file fn_stddev.hpp.

References op_var::direct_var(), Mat< eT >::mem, Mat< eT >::n_elem, and sqrt().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "stddev(): given vector has no elements" );
  
  return std::sqrt( op_var::direct_var(A.mem, A.n_elem, norm_type) );
  }

template<typename eT >
arma_warn_unused get_pod_type<eT>::result stddev ( const Col< eT > &  A,
const u32  norm_type = 0 
) [inline]

Immediate 'find the standard deviation of a column vector' operation.

Definition at line 65 of file fn_stddev.hpp.

References op_var::direct_var(), Mat< eT >::mem, Mat< eT >::n_elem, and sqrt().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "stddev(): given vector has no elements" );
  
  return std::sqrt( op_var::direct_var(A.mem, A.n_elem, norm_type) );
  }

template<typename eT >
arma_warn_unused get_pod_type<eT>::result stddev ( const subview_row< eT > &  A,
const u32  norm_type = 0 
) [inline]

find the standard deviation of a subview_row

Definition at line 81 of file fn_stddev.hpp.

References op_var::direct_var(), subview< eT >::n_elem, and sqrt().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "stddev(): given vector has no elements" );
  
  return std::sqrt( op_var::direct_var(A, norm_type) );
  }

template<typename eT >
arma_warn_unused get_pod_type<eT>::result stddev ( const subview_col< eT > &  A,
const u32  norm_type = 0 
) [inline]

find the standard deviation of a subview_col

Definition at line 97 of file fn_stddev.hpp.

References op_var::direct_var(), subview< eT >::n_elem, and sqrt().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "stddev(): given vector has no elements" );
  
  return std::sqrt( op_var::direct_var(A, norm_type) );
  }

template<typename eT >
arma_warn_unused get_pod_type<eT>::result stddev ( const diagview< eT > &  A,
const u32  norm_type = 0 
) [inline]

find the standard deviation of a diagview

Definition at line 113 of file fn_stddev.hpp.

References op_var::direct_var(), diagview< eT >::n_elem, and sqrt().

  {
  arma_extra_debug_sigprint();
  
  arma_debug_check( (A.n_elem == 0), "stddev(): given vector has no elements" );
  
  return std::sqrt( op_var::direct_var(A, norm_type) );
  }