47 arma_bad(
"eig_sym(): failed to converge",
false);
74 arma_bad(
"eig_sym(): failed to converge");
97 arma_debug_check( ( ((
void*)(&eigval)) == ((
void*)(&eigvec)) ),
"eig_sym(): eigval is an alias of eigvec" );
105 arma_bad(
"eig_sym(): failed to converge",
false);
120 template<
typename T1>
125 Col< std::complex<typename T1::pod_type> >& eigval,
137 ((&l_eigvec) == (&r_eigvec)),
138 "eig_gen(): l_eigvec is an alias of r_eigvec" 144 (((
void*)(&eigval)) == ((
void*)(&l_eigvec)))
146 (((
void*)(&eigval)) == ((
void*)(&r_eigvec)))
148 "eig_gen(): eigval is an alias of l_eigvec or r_eigvec" 151 const bool status =
auxlib::eig_gen(eigval, l_eigvec, r_eigvec, X,
'b');
158 arma_bad(
"eig_gen(): failed to converge",
false);
169 template<
typename eT,
typename T1>
174 Col< std::complex<eT> >& eigval,
175 Mat< std::complex<eT> >& eigvec,
177 const char side =
'r',
186 arma_debug_check( ( ((
void*)(&eigval)) == ((
void*)(&eigvec)) ),
"eig_gen(): eigval is an alias of eigvec" );
204 arma_stop(
"eig_gen(): parameter 'side' is invalid");
212 arma_bad(
"eig_gen(): failed to converge",
false);
222 for(
uword j=0; j<n; ++j)
224 if( (j < n-1) && (eigval[j] ==
std::conj(eigval[j+1])) )
229 for(
uword i=0; i<n; ++i)
231 eigvec.
at(i,j) = std::complex<eT>( tmp_eigvec.
at(i,j), tmp_eigvec.
at(i,j+1) );
232 eigvec.
at(i,j+1) = std::complex<eT>( tmp_eigvec.
at(i,j), -tmp_eigvec.
at(i,j+1) );
241 for(
uword i=0; i<n; ++i)
243 eigvec.
at(i,j) = std::complex<eT>(tmp_eigvec.
at(i,j), eT(0));
259 template<
typename T,
typename T1>
264 Col<std::complex<T> >& eigval,
265 Mat<std::complex<T> >& eigvec,
266 const Base<std::complex<T>, T1>& X,
267 const char side =
'r',
276 arma_debug_check( ( ((
void*)(&eigval)) == ((
void*)(&eigvec)) ),
"eig_gen(): eigval is an alias of eigvec" );
293 arma_stop(
"eig_gen(): parameter 'side' is invalid");
301 arma_bad(
"eig_gen(): failed to converge",
false);
void set_size(const uword in_elem)
change the matrix to have user specified dimensions (data is not preserved)
static bool eig_gen(Col< std::complex< T > > &eigval, Mat< T > &l_eigvec, Mat< T > &r_eigvec, const Base< T, T1 > &X, const char side)
arma_inline const T1 & conj(const Base< typename T1::pod_type, T1 > &A)
const uword n_elem
number of elements in the matrix (read-only)
static bool eig_sym(Col< eT > &eigval, const Base< eT, T1 > &X)
immediate eigenvalues of a symmetric real matrix using LAPACK
Class for column vectors (matrices with only one column)
arma_inline arma_warn_unused eT & at(const uword i)
linear element accessor (treats the matrix as a vector); no bounds check.
#define arma_ignore(variable)
bool eig_gen(Col< std::complex< typename T1::pod_type > > &eigval, Mat< typename T1::elem_type > &l_eigvec, Mat< typename T1::elem_type > &r_eigvec, const Base< typename T1::elem_type, T1 > &X, const typename arma_blas_type_only< typename T1::elem_type >::result *junk=0)
Eigenvalues and eigenvectors (both left and right) of general real/complex square matrix X...
void arma_cold arma_stop(const T1 &x)
print a message to get_stream_err1() and/or throw a logic_error exception
#define arma_extra_debug_sigprint
void arma_cold arma_bad(const T1 &x, const bool hurl=true)
print a message to get_stream_err2() and/or throw a run-time error exception
bool eig_sym(Col< typename T1::pod_type > &eigval, const Base< typename T1::elem_type, T1 > &X, const typename arma_blas_type_only< typename T1::elem_type >::result *junk=0)
Eigenvalues of real/complex symmetric/hermitian matrix X.