Added const verifiers for member functions of the class which are compatible
parent
725f5624c3
commit
0b1b5eca67
|
@ -91,10 +91,10 @@ namespace gtsam {
|
|||
const Matrix& get_R() const {return R_;}
|
||||
|
||||
/** STL like, return the iterator pointing to the first node */
|
||||
const_iterator const parentsBegin(){ return parents_.begin(); }
|
||||
const_iterator const parentsBegin() const { return parents_.begin(); }
|
||||
|
||||
/** STL like, return the iterator pointing to the last node */
|
||||
const_iterator const parentsEnd(){ return parents_.end(); }
|
||||
const_iterator const parentsEnd() const { return parents_.end(); }
|
||||
|
||||
/** find the number of parents */
|
||||
size_t size() const {return parents_.size();}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace gtsam {
|
|||
public:
|
||||
|
||||
/** get the factors to a specific node */
|
||||
const std::list<int>& get_factors_to_node(const std::string& key) {
|
||||
const std::list<int>& get_factors_to_node(const std::string& key) const {
|
||||
return node_to_factors_[key];
|
||||
}
|
||||
|
||||
|
|
|
@ -105,10 +105,10 @@ public:
|
|||
std::size_t size() const { return As.size();}
|
||||
|
||||
/** STL like, return the iterator pointing to the first node */
|
||||
const_iterator const begin() { return As.begin();}
|
||||
const_iterator const begin() const { return As.begin();}
|
||||
|
||||
/** STL like, return the iterator pointing to the last node */
|
||||
const_iterator const end() { return As.end(); }
|
||||
const_iterator const end() const { return As.end(); }
|
||||
|
||||
/** check if empty */
|
||||
bool empty() const { return b.size() == 0;}
|
||||
|
@ -142,7 +142,7 @@ public:
|
|||
* return the number of rows from the b vector
|
||||
* @return a integer with the number of rows from the b vector
|
||||
*/
|
||||
int numberOfRows() { return b.size();}
|
||||
int numberOfRows() const { return b.size();}
|
||||
|
||||
/**
|
||||
* Find all variables and their dimensions
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace gtsam {
|
|||
/** Check if two factors are equal */
|
||||
bool equals(const Factor& f, double tol=1e-9) const;
|
||||
|
||||
std::string dump() {return "";}
|
||||
std::string dump() const {return "";}
|
||||
};
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
|
@ -118,7 +118,7 @@ bool NonlinearFactorGraph::check_convergence(const FGConfig& config1,
|
|||
const FGConfig& config2,
|
||||
double relativeErrorTreshold,
|
||||
double absoluteErrorTreshold,
|
||||
int verbosity)
|
||||
int verbosity) const
|
||||
{
|
||||
double currentError = calculate_error(*this, config1, verbosity);
|
||||
double newError = calculate_error(*this, config2, verbosity);
|
||||
|
@ -211,7 +211,7 @@ pair<LinearFactorGraph, FGConfig> NonlinearFactorGraph::OneIterationLM( FGConfig
|
|||
double absoluteErrorTreshold,
|
||||
int verbosity,
|
||||
double lambda0,
|
||||
double lambdaFactor) {
|
||||
double lambdaFactor) const {
|
||||
|
||||
double lambda = lambda0;
|
||||
bool converged = false;
|
||||
|
|
|
@ -71,7 +71,7 @@ public: // these you will probably want to use
|
|||
bool check_convergence(const FGConfig& config1,
|
||||
const FGConfig& config2,
|
||||
double relativeErrorTreshold, double absoluteErrorTreshold,
|
||||
int verbosity = 0);
|
||||
int verbosity = 0) const;
|
||||
|
||||
/**
|
||||
* Optimize using Levenberg-Marquardt. Really Levenberg's
|
||||
|
@ -105,7 +105,7 @@ public: // these you will probably want to use
|
|||
double absoluteErrorTreshold,
|
||||
int verbosity,
|
||||
double lambda0,
|
||||
double lambdaFactor) ;
|
||||
double lambdaFactor) const ;
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace gtsam {
|
|||
}
|
||||
|
||||
/** operators */
|
||||
inline bool operator ==(const Point2& q) {return x_==q.x_ && q.y_==q.y_;}
|
||||
inline bool operator ==(const Point2& q) const {return x_==q.x_ && q.y_==q.y_;}
|
||||
inline Point2 operator + (const Point2& q) const {return Point2(x_+q.x_,y_+q.y_);}
|
||||
inline Point2 operator - (const Point2& q) const {return Point2(x_-q.x_,y_-q.y_);}
|
||||
|
||||
|
|
Loading…
Reference in New Issue