gradientDescent_ and conjugateGradientDescent_ works in matlab
parent
ca34a6ef65
commit
d5d70d7751
|
@ -292,3 +292,17 @@ VectorConfig GaussianFactorGraph::conjugateGradientDescent(
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
/* ************************************************************************* */
|
||||
boost::shared_ptr<VectorConfig>
|
||||
GaussianFactorGraph::gradientDescent_(const VectorConfig& x0) const {
|
||||
return boost::shared_ptr<VectorConfig>(new VectorConfig(gradientDescent(x0)));
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
boost::shared_ptr<VectorConfig>
|
||||
GaussianFactorGraph::conjugateGradientDescent_(const VectorConfig& x0) const {
|
||||
return boost::shared_ptr<VectorConfig>(new VectorConfig(conjugateGradientDescent(x0)));
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
|
|
|
@ -187,13 +187,20 @@ namespace gtsam {
|
|||
* @return solution
|
||||
*/
|
||||
VectorConfig gradientDescent(const VectorConfig& x0) const;
|
||||
|
||||
/**
|
||||
* shared pointer versions for MATLAB
|
||||
*/
|
||||
boost::shared_ptr<VectorConfig>gradientDescent_(const VectorConfig& x0) const;
|
||||
/**
|
||||
* Find solution using conjugate gradient descent
|
||||
* @param x0: VectorConfig specifying initial estimate
|
||||
* @return solution
|
||||
*/
|
||||
VectorConfig conjugateGradientDescent(const VectorConfig& x0) const;
|
||||
/**
|
||||
* shared pointer versions for MATLAB
|
||||
*/
|
||||
boost::shared_ptr<VectorConfig> conjugateGradientDescent_(const VectorConfig& x0) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -106,6 +106,8 @@ class GaussianFactorGraph {
|
|||
VectorConfig* optimize_(const Ordering& ordering);
|
||||
pair<Matrix,Vector> matrix(const Ordering& ordering) const;
|
||||
Matrix sparse(const Ordering& ordering) const;
|
||||
VectorConfig* gradientDescent_(const VectorConfig& x0) const;
|
||||
VectorConfig* conjugateGradientDescent_(const VectorConfig& x0) const;
|
||||
};
|
||||
|
||||
class Point2 {
|
||||
|
|
Loading…
Reference in New Issue