Added wrapping for the PCG solver in Cython
parent
cb55d81fb5
commit
3f4731a948
16
gtsam.h
16
gtsam.h
|
@ -1937,6 +1937,22 @@ virtual class ConjugateGradientParameters : gtsam::IterativeOptimizationParamete
|
|||
void print() const;
|
||||
};
|
||||
|
||||
#include <gtsam/linear/Preconditioner.h>
|
||||
virtual class PreconditionerParameters {
|
||||
PreconditionerParameters();
|
||||
};
|
||||
|
||||
virtual class DummyPreconditionerParameters : gtsam::PreconditionerParameters {
|
||||
DummyPreconditionerParameters();
|
||||
};
|
||||
|
||||
#include <gtsam/linear/PCGSolver.h>
|
||||
virtual class PCGSolverParameters : gtsam::ConjugateGradientParameters {
|
||||
PCGSolverParameters();
|
||||
void print(string s);
|
||||
void setPreconditionerParams(gtsam::PreconditionerParameters* preconditioner);
|
||||
};
|
||||
|
||||
#include <gtsam/linear/SubgraphSolver.h>
|
||||
virtual class SubgraphSolverParameters : gtsam::ConjugateGradientParameters {
|
||||
SubgraphSolverParameters();
|
||||
|
|
|
@ -45,6 +45,17 @@ PCGSolver::PCGSolver(const PCGSolverParameters &p) {
|
|||
preconditioner_ = createPreconditioner(p.preconditioner_);
|
||||
}
|
||||
|
||||
void PCGSolverParameters::setPreconditionerParams(const boost::shared_ptr<PreconditionerParameters> preconditioner) {
|
||||
preconditioner_ = preconditioner;
|
||||
}
|
||||
|
||||
void PCGSolverParameters::print(const std::string &s) const {
|
||||
std::cout << s << std::endl;;
|
||||
std::ostringstream os;
|
||||
print(os);
|
||||
std::cout << os.str() << std::endl;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
VectorValues PCGSolver::optimize(const GaussianFactorGraph &gfg,
|
||||
const KeyInfo &keyInfo, const std::map<Key, Vector> &lambda,
|
||||
|
|
|
@ -48,7 +48,11 @@ public:
|
|||
return *preconditioner_;
|
||||
}
|
||||
|
||||
void print(const std::string &s) const;
|
||||
|
||||
boost::shared_ptr<PreconditionerParameters> preconditioner_;
|
||||
|
||||
void setPreconditionerParams(const boost::shared_ptr<PreconditionerParameters> preconditioner);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue