Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 template<typename T1>
00023 inline
00024 bool
00025 svd
00026 (
00027 Col<typename T1::pod_type>& S,
00028 const Base<typename T1::elem_type,T1>& X,
00029 const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
00030 )
00031 {
00032 arma_extra_debug_sigprint();
00033
00034 typedef typename T1::elem_type eT;
00035
00036
00037
00038
00039 const unwrap<T1> tmp(X.get_ref());
00040 const Mat<eT>& A = tmp.M;
00041
00042 const bool status = auxlib::svd(S, A);
00043
00044 if(status == false)
00045 {
00046 arma_print("svd(): singular value decomposition failed");
00047 }
00048
00049 return status;
00050 }
00051
00052
00053
00054 template<typename T1>
00055 inline
00056 Col<typename T1::pod_type>
00057 svd
00058 (
00059 const Base<typename T1::elem_type,T1>& X,
00060 const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
00061 )
00062 {
00063 arma_extra_debug_sigprint();
00064
00065 Col<typename T1::pod_type> out;
00066
00067 const bool status = svd(out, X);
00068
00069 if(status == false)
00070 {
00071 out.set_size(0);
00072 }
00073
00074 return out;
00075 }
00076
00077
00078
00079 template<typename T1>
00080 inline
00081 bool
00082 svd
00083 (
00084 Mat<typename T1::elem_type>& U,
00085 Col<typename T1::pod_type>& S,
00086 Mat<typename T1::elem_type>& V,
00087 const Base<typename T1::elem_type,T1>& X,
00088 const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
00089 )
00090 {
00091 arma_extra_debug_sigprint();
00092
00093 typedef typename T1::elem_type eT;
00094
00095 arma_debug_check( ( ((void*)(&U) == (void*)(&S)) || (&U == &V) || ((void*)(&S) == (void*)(&V)) ), "svd(): two or more output objects are the same object" );
00096
00097 const unwrap<T1> tmp(X.get_ref());
00098 const Mat<eT>& A = tmp.M;
00099
00100
00101 const bool status = auxlib::svd(U, S, V, A);
00102
00103 if(status == false)
00104 {
00105 arma_print("svd(): singular value decomposition failed");
00106 }
00107
00108 return status;
00109 }
00110
00111
00112
00113