remove virtual from overridden methods, add virtual destructors to appease compiler

release/4.3a0
Varun Agrawal 2021-04-30 12:58:52 -04:00
parent 4d6eef2c2f
commit 6c3aca8cac
17 changed files with 54 additions and 23 deletions

View File

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

View File

@ -78,7 +78,7 @@ public:
virtual bool equals(const DiscreteFactor& lf, double tol = 1e-9) const = 0;
/// print
virtual void print(
void print(
const std::string& s = "DiscreteFactor\n",
const KeyFormatter& formatter = DefaultKeyFormatter) const override {
Base::print(s, formatter);

View File

@ -91,6 +91,9 @@ public:
template<class DERIVEDFACTOR>
DiscreteFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
/// Destructor
virtual ~DiscreteFactorGraph() {}
/// @name Testable
/// @{

View File

@ -55,6 +55,9 @@ namespace gtsam {
template<class DERIVEDCONDITIONAL>
GaussianBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph) : Base(graph) {}
/// Destructor
virtual ~GaussianBayesNet() {}
/// @}
/// @name Testable
@ -178,7 +181,7 @@ namespace gtsam {
VectorValues backSubstituteTranspose(const VectorValues& gx) const;
/// print graph
virtual void print(
void print(
const std::string& s = "",
const KeyFormatter& formatter = DefaultKeyFormatter) const override {
Base::print(s, formatter);

View File

@ -56,7 +56,7 @@ namespace gtsam {
// Implementing Testable interface
/// print
virtual void print(
void print(
const std::string& s = "",
const KeyFormatter& formatter = DefaultKeyFormatter) const override = 0;

View File

@ -44,9 +44,9 @@ struct GTSAM_EXPORT PreconditionerParameters {
inline Kernel kernel() const { return kernel_; }
inline Verbosity verbosity() const { return verbosity_; }
void print() const ;
void print() const;
virtual void print(std::ostream &os) const ;
virtual void print(std::ostream &os) const;
static Kernel kernelTranslator(const std::string &s);
static Verbosity verbosityTranslator(const std::string &s);

View File

@ -70,9 +70,8 @@ public:
/// @{
/** print */
virtual void print(
const std::string& s = "",
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
DefaultKeyFormatter) const override;
/** Check if two factors are equal */
virtual bool equals(const NonlinearFactor& f, double tol = 1e-9) const;

View File

@ -98,6 +98,9 @@ namespace gtsam {
template<class DERIVEDFACTOR>
NonlinearFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
/// Destructor
virtual ~NonlinearFactorGraph() {}
/** print */
void print(
const std::string& str = "NonlinearFactorGraph: ",

View File

@ -52,6 +52,9 @@ private:
measured_(measured),
noiseModel_(model) {}
/// Destructor
virtual ~BinaryMeasurement() {}
/// @name Standard Interface
/// @{

View File

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

View File

@ -105,7 +105,7 @@ namespace gtsam {
/// @name Testable
/** Print with optional formatter */
virtual void print(
void print(
const std::string& str = "",
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;

View File

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

View File

@ -178,8 +178,7 @@ namespace gtsam {
} // buildGraph
/** print */
void Scheduler::print(const string& s) const {
void Scheduler::print(const string& s, const KeyFormatter& formatter) const {
cout << s << " Faculty:" << endl;
for(const string& name: facultyName_)
cout << name << '\n';
@ -210,7 +209,7 @@ namespace gtsam {
CSP::print(s + " Factor graph");
cout << endl;
} // print
} // print
/** Print readable form of assignment */
void Scheduler::printAssignment(sharedValues assignment) const {

View File

@ -66,15 +66,17 @@ namespace gtsam {
/**
* Constructor
* WE need to know the number of students in advance for ordering keys.
* We need to know the number of students in advance for ordering keys.
* then add faculty, slots, areas, availability, students, in that order
*/
Scheduler(size_t maxNrStudents):maxNrStudents_(maxNrStudents) {
}
Scheduler(size_t maxNrStudents) : maxNrStudents_(maxNrStudents) {}
void addFaculty(const std::string& facultyName) {
facultyIndex_[facultyName] = nrFaculty();
facultyName_.push_back(facultyName);
/// Destructor
virtual ~Scheduler() {}
void addFaculty(const std::string& facultyName) {
facultyIndex_[facultyName] = nrFaculty();
facultyName_.push_back(facultyName);
}
size_t nrFaculty() const {
@ -140,7 +142,9 @@ namespace gtsam {
void buildGraph(size_t mutexBound = 7);
/** print */
void print(const std::string& s = "Scheduler") const;
void print(
const std::string& s = "Scheduler",
const KeyFormatter& formatter = DefaultKeyFormatter) const override;
/** Print readable form of assignment */
void printAssignment(sharedValues assignment) const;

View File

@ -47,7 +47,9 @@ public:
virtual ~ConcurrentFilter() {};
/** Implement a standard 'print' function */
virtual void print(const std::string& s = "Concurrent Filter:\n", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
virtual void print(
const std::string& s = "Concurrent Filter:\n",
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
/** Check if two Concurrent Smoothers are equal */
virtual bool equals(const ConcurrentFilter& rhs, double tol = 1e-9) const = 0;
@ -107,7 +109,9 @@ public:
virtual ~ConcurrentSmoother() {};
/** Implement a standard 'print' function */
virtual void print(const std::string& s = "Concurrent Smoother:\n", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
virtual void print(
const std::string& s = "Concurrent Smoother:\n",
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
/** Check if two Concurrent Smoothers are equal */
virtual bool equals(const ConcurrentSmoother& rhs, double tol = 1e-9) const = 0;

View File

@ -69,7 +69,9 @@ public:
virtual ~FixedLagSmoother() { }
/** Print the factor for debugging and testing (implementing Testable) */
virtual void print(const std::string& s = "FixedLagSmoother:\n", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
virtual void print(
const std::string& s = "FixedLagSmoother:\n",
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
/** Check if two IncrementalFixedLagSmoother Objects are equal */
virtual bool equals(const FixedLagSmoother& rhs, double tol = 1e-9) const;

View File

@ -132,7 +132,9 @@ public:
/** implement functions needed for Testable */
/** print */
virtual void print(const std::string& s = "EquivInertialNavFactor_GlobalVel_NoBias", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
virtual void print(
const std::string& s = "EquivInertialNavFactor_GlobalVel_NoBias",
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
std::cout << s << "("
<< keyFormatter(this->key1()) << ","
<< keyFormatter(this->key2()) << ","