5 #include <Eigen/StdVector> 18 using namespace Eigen;
31 BlockSolver_3_3::LinearSolverType* linearSolver
33 BlockSolver_3_3* blockSolver
34 =
new BlockSolver_3_3(linearSolver);
53 int numMeasurements = 10;
54 double noiseLimit = sqrt(12.);
55 double noiseSigma = noiseLimit*noiseLimit / 12.0;
57 for (
int i = 0; i < numMeasurements; i++)
59 Vector3d measurement = truePoint +
75 cout <<
"truePoint=\n" << truePoint << endl;
77 cerr <<
"computed estimate=\n" <<
dynamic_cast<VertexPosition3D*
>(optimizer.
vertices().find(0)->second)->estimate() << endl;
91 cout <<
"covariance\n" << spinv << endl;
93 cout << spinv.
block(0,0) << endl;
int optimize(int iterations, bool online=false)
SparseMatrixBlock * block(int r, int c, bool alloc=false)
returns the block at location r,c. if alloc=true he block is created if it does not exist ...
virtual void setMeasurement(const Measurement &m)
void setVertex(size_t i, Vertex *v)
const VertexIDMap & vertices() const
Implementation of the Gauss Newton Algorithm.
virtual void setId(int id)
sets the id of the node in the graph be sure that the graph keeps consistent after changing the id ...
void setVerbose(bool verbose)
void setAlgorithm(OptimizationAlgorithm *algorithm)
EIGEN_STRONG_INLINE void setInformation(const InformationType &information)
basic solver for Ax = b which has to reimplemented for different linear algebra libraries ...
Implementation of a solver operating on the blocks of the Hessian.
virtual bool initializeOptimization(HyperGraph::EdgeSet &eset)
virtual bool addEdge(HyperGraph::Edge *e)
virtual bool addVertex(HyperGraph::Vertex *v, Data *userData)
bool computeMarginals(SparseBlockMatrix< MatrixXD > &spinv, const std::vector< std::pair< int, int > > &blockIndices)
Sparse matrix which uses blocks.
double sampleUniform(double min, double max, std::mt19937 *generator)