DGtal  1.5.beta
testEigenSolver.cpp
Go to the documentation of this file.
1 
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 
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="")
std::ostream & emphase()
std::ostream & info()
double endBlock()
DigitalPlane::Point Vector
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
Definition: Common.h:153
Aim: Provide linear algebra backend using Eigen dense and sparse matrix as well as dense vector....
Definition: EigenSupport.h:96
Aim: Represent any dynamic or static sized matrix having dense representation.
Definition: CDenseVector.h:89
Aim: Represent any dynamic sized matrix having sparse or dense representation.
Aim: Represent any dynamic sized column vector having sparse or dense representation.
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:90
int main(int argc, char **argv)
bool testEigenSolverConcepts()
EigenLinearAlgebraBackend::SparseMatrix SparseMatrix