From 6a957d059b0d649e985f1b012e9220627a13b635 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sat, 17 Mar 2012 23:57:39 +0000 Subject: [PATCH] Fixed warnings about mixing class and struct --- gtsam/inference/tests/testEliminationTree.cpp | 3 ++- gtsam/linear/GaussianFactorGraph.h | 2 +- gtsam/linear/HessianFactor.h | 2 +- gtsam/linear/NoiseModel.h | 2 +- gtsam/linear/SharedDiagonal.h | 3 ++- gtsam/linear/SharedGaussian.h | 3 ++- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gtsam/inference/tests/testEliminationTree.cpp b/gtsam/inference/tests/testEliminationTree.cpp index b1efc26c8..0ec8b2266 100644 --- a/gtsam/inference/tests/testEliminationTree.cpp +++ b/gtsam/inference/tests/testEliminationTree.cpp @@ -25,7 +25,8 @@ using namespace gtsam; using namespace std; -struct EliminationTreeTester { +class EliminationTreeTester { +public: // build hardcoded tree static SymbolicEliminationTree::shared_ptr buildHardcodedTree(const SymbolicFactorGraph& fg) { diff --git a/gtsam/linear/GaussianFactorGraph.h b/gtsam/linear/GaussianFactorGraph.h index f48f7f13f..822c8f62a 100644 --- a/gtsam/linear/GaussianFactorGraph.h +++ b/gtsam/linear/GaussianFactorGraph.h @@ -31,7 +31,7 @@ namespace gtsam { - struct SharedDiagonal; + class SharedDiagonal; /** return A*x-b * \todo Make this a member function - affects SubgraphPreconditioner */ diff --git a/gtsam/linear/HessianFactor.h b/gtsam/linear/HessianFactor.h index c1e5f016a..7cba0c744 100644 --- a/gtsam/linear/HessianFactor.h +++ b/gtsam/linear/HessianFactor.h @@ -33,7 +33,7 @@ namespace gtsam { // Forward declarations class JacobianFactor; - struct SharedDiagonal; + class SharedDiagonal; class GaussianConditional; template class BayesNet; diff --git a/gtsam/linear/NoiseModel.h b/gtsam/linear/NoiseModel.h index ee5d9e00c..b6cf4deac 100644 --- a/gtsam/linear/NoiseModel.h +++ b/gtsam/linear/NoiseModel.h @@ -23,7 +23,7 @@ namespace gtsam { - struct SharedDiagonal; // forward declare + class SharedDiagonal; // forward declare /// All noise models live in the noiseModel namespace namespace noiseModel { diff --git a/gtsam/linear/SharedDiagonal.h b/gtsam/linear/SharedDiagonal.h index b839cca1a..8a7e101a2 100644 --- a/gtsam/linear/SharedDiagonal.h +++ b/gtsam/linear/SharedDiagonal.h @@ -25,7 +25,8 @@ namespace gtsam { // note, deliberately not in noiseModel namespace // A useful convenience class to refer to a shared Diagonal model // There are (somewhat dangerous) constructors from Vector and pair // that call Sigmas and Sigma, respectively. - struct SharedDiagonal: public noiseModel::Diagonal::shared_ptr { + class SharedDiagonal: public noiseModel::Diagonal::shared_ptr { + public: SharedDiagonal() { } SharedDiagonal(const noiseModel::Diagonal::shared_ptr& p) : diff --git a/gtsam/linear/SharedGaussian.h b/gtsam/linear/SharedGaussian.h index 4748efd04..a3154bac1 100644 --- a/gtsam/linear/SharedGaussian.h +++ b/gtsam/linear/SharedGaussian.h @@ -27,7 +27,8 @@ namespace gtsam { // note, deliberately not in noiseModel namespace * A useful convenience class to refer to a shared Gaussian model * Also needed to make noise models in matlab */ - struct SharedGaussian: public SharedNoiseModel { + class SharedGaussian: public SharedNoiseModel { + public: typedef SharedNoiseModel Base;