Remove more redundant virtual destructors
parent
87cfb25635
commit
598582087f
|
@ -59,17 +59,12 @@ public:
|
||||||
/// @name Advanced Constructors
|
/// @name Advanced Constructors
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
explicit PinholeBaseK(const Vector &v) :
|
explicit PinholeBaseK(const Vector& v) : PinholeBase(v) {}
|
||||||
PinholeBase(v) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Standard Interface
|
/// @name Standard Interface
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
virtual ~PinholeBaseK() override {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// return calibration
|
/// return calibration
|
||||||
virtual const CALIBRATION& calibration() const = 0;
|
virtual const CALIBRATION& calibration() const = 0;
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,9 @@ namespace gtsam {
|
||||||
typedef std::shared_ptr<This> shared_ptr; ///< shared_ptr to this class
|
typedef std::shared_ptr<This> shared_ptr; ///< shared_ptr to this class
|
||||||
typedef Factor Base; ///< Our base class
|
typedef Factor Base; ///< Our base class
|
||||||
|
|
||||||
|
/// @name Standard Constructors
|
||||||
|
/// @{
|
||||||
|
|
||||||
/** Default constructor creates empty factor */
|
/** Default constructor creates empty factor */
|
||||||
GaussianFactor() {}
|
GaussianFactor() {}
|
||||||
|
|
||||||
|
@ -50,19 +53,22 @@ namespace gtsam {
|
||||||
template<typename CONTAINER>
|
template<typename CONTAINER>
|
||||||
GaussianFactor(const CONTAINER& keys) : Base(keys) {}
|
GaussianFactor(const CONTAINER& keys) : Base(keys) {}
|
||||||
|
|
||||||
/** Destructor */
|
/// @}
|
||||||
virtual ~GaussianFactor() override {}
|
/// @name Testable
|
||||||
|
/// @{
|
||||||
|
|
||||||
// Implementing Testable interface
|
/// print with optional string
|
||||||
|
|
||||||
/// print
|
|
||||||
void print(
|
void print(
|
||||||
const std::string& s = "",
|
const std::string& s = "",
|
||||||
const KeyFormatter& formatter = DefaultKeyFormatter) const override = 0;
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override = 0;
|
||||||
|
|
||||||
/** Equals for testable */
|
/// assert equality up to a tolerance
|
||||||
virtual bool equals(const GaussianFactor& lf, double tol = 1e-9) const = 0;
|
virtual bool equals(const GaussianFactor& lf, double tol = 1e-9) const = 0;
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
/// @name Standard Interface
|
||||||
|
/// @{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In Gaussian factors, the error function returns either the negative log-likelihood, e.g.,
|
* In Gaussian factors, the error function returns either the negative log-likelihood, e.g.,
|
||||||
* 0.5*(A*x-b)'*D*(A*x-b)
|
* 0.5*(A*x-b)'*D*(A*x-b)
|
||||||
|
@ -144,6 +150,10 @@ namespace gtsam {
|
||||||
virtual void updateHessian(const KeyVector& keys,
|
virtual void updateHessian(const KeyVector& keys,
|
||||||
SymmetricBlockMatrix* info) const = 0;
|
SymmetricBlockMatrix* info) const = 0;
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
/// @name Operator interface
|
||||||
|
/// @{
|
||||||
|
|
||||||
/// y += alpha * A'*A*x
|
/// y += alpha * A'*A*x
|
||||||
virtual void multiplyHessianAdd(double alpha, const VectorValues& x, VectorValues& y) const = 0;
|
virtual void multiplyHessianAdd(double alpha, const VectorValues& x, VectorValues& y) const = 0;
|
||||||
|
|
||||||
|
@ -156,12 +166,18 @@ namespace gtsam {
|
||||||
/// Gradient wrt a key at any values
|
/// Gradient wrt a key at any values
|
||||||
virtual Vector gradient(Key key, const VectorValues& x) const = 0;
|
virtual Vector gradient(Key key, const VectorValues& x) const = 0;
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
/// @name Advanced Interface
|
||||||
|
/// @{
|
||||||
|
|
||||||
// Determine position of a given key
|
// Determine position of a given key
|
||||||
template <typename CONTAINER>
|
template <typename CONTAINER>
|
||||||
static DenseIndex Slot(const CONTAINER& keys, Key key) {
|
static DenseIndex Slot(const CONTAINER& keys, Key key) {
|
||||||
return std::find(keys.begin(), keys.end(), key) - keys.begin();
|
return std::find(keys.begin(), keys.end(), key) - keys.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
|
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
|
||||||
/** Serialization function */
|
/** Serialization function */
|
||||||
|
@ -171,7 +187,6 @@ namespace gtsam {
|
||||||
ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
|
ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}; // GaussianFactor
|
}; // GaussianFactor
|
||||||
|
|
||||||
/// traits
|
/// traits
|
||||||
|
|
|
@ -107,9 +107,6 @@ namespace gtsam {
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
GaussianFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
GaussianFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||||
|
|
||||||
/** Virtual destructor */
|
|
||||||
virtual ~GaussianFactorGraph() override {}
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
|
@ -105,9 +105,6 @@ public:
|
||||||
/// @name Standard Interface
|
/// @name Standard Interface
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/** Destructor */
|
|
||||||
virtual ~NonlinearFactor() override {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In nonlinear factors, the error function returns the negative log-likelihood
|
* In nonlinear factors, the error function returns the negative log-likelihood
|
||||||
* as a non-linear function of the values in a \class Values object.
|
* as a non-linear function of the values in a \class Values object.
|
||||||
|
|
|
@ -78,9 +78,6 @@ namespace gtsam {
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
NonlinearFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
NonlinearFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||||
|
|
||||||
/// Destructor
|
|
||||||
virtual ~NonlinearFactorGraph() override {}
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
|
@ -79,8 +79,6 @@ namespace gtsam {
|
||||||
/** Create symbolic version of any factor */
|
/** Create symbolic version of any factor */
|
||||||
explicit SymbolicFactor(const Factor& factor) : Base(factor.keys()) {}
|
explicit SymbolicFactor(const Factor& factor) : Base(factor.keys()) {}
|
||||||
|
|
||||||
virtual ~SymbolicFactor() override {}
|
|
||||||
|
|
||||||
/// Copy this object as its actual derived type.
|
/// Copy this object as its actual derived type.
|
||||||
SymbolicFactor::shared_ptr clone() const { return std::make_shared<This>(*this); }
|
SymbolicFactor::shared_ptr clone() const { return std::make_shared<This>(*this); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue