5#ifndef DUNE_DYNMATRIXEIGENVALUES_HH
6#define DUNE_DYNMATRIXEIGENVALUES_HH
24 namespace DynamicMatrixHelp {
27 using Dune::FMatrixHelp::eigenValuesNonsymLapackCall;
38 template <
typename K,
class C>
47 const long int N =
matrix.rows();
48 const char jobvl =
'n';
57 for(
int i=0;
i<N; ++
i)
59 for(
int j=0;
j<N; ++
j, ++
row)
66 auto eigenR = std::make_unique<double[]>(N);
67 auto eigenI = std::make_unique<double[]>(N);
70 auto work = std::make_unique<double[]>(
lwork);
71 auto vr =
eigenVectors ? std::make_unique<double[]>(N*N) : std::unique_ptr<double[]>{};
83 std::cerr <<
"For matrix " <<
matrix <<
" eigenvalue calculation failed! " << std::endl;
87 eigenValues.resize(N);
88 for (
int i=0;
i<N; ++
i)
93 for (
int i = 0;
i < N; ++
i) {
94 auto&
v = (*eigenVectors)[
i];
96 std::copy(
vr.get() + N*
i,
vr.get() + N*(
i+1), &
v[0]);
This file implements a dense matrix with dynamic numbers of rows and columns.
Eigenvalue computations for the FieldMatrix class.
#define DUNE_THROW(E, m)
Definition exceptions.hh:218
Dune namespace.
Definition alignedallocator.hh:13
static void eigenValuesNonSym(const DynamicMatrix< K > &matrix, DynamicVector< C > &eigenValues, std::vector< DynamicVector< K > > *eigenVectors=nullptr)
calculates the eigenvalues of a symmetric field matrix
Definition dynmatrixev.hh:39
A dynamically growing random access list.
Definition arraylist.hh:62
Default exception for dummy implementations.
Definition exceptions.hh:263
Default exception if a function was called while the object is not in a valid state for that function...
Definition exceptions.hh:281