Go to the documentation of this file.
23 using namespace gtsam;
25 int main(
int argc,
char *argv[]) {
29 cout <<
"Loading data..." << endl;
32 std::pair<NonlinearFactorGraph::shared_ptr, Values::shared_ptr>
data =
38 cout <<
"Optimizing..." << endl;
44 double lastError = optimizer.
error();
51 cout <<
"Error: " << optimizer.
error() <<
", lambda: " << optimizer.
lambda() << endl;
61 gttic_(marginalInformation);
63 gttoc_(marginalInformation);
70 }
catch(std::exception&
e) {
71 cout <<
e.what() << endl;
double absoluteErrorTol
The maximum absolute error decrease to stop iterating (default 1e-5)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GaussianFactorGraph::shared_ptr iterate() override
const Values & values() const
return values in current optimizer state
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
Matrix marginalInformation(Key variable) const
const LevenbergMarquardtParams & params() const
double lambda() const
Access the current damping value.
Verbosity verbosity
The printing verbosity during optimization (default SILENT)
double error() const
return error in current optimizer state
bool checkConvergence(double relativeErrorTreshold, double absoluteErrorTreshold, double errorThreshold, double currentError, double newError, NonlinearOptimizerParams::Verbosity verbosity)
utility functions for loading datasets
void tictoc_finishedIteration_()
const gtsam::Symbol key('X', 0)
GraphAndValues load2D(const std::string &filename, SharedNoiseModel model, size_t maxIndex, bool addNoise, bool smart, NoiseFormat noiseFormat, KernelFunctionType kernelFunctionType)
A class for computing marginals in a NonlinearFactorGraph.
double relativeErrorTol
The maximum relative error decrease to stop iterating (default 1e-5)
double errorTol
The maximum total error to stop iterating (default 0.0)
GTSAM_EXPORT std::string findExampleDataFile(const std::string &name)
int main(int argc, char *argv[])
NonlinearFactorGraph graph
Marginals marginals(graph, result)
std::uint64_t Key
Integer nonlinear key type.
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:08:57