36#ifndef STK_LAPACK_SYMEIGEN_H
37#define STK_LAPACK_SYMEIGEN_H
48template<
class SquareArray>
class SymEigen;
57template<
class SquareArray_>
96template<
class SquareArray>
124 template<
class Derived>
181template<
class SquareArray>
183 , jobz_(
'V'), RANGE_(
'A'), UPLO_(
'U')
184 , VL_(0.0), VU_(0.0), IL_(0), IU_(0)
190template<
class SquareArray>
193 , jobz_(
'V'), RANGE_(
'A'), UPLO_(
'U')
194 , VL_(0.0), VU_(0.0), IL_(0), IU_(0)
203 , jobz_(
'V'), RANGE_(
'A'), UPLO_(
'U')
204 , VL_(0.0), VU_(0.0), IL_(0), IU_(0)
207template<
class SquareArray>
208template<
class Derived>
211 , jobz_(
'V'), RANGE_(
'A'), UPLO_(
'U')
212 , VL_(0.0), VU_(0.0), IL_(0), IU_(0)
217template<
class SquareArray>
228template<
class SquareArray>
231#ifdef STK_ALGEBRA_VERY_VERBOSE
238 eigenVectors_.shift(0);
239 eigenValues_.shift(0);
240 this->SupportEigenVectors_.shift(0);
249#ifdef STK_ALGEBRA_DEBUG
250 stk_cout <<
_T(
"Data dimensions: ") << data_.rows() <<
" " << data_.cols() <<
"\n";
251 stk_cout <<
_T(
"eigenValues_ dimensions: ") << eigenValues_.rows() <<
" " << eigenValues_.cols() <<
"\n";
252 stk_cout <<
_T(
"eigenVectors_ dimensions: ") << eigenVectors_.rows() <<
" " << eigenVectors_.cols() <<
"\n";
253 stk_cout <<
_T(
"Options: ") << jobz_ <<
" " << RANGE_ <<
" " << UPLO_ <<
"\n";
255 info =
syevr( jobz_, RANGE_, UPLO_
256 , range_.size(), data_.
p_data(), range_.size()
258 ,
absTol, &rank_, eigenValues_.p_data()
259 , eigenVectors_.p_data(), range_.size(),
this->SupportEigenVectors_.p_data()
271#ifdef STK_ALGEBRA_DEBUG
281 info =
syevr( jobz_, RANGE_, UPLO_
282 , range_.size(), data_.
p_data(), range_.size()
284 ,
absTol, &rank_, eigenValues_.p_data()
285 , eigenVectors_.p_data(), range_.size(),
this->SupportEigenVectors_.p_data()
292 data_.
shift(range_.begin());
293 eigenVectors_.shift(range_.begin());
294 eigenValues_.shift(range_.begin());
295 this->SupportEigenVectors_.shift(range_.begin());
296 this->finalizeStep();
297 this->hasRun_ =
true;
299 if (!info)
return true;
In this file we define the ISymEigen class (for a symmetric matrix).
#define STKERROR_NO_ARG(Where, Error)
#define STKERROR_1ARG(Where, Arg, Error)
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
In this file we define and implement utilities classes and methods for the interface with lapack.
Derived & shift(int beginRows, int beginCols)
shift the Array.
Type *const & p_data() const
virtual bool run()=0
run the computations.
The class ISymEigen is an interface class for the method computing the eigenvalue Decomposition of a ...
Range const & range() const
hidden::AlgebraTraits< SymEigen< SquareArray > >::SquareArray SquareArray
Range range_
range of the original data set.
CArrayVector< Type, size_ > eigenValues_
Array of the eigenvalues.
CArraySquare< Type, size_ > eigenVectors_
Square matrix or the eigenvectors.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
The class SymEigen compute the eigenvalue Decomposition of a symmetric ArrayXX.
char jobz_
Lapack pptions.
ISymEigen< SymEigen< SquareArray > > Base
void setIlAndIu(int il, int iu)
void setRange(char range)
virtual ~SymEigen()
Destructor.
SymEigen()
Default Constructor.
virtual SymEigen * clone() const
clone pattern
void setVlAndVu(Real const &vl, Real const &vu)
bool runImpl()
Run eigenvalues decomposition Launch SYEVR LAPACK routine to perform the eigenvalues decomposition.
int syevr(char jobz, char range, char uplo, int n, Real *a, int lda, Real vl, Real vu, int il, int iu, Real abstol, int *m, Real *w, Real *z, int ldz, int *isuppz, Real *work, int lWork, int *iwork, int liwork)
wrapper of the LAPACK SYEVR routine.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
traits class for the algebra methods.