Fn_svd


Functions

template<typename T1 >
bool svd (Col< typename T1::pod_type > &S, const Base< typename T1::elem_type, T1 > &X)
template<typename T1 >
Col< typename T1::pod_type > svd (const Base< typename T1::elem_type, T1 > &X)
template<typename T1 >
bool svd (Mat< typename T1::elem_type > &U, Col< typename T1::pod_type > &S, Mat< typename T1::elem_type > &V, const Base< typename T1::elem_type, T1 > &X)

Function Documentation

template<typename T1 >
bool svd ( Col< typename T1::pod_type > &  S,
const Base< typename T1::elem_type, T1 > &  X 
) [inline]

Definition at line 24 of file fn_svd.hpp.

References arma_print(), Base< elem_type, derived >::get_ref(), and auxlib::svd().

Referenced by svd().

00025   {
00026   arma_extra_debug_sigprint();
00027 
00028   typedef typename T1::elem_type eT;
00029   
00030   // unwrap_check not used as T1::elem_type and T1::pod_type may not be the same.
00031   // furthermore, it doesn't matter if A is an alias of S, as auxlib::svd() makes a copy of A
00032   
00033   const unwrap<T1> tmp(X.get_ref());
00034   const Mat<eT>& A = tmp.M;
00035   
00036   const bool status = auxlib::svd(S, A);
00037     
00038   if(status == false)
00039     {
00040     arma_print("svd(): singular value decomposition failed");
00041     }
00042   
00043   return status;
00044   }

template<typename T1 >
Col<typename T1::pod_type> svd ( const Base< typename T1::elem_type, T1 > &  X  )  [inline]

Definition at line 51 of file fn_svd.hpp.

References svd().

00052   {
00053   arma_extra_debug_sigprint();
00054   
00055   Col<typename T1::pod_type> out;
00056   svd(out, X);
00057   
00058   return out;
00059   }

template<typename T1 >
bool svd ( Mat< typename T1::elem_type > &  U,
Col< typename T1::pod_type > &  S,
Mat< typename T1::elem_type > &  V,
const Base< typename T1::elem_type, T1 > &  X 
) [inline]

Definition at line 67 of file fn_svd.hpp.

References arma_print(), Base< elem_type, derived >::get_ref(), and auxlib::svd().

00073   {
00074   arma_extra_debug_sigprint();
00075   
00076   typedef typename T1::elem_type eT;
00077   
00078   const unwrap<T1> tmp(X.get_ref());
00079   const Mat<eT>& A = tmp.M;
00080   
00081   const bool status = auxlib::svd(U, S, V, A);
00082     
00083   if(status == false)
00084     {
00085     arma_print("svd(): singular value decomposition failed");
00086     }
00087   
00088   return status;
00089   }