Remove more redundant virtual destructors

release/4.3a0
Frank Dellaert 2023-02-11 22:46:16 -08:00
parent 87cfb25635
commit 598582087f
6 changed files with 23 additions and 24 deletions

View File

@ -59,17 +59,12 @@ public:
/// @name Advanced Constructors
/// @{
explicit PinholeBaseK(const Vector &v) :
PinholeBase(v) {
}
explicit PinholeBaseK(const Vector& v) : PinholeBase(v) {}
/// @}
/// @name Standard Interface
/// @{
virtual ~PinholeBaseK() override {
}
/// return calibration
virtual const CALIBRATION& calibration() const = 0;

View File

@ -42,6 +42,9 @@ namespace gtsam {
typedef std::shared_ptr<This> shared_ptr; ///< shared_ptr to this class
typedef Factor Base; ///< Our base class
/// @name Standard Constructors
/// @{
/** Default constructor creates empty factor */
GaussianFactor() {}
@ -50,19 +53,22 @@ namespace gtsam {
template<typename CONTAINER>
GaussianFactor(const CONTAINER& keys) : Base(keys) {}
/** Destructor */
virtual ~GaussianFactor() override {}
/// @}
/// @name Testable
/// @{
// Implementing Testable interface
/// print
/// print with optional string
void print(
const std::string& s = "",
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;
/// @}
/// @name Standard Interface
/// @{
/**
* In Gaussian factors, the error function returns either the negative log-likelihood, e.g.,
* 0.5*(A*x-b)'*D*(A*x-b)
@ -144,6 +150,10 @@ namespace gtsam {
virtual void updateHessian(const KeyVector& keys,
SymmetricBlockMatrix* info) const = 0;
/// @}
/// @name Operator interface
/// @{
/// y += alpha * A'*A*x
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
virtual Vector gradient(Key key, const VectorValues& x) const = 0;
/// @}
/// @name Advanced Interface
/// @{
// Determine position of a given key
template <typename CONTAINER>
static DenseIndex Slot(const CONTAINER& keys, Key key) {
return std::find(keys.begin(), keys.end(), key) - keys.begin();
}
/// @}
private:
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
/** Serialization function */
@ -171,7 +187,6 @@ namespace gtsam {
ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
}
#endif
}; // GaussianFactor
/// traits

View File

@ -107,9 +107,6 @@ namespace gtsam {
template<class DERIVEDFACTOR>
GaussianFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
/** Virtual destructor */
virtual ~GaussianFactorGraph() override {}
/// @}
/// @name Testable
/// @{

View File

@ -105,9 +105,6 @@ public:
/// @name Standard Interface
/// @{
/** Destructor */
virtual ~NonlinearFactor() override {}
/**
* In nonlinear factors, the error function returns the negative log-likelihood
* as a non-linear function of the values in a \class Values object.

View File

@ -78,9 +78,6 @@ namespace gtsam {
template<class DERIVEDFACTOR>
NonlinearFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
/// Destructor
virtual ~NonlinearFactorGraph() override {}
/// @}
/// @name Testable
/// @{

View File

@ -79,8 +79,6 @@ namespace gtsam {
/** Create symbolic version of any factor */
explicit SymbolicFactor(const Factor& factor) : Base(factor.keys()) {}
virtual ~SymbolicFactor() override {}
/// Copy this object as its actual derived type.
SymbolicFactor::shared_ptr clone() const { return std::make_shared<This>(*this); }