29 string IterativeOptimizationParameters::getVerbosity()
const {
30 return verbosityTranslator(verbosity_);
34 void IterativeOptimizationParameters::setVerbosity(
const string &src) {
35 verbosity_ = verbosityTranslator(src);
45 os <<
"IterativeOptimizationParameters:" << endl <<
"verbosity: " 46 << verbosityTranslator(verbosity_) << endl;
62 return IterativeOptimizationParameters::SILENT;
63 else if (s ==
"COMPLEXITY")
64 return IterativeOptimizationParameters::COMPLEXITY;
65 else if (s ==
"ERROR")
66 return IterativeOptimizationParameters::ERROR;
69 return IterativeOptimizationParameters::SILENT;
73 string IterativeOptimizationParameters::verbosityTranslator(
75 if (verbosity == SILENT)
77 else if (verbosity == COMPLEXITY)
79 else if (verbosity == ERROR)
87 const KeyInfo* keyInfo,
const std::map<Key, Vector>*
lambda) {
89 lambda ? *lambda : std::map<Key, Vector>());
94 const KeyInfo &keyInfo,
const std::map<Key, Vector> &
lambda) {
95 return optimize(gfg, keyInfo, lambda, keyInfo.
x0());
100 ordering_(ordering) {
116 for (
size_t i = 0;
i <
n; ++
i) {
118 const auto it_key = colspec.find(key);
119 if (it_key==colspec.end())
120 throw std::runtime_error(
"KeyInfo: Inconsistency in key-dim map");
121 const size_t dim = it_key->second;
131 for (
const auto &item: *
this ) {
132 result[item.second.index] = item.second.dim;
140 for (
const auto &item: *
this ) {
141 result.
emplace(item.first, Vector::Zero(item.second.dim));
const gtsam::Symbol key('X', 0)
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
std::map< Key, size_t > getKeyDimMap() const
static enum @1107 ordering
std::pair< VectorValues::iterator, bool > emplace(Key j, Args &&... args)
GTSAM_EXPORT void print() const
Linear Factor Graph where all factors are Gaussians.
EIGEN_DONT_INLINE void transform(const Transformation &t, Data &data)
Some support classes for iterative solvers.
KeyInfo()
Default Constructor.
cout<< "The eigenvalues of A are:"<< endl<< ces.eigenvalues()<< endl;cout<< "The matrix of eigenvectors, V, is:"<< endl<< ces.eigenvectors()<< endl<< endl;complex< float > lambda
ofstream os("timeSchurFactors.csv")
Vector x0vector() const
Return zero Vector of correct dimension.
int optimize(const SfmData &db, const NonlinearFactorGraph &graph, const Values &initial, bool separateCalibration=false)
VectorValues x0() const
Return VectorValues with zeros, of correct dimension.
ostream & operator<<(ostream &os, const IterativeOptimizationParameters &p)
std::vector< size_t > colSpec() const
Return a vector of dimensions ordered by ordering()
std::uint64_t Key
Integer nonlinear key type.
void initialize(const GaussianFactorGraph &fg)