DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
testEigenSolver.cpp
Go to the documentation of this file.
1
16
29
31
#include <iostream>
32
#include <vector>
33
#include <list>
34
#include "DGtal/base/Common.h"
35
#include "ConfigTest.h"
36
#include "DGtal/helpers/StdDefs.h"
37
#include "DGtal/math/linalg/CLinearAlgebraSolver.h"
38
#include "DGtal/math/linalg/CSparseMatrix.h"
39
#include "DGtal/math/linalg/CDynamicMatrix.h"
40
#include "DGtal/math/linalg/CDenseVector.h"
41
#include "DGtal/math/linalg/CDynamicVector.h"
42
#include "DGtal/math/linalg/EigenSupport.h"
44
45
using namespace
std
;
46
using namespace
DGtal
;
47
49
// Functions for testing Eigen solvers classes concepts
51
55
bool
testEigenSolverConcepts
()
56
{
57
typedef
EigenLinearAlgebraBackend
LAB;
58
typedef
LAB::DenseVector
Vector
;
59
typedef
LAB::SparseMatrix Matrix;
60
typedef
LAB::Triplet Triplet;
61
typedef
std::vector<Triplet> TripletsVector;
62
typedef
std::list<Triplet> TripletsList;
63
BOOST_CONCEPT_ASSERT((
concepts::CDynamicVector<Vector>
));
64
BOOST_CONCEPT_ASSERT((
concepts::CDenseVector<Vector>
));
65
BOOST_CONCEPT_ASSERT((
concepts::CDynamicMatrix<Matrix>
));
66
BOOST_CONCEPT_ASSERT((
concepts::CSparseMatrix<Matrix, TripletsVector::const_iterator>
));
67
BOOST_CONCEPT_ASSERT((
concepts::CSparseMatrix<Matrix, TripletsList::const_iterator>
));
68
BOOST_CONCEPT_ASSERT((
concepts::CLinearAlgebraSolver<LAB::SolverSimplicialLLT, Vector, Matrix>
));
69
BOOST_CONCEPT_ASSERT((
concepts::CLinearAlgebraSolver<LAB::SolverSimplicialLDLT, Vector, Matrix>
));
70
BOOST_CONCEPT_ASSERT((
concepts::CLinearAlgebraSolver<LAB::SolverConjugateGradient, Vector, Matrix>
));
71
BOOST_CONCEPT_ASSERT((
concepts::CLinearAlgebraSolver<LAB::SolverBiCGSTAB, Vector, Matrix>
));
72
BOOST_CONCEPT_ASSERT((
concepts::CLinearAlgebraSolver<LAB::SolverSparseLU, Vector, Matrix>
));
73
BOOST_CONCEPT_ASSERT((
concepts::CLinearAlgebraSolver<LAB::SolverSparseQR, Vector, Matrix>
));
74
75
return
true
;
76
}
77
79
// Standard services - public :
80
81
int
main
(
int
argc,
char
** argv )
82
{
83
trace
.
beginBlock
(
"Testing class EigenSolver"
);
84
trace
.
info
() <<
"Args:"
;
85
for
(
int
i = 0; i < argc; ++i )
86
trace
.
info
() <<
" "
<< argv[ i ];
87
trace
.
info
() << endl;
88
89
bool
res =
testEigenSolverConcepts
();
90
trace
.
emphase
() << ( res ?
"Passed."
:
"Error."
) << endl;
91
trace
.
endBlock
();
92
return
res ? 0 : 1;
93
}
94
// //
DGtal::Vector
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::endBlock
double endBlock()
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
DGtal::EigenLinearAlgebraBackend
Aim: Provide linear algebra backend using Eigen dense and sparse matrix as well as dense vector....
Definition
EigenSupport.h:96
DGtal::concepts::CDenseVector
Aim: Represent any dynamic or static sized matrix having dense representation.
Definition
CDenseVector.h:89
DGtal::concepts::CDynamicMatrix
Aim: Represent any dynamic sized matrix having sparse or dense representation.
Definition
CDynamicMatrix.h:89
DGtal::concepts::CDynamicVector
Aim: Represent any dynamic sized column vector having sparse or dense representation.
Definition
CDynamicVector.h:89
DGtal::concepts::CLinearAlgebraSolver
Aim: Describe a linear solver defined over a linear algebra. Problems are of the form:
Definition
CLinearAlgebraSolver.h:104
DGtal::concepts::CSparseMatrix
Aim: Represent any dynamic or static sized matrix having sparse representation.
Definition
CSparseMatrix.h:90
testEigenSolverConcepts
bool testEigenSolverConcepts()
Definition
testEigenSolver.cpp:55
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
tests
math
linalg
testEigenSolver.cpp
Generated on
for DGtal by
1.18.0