12#ifndef BELFEM_FN_BZ_EIGEN_HPP
13#define BELFEM_FN_BZ_EIGEN_HPP
14#include <blaze/util/typetraits/IsComplex.h>
28 const bool aAbortOnComplex =
true )
31 "Matrix must be quadratic");
33 blaze::DynamicVector<blaze::complex<real>, blaze::columnVector > tValues ;
34 blaze::eigen( aMatrix.matrix_data(), tValues );
36 size_t tN = aMatrix.n_cols() ;
37 aValues.set_size( aMatrix.n_cols() );
39 int_t tNumComplex = 0 ;
41 for(
size_t k=0; k<tN; ++k )
46 "eigen(): eigenvalue %u of this matrix is complex ( %g %+g i ), and a real "
47 "Vector cannot hold it. Use eigen_sym() if the matrix is symmetric, or pass "
48 "aAbortOnComplex = false to receive a count and NaN entries instead.",
50 (
double ) std::real( tValues[ k ] ),
51 (
double ) std::imag( tValues[ k ] ) );
58 aValues( k ) = std::real( tValues[ k ] );
72 "Matrix must be quadratic");
74 aValues.set_size( aMatrix.n_cols() );
82 blaze::syev( tWork.matrix_data(), aValues.vector_data(),
'N',
'U' );
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
int_t eigen(const Matrix< real > &aMatrix, Vector< real > &aValues, const bool aAbortOnComplex=true)
Eigenvalues of a general (not necessarily symmetric) square matrix.
Definition fn_AR_eigen.hpp:24
void eigen_sym(const Matrix< real > &aMatrix, Vector< real > &aValues)
Eigenvalues of a symmetric matrix.
Definition fn_AR_eigen.hpp:67
USER GUIDES:
Definition cl_Capacitor.cpp:16
constexpr real BELFEM_EPSILON
Definition typedefs.hpp:90
int32_t int_t
Definition typedefs.hpp:51
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:87