removed some new lines

release/4.3a0
kartik arcot 2023-01-11 11:43:44 -08:00
parent 7efc411aa1
commit 6233619095
14 changed files with 30 additions and 28 deletions

View File

@ -2,6 +2,8 @@ class UnaryFactor: public NoiseModelFactor1<Pose2> {
double mx_, my_; ///< X and Y measurements
public:
// Provide access to the Matrix& version of evaluateError:
using gtsam::NoiseModelFactor1<Pose2>::evaluateError;
UnaryFactor(Key j, double x, double y, const SharedNoiseModel& model):

View File

@ -53,7 +53,6 @@ class MagPoseFactor: public NoiseModelFactorN<POSE> {
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;
~MagPoseFactor() override {}
/// Default constructor - only use for serialization.

View File

@ -36,13 +36,13 @@ namespace gtsam {
/* ************************************************************************* */
/** These typedefs and aliases will help with making the evaluateError interface
* independent of boost
* TODO(kartikarcot): Change this to OptionalMatrixNone
* This typedef is used to indicate that the Jacobian is not required
* and the default value used for optional matrix pointer arguments in evaluateError.
* Had to use the static_cast of a nullptr, because the compiler is not able to
* deduce the type of the nullptr when expanding the evaluateError templates.
*/
* independent of boost
* TODO(kartikarcot): Change this to OptionalMatrixNone
* This typedef is used to indicate that the Jacobian is not required
* and the default value used for optional matrix pointer arguments in evaluateError.
* Had to use the static_cast of a nullptr, because the compiler is not able to
* deduce the type of the nullptr when expanding the evaluateError templates.
*/
#define OptionalNone static_cast<Matrix*>(nullptr)
/** This typedef will be used everywhere boost::optional<Matrix&> reference was used
@ -53,7 +53,8 @@ using OptionalMatrixType = Matrix*;
/** The OptionalMatrixVecType is a pointer to a vector of matrices. It will
* be used in situations where a vector of matrices is optional, like in
* unwhitenedError. */
* unwhitenedError.
*/
using OptionalMatrixVecType = std::vector<Matrix>*;
/**
@ -257,7 +258,8 @@ public:
* to get access to this version of the function from derived classes
* one will need to use the "using" keyword and specify that like this:
* public:
* using NoiseModelFactor::unwhitenedError; */
* using NoiseModelFactor::unwhitenedError;
*/
Vector unwhitenedError(const Values& x, std::vector<Matrix>& H) const {
return unwhitenedError(x, &H);
}
@ -613,12 +615,13 @@ protected:
virtual Vector evaluateError(const ValueTypes&... x,
OptionalMatrixTypeT<ValueTypes>... H) const = 0;
// If someone uses the evaluateError function by supplying all the optional
// arguments then redirect the call to the one which takes pointers
// to get access to this version of the function from derived classes
// one will need to use the "using" keyword and specify that like this:
// public:
// using NoiseModelFactorN<list the value types here>::evaluateError;
/** If all the optional arguments are matrices then redirect the call to
* the one which takes pointers.
* To get access to this version of the function from derived classes
* one will need to use the "using" keyword and specify that like this:
* public:
* using NoiseModelFactorN<list the value types here>::evaluateError;
*/
Vector evaluateError(const ValueTypes&... x, MatrixTypeT<ValueTypes>&... H) const {
return evaluateError(x..., (&H)...);

View File

@ -52,7 +52,7 @@ namespace gtsam {
public:
/// shorthand for base class type
typedef NoiseModelFactor2<POSE, LANDMARK> Base;
typedef NoiseModelFactorN<POSE, LANDMARK> Base;
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;

View File

@ -114,7 +114,6 @@ public:
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;
// shorthand for a smart pointer to a factor
typedef typename boost::shared_ptr<EquivInertialNavFactor_GlobalVel> shared_ptr;

View File

@ -112,7 +112,6 @@ public:
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;
// shorthand for a smart pointer to a factor
typedef typename boost::shared_ptr<EquivInertialNavFactor_GlobalVel_NoBias> shared_ptr;

View File

@ -57,7 +57,6 @@ public:
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;
// shorthand for a smart pointer to a factor
typedef typename boost::shared_ptr<GaussMarkov1stOrderFactor> shared_ptr;

View File

@ -99,7 +99,6 @@ public:
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;
// shorthand for a smart pointer to a factor
typedef typename boost::shared_ptr<InertialNavFactor_GlobalVelocity> shared_ptr;

View File

@ -39,7 +39,6 @@ public:
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;
/// shorthand for this class
typedef InvDepthFactor3<POSE, LANDMARK, INVDEPTH> This;

View File

@ -39,7 +39,6 @@ public:
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;
/// shorthand for this class
typedef InvDepthFactorVariant1 This;

View File

@ -41,7 +41,6 @@ public:
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;
/// shorthand for this class
typedef InvDepthFactorVariant2 This;

View File

@ -39,7 +39,6 @@ public:
// Provide access to the Matrix& version of evaluateError:
using Base::evaluateError;
/// shorthand for this class
typedef InvDepthFactorVariant3a This;

View File

@ -186,6 +186,9 @@ namespace gtsam {
}
/* ************************************************************************* */
/** A function overload to accept a vector<matrix> instead of a pointer to
* the said type.
*/
gtsam::Vector whitenedError(const gtsam::Values& x, std::vector<Matrix>& H) const {
return whitenedError(x, &H);
}

View File

@ -179,6 +179,9 @@ namespace gtsam {
/* ************************************************************************* */
/** A function overload to accept a vector<matrix> instead of a pointer to
* the said type.
*/
Vector whitenedError(const Values& x, OptionalMatrixVecType H = nullptr) const {
bool debug = true;