Fn_min

Functions

template<typename T1 >
arma_inline const Op< T1, op_minmin (const Base< typename T1::elem_type, T1 > &X, const u32 dim=0)
 Delayed 'minimum values' operation. The dimension, along which the minima are found, is set via 'dim'. For dim = 0, the maximum value of each column is found (i.e. searches by traversing across rows). For dim = 1, the maximum value of each row is found (i.e. searches by traversing across columns). The default is dim = 0. NOTE: This function works differently than in Matlab/Octave.
template<typename eT >
arma_warn_unused eT min (const Row< eT > &A)
 Immediate 'find the minimum value in a row vector' operation.
template<typename eT >
arma_warn_unused eT min (const Col< eT > &A)
 Immediate 'find the minimum value in a column vector'.
template<typename T1 >
arma_warn_unused T1::elem_type min (const Op< T1, op_min > &in)
 Immediate 'find minimum value' operation, invoked, for example, by: min(min(A)).
template<typename T1 >
const Op< Op< T1, op_min >
, op_min
min (const Op< T1, op_min > &in, const u32 dim)
template<typename eT >
arma_warn_unused eT min (const subview_row< eT > &A)
template<typename eT >
arma_warn_unused eT min (const subview_col< eT > &A)
template<typename eT >
arma_warn_unused eT min (const diagview< eT > &A)
template<typename eT >
arma_warn_unused eT min (const Op< subview< eT >, op_min > &in)

Function Documentation

template<typename T1 >
arma_inline const Op<T1, op_min> min ( const Base< typename T1::elem_type, T1 > &  X,
const u32  dim = 0 
) [inline]

Delayed 'minimum values' operation. The dimension, along which the minima are found, is set via 'dim'. For dim = 0, the maximum value of each column is found (i.e. searches by traversing across rows). For dim = 1, the maximum value of each row is found (i.e. searches by traversing across columns). The default is dim = 0. NOTE: This function works differently than in Matlab/Octave.

Definition at line 31 of file fn_min.hpp.

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

Referenced by Row< eT >::copy_size(), Col< eT >::copy_size(), Mat< eT >::diag(), Math< eT >::log_min(), Row< eT >::ones(), Col< eT >::ones(), auxlib::qr(), Row< eT >::set_size(), Col< eT >::set_size(), auxlib::svd(), Row< eT >::zeros(), and Col< eT >::zeros().

00032   {
00033   arma_extra_debug_sigprint();
00034   
00035   return Op<T1, op_min>(X.get_ref(), dim, 0);
00036   }

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

Immediate 'find the minimum value in a row vector' operation.

Definition at line 44 of file fn_min.hpp.

References op_min::direct_min(), Mat< eT >::mem, and Mat< eT >::n_elem.

00045   {
00046   arma_extra_debug_sigprint();
00047   
00048   arma_debug_check( (A.n_elem == 0), "min(): given vector has no elements" );
00049   
00050   return op_min::direct_min(A.mem, A.n_elem);
00051   }

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

Immediate 'find the minimum value in a column vector'.

Definition at line 60 of file fn_min.hpp.

References op_min::direct_min(), Mat< eT >::mem, and Mat< eT >::n_elem.

00061   {
00062   arma_extra_debug_sigprint();
00063   
00064   arma_debug_check( (A.n_elem == 0), "min(): given vector has no elements" );
00065   
00066   return op_min::direct_min(A.mem, A.n_elem);
00067   }

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

Immediate 'find minimum value' operation, invoked, for example, by: min(min(A)).

Definition at line 78 of file fn_min.hpp.

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

00079   {
00080   arma_extra_debug_sigprint();
00081   arma_extra_debug_print("min(): two consecutive min() calls detected");
00082   
00083   typedef typename T1::elem_type eT;
00084   
00085   const unwrap<T1> tmp1(in.m);
00086   const Mat<eT>& X = tmp1.M;
00087   
00088   arma_debug_check( (X.n_elem == 0), "min(): given matrix has no elements" );
00089   
00090   return op_min::direct_min(X.mem, X.n_elem);
00091   }

template<typename T1 >
const Op< Op<T1, op_min>, op_min> min ( const Op< T1, op_min > &  in,
const u32  dim 
) [inline]

Definition at line 98 of file fn_min.hpp.

00099   {
00100   arma_extra_debug_sigprint();
00101   
00102   return Op< Op<T1, op_min>, op_min>(in, dim, 0);
00103   }

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

Definition at line 111 of file fn_min.hpp.

References op_min::direct_min(), and subview< eT >::n_elem.

00112   {
00113   arma_extra_debug_sigprint();
00114   
00115   arma_debug_check( (A.n_elem == 0), "min(): given vector has no elements" );
00116   
00117   return op_min::direct_min(A);
00118   }

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

Definition at line 126 of file fn_min.hpp.

References op_min::direct_min(), and subview< eT >::n_elem.

00127   {
00128   arma_extra_debug_sigprint();
00129   
00130   arma_debug_check( (A.n_elem == 0), "min(): given vector has no elements" );
00131   
00132   return op_min::direct_min(A);
00133   }

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

Definition at line 141 of file fn_min.hpp.

References op_min::direct_min(), and diagview< eT >::n_elem.

00142   {
00143   arma_extra_debug_sigprint();
00144   
00145   arma_debug_check( (A.n_elem == 0), "min(): given vector has no elements" );
00146   
00147   return op_min::direct_min(A);
00148   }

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

Definition at line 156 of file fn_min.hpp.

References op_min::direct_min(), and subview< eT >::n_elem.

00157   {
00158   arma_extra_debug_sigprint();
00159   arma_extra_debug_print("max(): two consecutive max() calls detected");
00160   
00161   const subview<eT>& X = in.m;
00162   
00163   arma_debug_check( (X.n_elem == 0), "max(): given matrix has no elements" );
00164   
00165   return op_min::direct_min(X);
00166   }