DGtal  0.9.2
testEigenSolver.cpp
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 
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> ));
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 // //
void beginBlock(const std::string &keyword="")
Aim: Represent any dynamic or static sized matrix having dense representation.
Definition: CDenseVector.h:88
Trace trace
Definition: Common.h:130
Aim: Represent any dynamic sized matrix having sparse or dense representation.
Aim: Provide linear algebra backend using Eigen dense and sparse matrix as well as dense vector...
Definition: EigenSupport.h:93
STL namespace.
double endBlock()
Aim: Describe a linear solver defined over a linear algebra. Problems are of the form: ...
Aim: Represent any dynamic or static sized matrix having sparse representation.
Definition: CSparseMatrix.h:89
std::ostream & emphase()
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Represent any dynamic sized column vector having sparse or dense representation.
std::ostream & info()