DGtal  1.1.0
testEigenSolver.cpp
Go to the documentation of this file.
1 
30 #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 
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> ));
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::concepts::CDenseVector
Aim: Represent any dynamic or static sized matrix having dense representation.
Definition: CDenseVector.h:89
DGtal::concepts::CSparseMatrix
Aim: Represent any dynamic or static sized matrix having sparse representation.
Definition: CSparseMatrix.h:90
DGtal::Trace::endBlock
double endBlock()
DGtal::concepts::CDynamicVector
Aim: Represent any dynamic sized column vector having sparse or dense representation.
Definition: CDynamicVector.h:89
main
int main(int argc, char **argv)
Definition: testEigenSolver.cpp:81
DGtal::concepts::CLinearAlgebraSolver
Aim: Describe a linear solver defined over a linear algebra. Problems are of the form:
Definition: CLinearAlgebraSolver.h:104
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::trace
Trace trace
Definition: Common.h:150
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
SparseMatrix
EigenLinearAlgebraBackend::SparseMatrix SparseMatrix
Definition: testHeatLaplace.cpp:50
DGtal::Trace::info
std::ostream & info()
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::EigenLinearAlgebraBackend
Aim: Provide linear algebra backend using Eigen dense and sparse matrix as well as dense vector....
Definition: EigenSupport.h:98
testEigenSolverConcepts
bool testEigenSolverConcepts()
Definition: testEigenSolver.cpp:55
Vector
FreemanChain< int >::Vector Vector
Definition: testCombinDSS.cpp:60
DGtal::concepts::CDynamicMatrix
Aim: Represent any dynamic sized matrix having sparse or dense representation.
Definition: CDynamicMatrix.h:89