52 string outputFilename;
55 arg.
param(
"i", maxIterations, 10,
"perform n iterations, if negative consider the gain");
56 arg.
param(
"o", outputFilename,
"",
"output final version of the graph");
57 arg.
paramLeftOver(
"graph-input", inputFilename,
"",
"graph file which will be processed");
78 ifstream ifs(inputFilename.c_str());
80 cerr <<
"unable to open " << inputFilename << endl;
87 if (outputFilename.size() > 0) {
88 if (outputFilename ==
"-") {
89 cerr <<
"saving to stdout";
92 cerr <<
"saving " << outputFilename <<
" ... ";
93 optimizer.
save(outputFilename.c_str());
95 cerr <<
"done." << endl;
Command line parsing of argc and argv.
Implementation of the Levenberg Algorithm.
int optimize(int iterations, bool online=false)
Traits::LinearSolverType LinearSolverType
bool parseArgs(int argc, char **argv, bool exitOnError=true)
virtual bool save(std::ostream &os, int level=0) const
save the graph to a stream. Again uses the Factory system.
void setVerbose(bool verbose)
linear solver which uses CSparse
void paramLeftOver(const std::string &name, std::string &p, const std::string &defValue, const std::string &desc, bool optional=false)
void setAlgorithm(OptimizationAlgorithm *algorithm)
void param(const std::string &name, bool &p, bool defValue, const std::string &desc)
virtual bool load(std::istream &is, bool createEdges=true)
load the graph from a stream. Uses the Factory singleton for creating the vertices and edges...
Implementation of a solver operating on the blocks of the Hessian.
virtual bool initializeOptimization(HyperGraph::EdgeSet &eset)
BlockSolver< BlockSolverTraits< Eigen::Dynamic, Eigen::Dynamic > > BlockSolverX