36 os <<
"PCGSolverParameters:" << endl;
37 preconditioner_->print(os);
46 void PCGSolverParameters::setPreconditionerParams(
const std::shared_ptr<PreconditionerParameters> preconditioner) {
47 preconditioner_ = preconditioner;
51 std::cout << s << std::endl;
52 std::ostringstream
os;
54 std::cout << os.str() << std::endl;
62 preconditioner_->build(gfg, keyInfo, lambda);
73 GaussianFactorGraphSystem::GaussianFactorGraphSystem(
75 const KeyInfo &keyInfo,
const std::map<Key, Vector> &
lambda) :
76 gfg_(gfg), preconditioner_(preconditioner), keyInfo_(keyInfo), lambda_(
88 Vector Ax = Vector::Zero(r.rows(), 1);
154 for (
size_t i = 0;
i < ordering.size(); ++
i) {
156 map<Key, size_t>::const_iterator it = dimensions.find(key);
157 if (it == dimensions.end()) {
158 throw invalid_argument(
159 "buildVectorValues: inconsistent ordering and dimensions");
161 const size_t dim = it->second;
162 result.
emplace(key, v.segment(offset, dim));
172 for (
const KeyInfo::value_type &item: keyInfo ) {
173 result.
emplace(item.first, v.segment(item.second.start, item.second.dim));
const gtsam::Symbol key('X', 0)
void rightPrecondition(const Vector &x, Vector &y) const
double dot(const Vector &x, const Vector &y) const
void multiply(const Vector &x, Vector &y) const
const Preconditioner & preconditioner_
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate offset
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
void scal(const double alpha, Vector &x) const
static enum @1107 ordering
ptrdiff_t DenseIndex
The index type for Eigen objects.
VectorValues buildVectorValues(const Vector &v, const KeyInfo &keyInfo)
Create VectorValues from a Vector and a KeyInfo class.
std::pair< VectorValues::iterator, bool > emplace(Key j, Args &&... args)
V preconditionedConjugateGradient(const S &system, const V &initial, const ConjugateGradientParameters ¶meters)
virtual void solve(const Vector &y, Vector &x) const =0
implement x = L^{-1} y
virtual void transposeSolve(const Vector &y, Vector &x) const =0
implement x = L^{-T} y
Array< int, Dynamic, 1 > v
void leftPrecondition(const Vector &x, Vector &y) const
const Ordering & ordering() const
Return the ordering.
Linear Factor Graph where all factors are Gaussians.
void multiplyHessianAdd(double alpha, const VectorValues &x, VectorValues &y) const
std::shared_ptr< PreconditionerParameters > preconditioner_
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")
void axpy(const double alpha, const Vector &x, Vector &y) const
int optimize(const SfmData &db, const NonlinearFactorGraph &graph, const Values &initial, bool separateCalibration=false)
VectorValues x0() const
Return VectorValues with zeros, of correct dimension.
const GaussianFactorGraph & gfg_
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
const std::vector< size_t > dimensions
virtual VectorValues gradientAtZero() const
std::shared_ptr< Preconditioner > createPreconditioner(const std::shared_ptr< PreconditionerParameters > params)
std::uint64_t Key
Integer nonlinear key type.
void residual(const Vector &x, Vector &r) const
VectorValues buildVectorValues(const Vector &v, const Ordering &ordering, const map< Key, size_t > &dimensions)
Create VectorValues from a Vector.
void getb(Vector &b) const