Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
f7b40ba5
Verified
Commit
f7b40ba5
authored
5 years ago
by
Nils-Arne Dreier
Browse files
Options
Downloads
Patches
Plain Diff
move the LAPACK not found guard to eigenValuesVectorsLapackImpl
parent
876989bc
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!787
add eigenvalues and vectors computation for FieldMatrices for field_type float
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/common/fmatrixev.cc
+1
-36
1 addition, 36 deletions
dune/common/fmatrixev.cc
dune/common/fmatrixev.hh
+11
-0
11 additions, 0 deletions
dune/common/fmatrixev.hh
with
12 additions
and
36 deletions
dune/common/fmatrixev.cc
+
1
−
36
View file @
f7b40ba5
...
...
@@ -206,7 +206,6 @@ extern "C" {
const
long
int
*
lwork
,
long
int
*
info
);
}
// end extern C
#endif
namespace
Dune
{
...
...
@@ -217,16 +216,8 @@ namespace Dune {
int
*
n
,
double
*
a
,
const
long
int
*
lda
,
double
*
w
,
double
*
work
,
const
long
int
*
lwork
,
long
int
*
info
)
{
#if HAVE_LAPACK
// call LAPACK dsyev
DSYEV_FORTRAN
(
jobz
,
uplo
,
n
,
a
,
lda
,
w
,
work
,
lwork
,
info
);
#else
// silence unused variable warnings
DUNE_UNUSED_PARAMETER
(
jobz
),
DUNE_UNUSED_PARAMETER
(
uplo
),
DUNE_UNUSED_PARAMETER
(
n
);
DUNE_UNUSED_PARAMETER
(
a
),
DUNE_UNUSED_PARAMETER
(
lda
),
DUNE_UNUSED_PARAMETER
(
w
);
DUNE_UNUSED_PARAMETER
(
work
),
DUNE_UNUSED_PARAMETER
(
lwork
),
DUNE_UNUSED_PARAMETER
(
info
);
DUNE_THROW
(
NotImplemented
,
"eigenValuesLapackCall: LAPACK not found!"
);
#endif
}
void
eigenValuesLapackCall
(
...
...
@@ -234,16 +225,8 @@ namespace Dune {
int
*
n
,
float
*
a
,
const
long
int
*
lda
,
float
*
w
,
float
*
work
,
const
long
int
*
lwork
,
long
int
*
info
)
{
#if HAVE_LAPACK
// call LAPACK dsyev
SSYEV_FORTRAN
(
jobz
,
uplo
,
n
,
a
,
lda
,
w
,
work
,
lwork
,
info
);
#else
// silence unused variable warnings
DUNE_UNUSED_PARAMETER
(
jobz
),
DUNE_UNUSED_PARAMETER
(
uplo
),
DUNE_UNUSED_PARAMETER
(
n
);
DUNE_UNUSED_PARAMETER
(
a
),
DUNE_UNUSED_PARAMETER
(
lda
),
DUNE_UNUSED_PARAMETER
(
w
);
DUNE_UNUSED_PARAMETER
(
work
),
DUNE_UNUSED_PARAMETER
(
lwork
),
DUNE_UNUSED_PARAMETER
(
info
);
DUNE_THROW
(
NotImplemented
,
"eigenValuesLapackCall: LAPACK not found!"
);
#endif
}
void
eigenValuesNonsymLapackCall
(
...
...
@@ -252,18 +235,9 @@ namespace Dune {
const
long
int
*
ldvl
,
double
*
vr
,
const
long
int
*
ldvr
,
double
*
work
,
const
long
int
*
lwork
,
long
int
*
info
)
{
#if HAVE_LAPACK
// call LAPACK dgeev
DGEEV_FORTRAN
(
jobvl
,
jobvr
,
n
,
a
,
lda
,
wr
,
wi
,
vl
,
ldvl
,
vr
,
ldvr
,
work
,
lwork
,
info
);
#else
// silence unused variable warnings
DUNE_UNUSED_PARAMETER
(
jobvl
),
DUNE_UNUSED_PARAMETER
(
jobvr
),
DUNE_UNUSED_PARAMETER
(
n
);
DUNE_UNUSED_PARAMETER
(
a
),
DUNE_UNUSED_PARAMETER
(
lda
),
DUNE_UNUSED_PARAMETER
(
wr
),
DUNE_UNUSED_PARAMETER
(
wi
);
DUNE_UNUSED_PARAMETER
(
vl
),
DUNE_UNUSED_PARAMETER
(
ldvl
),
DUNE_UNUSED_PARAMETER
(
vr
);
DUNE_UNUSED_PARAMETER
(
ldvr
),
DUNE_UNUSED_PARAMETER
(
work
),
DUNE_UNUSED_PARAMETER
(
lwork
),
DUNE_UNUSED_PARAMETER
(
info
);
DUNE_THROW
(
NotImplemented
,
"eigenValuesNonsymLapackCall: LAPACK not found!"
);
#endif
}
void
eigenValuesNonsymLapackCall
(
...
...
@@ -272,20 +246,11 @@ namespace Dune {
const
long
int
*
ldvl
,
float
*
vr
,
const
long
int
*
ldvr
,
float
*
work
,
const
long
int
*
lwork
,
long
int
*
info
)
{
#if HAVE_LAPACK
// call LAPACK dgeev
SGEEV_FORTRAN
(
jobvl
,
jobvr
,
n
,
a
,
lda
,
wr
,
wi
,
vl
,
ldvl
,
vr
,
ldvr
,
work
,
lwork
,
info
);
#else
// silence unused variable warnings
DUNE_UNUSED_PARAMETER
(
jobvl
),
DUNE_UNUSED_PARAMETER
(
jobvr
),
DUNE_UNUSED_PARAMETER
(
n
);
DUNE_UNUSED_PARAMETER
(
a
),
DUNE_UNUSED_PARAMETER
(
lda
),
DUNE_UNUSED_PARAMETER
(
wr
),
DUNE_UNUSED_PARAMETER
(
wi
);
DUNE_UNUSED_PARAMETER
(
vl
),
DUNE_UNUSED_PARAMETER
(
ldvl
),
DUNE_UNUSED_PARAMETER
(
vr
);
DUNE_UNUSED_PARAMETER
(
ldvr
),
DUNE_UNUSED_PARAMETER
(
work
),
DUNE_UNUSED_PARAMETER
(
lwork
),
DUNE_UNUSED_PARAMETER
(
info
);
DUNE_THROW
(
NotImplemented
,
"eigenValuesNonsymLapackCall: LAPACK not found!"
);
#endif
}
#endif
}
// end namespace FMatrixHelp
}
// end namespace Dune
...
...
This diff is collapsed.
Click to expand it.
dune/common/fmatrixev.hh
+
11
−
0
View file @
f7b40ba5
...
...
@@ -26,6 +26,7 @@ namespace Dune {
namespace
FMatrixHelp
{
#if HAVE_LAPACK
// defined in fmatrixev.cc
extern
void
eigenValuesLapackCall
(
const
char
*
jobz
,
const
char
*
uplo
,
const
long
...
...
@@ -49,6 +50,8 @@ namespace Dune {
const
long
int
*
ldvl
,
float
*
vr
,
const
long
int
*
ldvr
,
float
*
work
,
const
long
int
*
lwork
,
long
int
*
info
);
#endif
namespace
Impl
{
//internal tag to activate/disable code for eigenvector calculation at compile time
enum
Jobs
{
OnlyEigenvalues
=
0
,
EigenvaluesEigenvectors
=
1
};
...
...
@@ -385,6 +388,7 @@ namespace Dune {
FieldMatrix
<
K
,
dim
,
dim
>&
eigenVectors
)
{
{
#if HAVE_LAPACK
/*Lapack uses a proprietary tag to determine whether both eigenvalues and
-vectors ('v') or only eigenvalues ('n') should be calculated */
const
char
jobz
=
"nv"
[
Tag
];
...
...
@@ -435,6 +439,9 @@ namespace Dune {
std
::
cerr
<<
"For matrix "
<<
matrix
<<
" eigenvalue calculation failed! "
<<
std
::
endl
;
DUNE_THROW
(
InvalidStateException
,
"eigenValues: Eigenvalue calculation failed!"
);
}
#else
DUNE_THROW
(
NotImplemented
,
"LAPACK not found!"
);
#endif
}
}
...
...
@@ -521,6 +528,7 @@ namespace Dune {
static
void
eigenValuesNonSym
(
const
FieldMatrix
<
K
,
dim
,
dim
>&
matrix
,
FieldVector
<
C
,
dim
>&
eigenValues
)
{
#if HAVE_LAPACK
{
const
long
int
N
=
dim
;
const
char
jobvl
=
'n'
;
...
...
@@ -563,6 +571,9 @@ namespace Dune {
eigenValues
[
i
].
imag
=
eigenI
[
i
];
}
}
#else
DUNE_THROW
(
NotImplemented
,
"LAPACK not found!"
);
#endif
}
}
// end namespace FMatrixHelp
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment