Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-xt
Commits
3b889849
Commit
3b889849
authored
4 years ago
by
Dr. Felix Tobias Schindler
Committed by
Tobias Leibner
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[la.eigen-solver] treat 1d vector as 1x1d matrix
parent
8e6a14e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!44
ccache and clang sanitizer flags for CI
Pipeline
#65330
canceled
4 years ago
Stage: images
Stage: cpp
Stage: python
Stage: headercheck
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/xt/la/eigen-solver.hh
+12
-2
12 additions, 2 deletions
dune/xt/la/eigen-solver.hh
dune/xt/la/eigen-solver/fmatrix.hh
+47
-0
47 additions, 0 deletions
dune/xt/la/eigen-solver/fmatrix.hh
with
59 additions
and
2 deletions
dune/xt/la/eigen-solver.hh
+
12
−
2
View file @
3b889849
...
...
@@ -21,6 +21,8 @@
#include
<dune/common/typetraits.hh>
#include
<dune/xt/common/configuration.hh>
#include
<dune/xt/common/vector.hh>
#include
<dune/xt/common/type_traits.hh>
#include
<dune/xt/la/exceptions.hh>
#include
<dune/xt/la/container.hh>
...
...
@@ -34,7 +36,11 @@ namespace LA {
* \note This class needs to be specialized for each MatrixType, the purpose of this variant is merely to document the
* expected functionality.
*/
template
<
class
MatrixType
,
bool
is_matrix
=
XT
::
Common
::
is_matrix
<
MatrixType
>
::
value
>
template
<
class
MatrixType
,
bool
is_matrix
=
XT
::
Common
::
is_matrix
<
MatrixType
>
::
value
||
(
XT
::
Common
::
is_vector
<
MatrixType
>::
value
&&
XT
::
Common
::
VectorAbstraction
<
MatrixType
>::
has_static_size
&&
XT
::
Common
::
VectorAbstraction
<
MatrixType
>::
static_size
==
1
)
>
class
EigenSolverOptions
{
static_assert
(
AlwaysFalse
<
MatrixType
>::
value
,
...
...
@@ -60,7 +66,11 @@ Common::Configuration eigen_solver_options(const MatrixType& /*matrix*/, const s
}
template
<
class
MatrixImp
,
bool
is_matrix
=
XT
::
Common
::
is_matrix
<
MatrixImp
>
::
value
>
template
<
class
MatrixImp
,
bool
is_matrix
=
XT
::
Common
::
is_matrix
<
MatrixImp
>
::
value
||
(
XT
::
Common
::
is_vector
<
MatrixImp
>::
value
&&
XT
::
Common
::
VectorAbstraction
<
MatrixImp
>::
has_static_size
&&
XT
::
Common
::
VectorAbstraction
<
MatrixImp
>::
static_size
==
1
)
>
class
EigenSolver
{
static_assert
(
AlwaysFalse
<
MatrixImp
>::
value
,
...
...
This diff is collapsed.
Click to expand it.
dune/xt/la/eigen-solver/fmatrix.hh
+
47
−
0
View file @
3b889849
...
...
@@ -18,7 +18,9 @@
#include
<dune/common/typetraits.hh>
#include
<dune/xt/common/fmatrix.hh>
#include
<dune/xt/common/fvector.hh>
#include
<dune/xt/common/matrix.hh>
#include
<dune/xt/common/memory.hh>
#include
<dune/xt/common/numeric_cast.hh>
#include
<dune/xt/common/vector.hh>
#include
<dune/xt/la/container/conversion.hh>
...
...
@@ -72,6 +74,17 @@ class EigenSolverOptions<Dune::XT::Common::FieldMatrix<K, SIZE, SIZE>, true>
{};
template
<
class
K
>
class
EigenSolverOptions
<
Dune
::
FieldVector
<
K
,
1
>
,
true
>
:
public
EigenSolverOptions
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>
,
true
>
{};
template
<
class
K
>
class
EigenSolverOptions
<
Dune
::
XT
::
Common
::
FieldVector
<
K
,
1
>
,
true
>
:
public
EigenSolverOptions
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>
,
true
>
{};
template
<
class
K
,
int
SIZE
>
class
EigenSolver
<
Dune
::
FieldMatrix
<
K
,
SIZE
,
SIZE
>
,
true
>
:
public
internal
::
EigenSolverBase
<
Dune
::
FieldMatrix
<
K
,
SIZE
,
SIZE
>
,
...
...
@@ -184,6 +197,40 @@ public:
};
template
<
class
K
>
class
EigenSolver
<
Dune
::
XT
::
Common
::
FieldVector
<
K
,
1
>
,
true
>
:
Common
::
ConstStorageProvider
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>>
,
public
EigenSolver
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>>
{
using
Storage
=
Common
::
ConstStorageProvider
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>>
;
using
BaseType
=
EigenSolver
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>>
;
public:
template
<
class
...
Args
>
EigenSolver
(
const
Dune
::
XT
::
Common
::
FieldVector
<
K
,
1
>&
vector
,
Args
&&
...
args
)
:
Storage
(
vector
[
0
])
,
BaseType
(
Storage
::
access
(),
std
::
forward
<
Args
>
(
args
)...)
{}
};
template
<
class
K
>
class
EigenSolver
<
Dune
::
FieldVector
<
K
,
1
>
,
true
>
:
Common
::
ConstStorageProvider
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>>
,
public
EigenSolver
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>>
{
using
Storage
=
Common
::
ConstStorageProvider
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>>
;
using
BaseType
=
EigenSolver
<
Dune
::
FieldMatrix
<
K
,
1
,
1
>>
;
public:
template
<
class
...
Args
>
EigenSolver
(
const
Dune
::
FieldVector
<
K
,
1
>&
vector
,
Args
&&
...
args
)
:
Storage
(
vector
[
0
])
,
BaseType
(
Storage
::
access
(),
std
::
forward
<
Args
>
(
args
)...)
{}
};
}
// namespace LA
}
// namespace XT
}
// namespace Dune
...
...
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