Add deprecations
parent
fa28bbb925
commit
7fbcdc4d2c
|
@ -85,7 +85,7 @@ bool assert_equal(const V& expected, const boost::optional<const V&>& actual, do
|
||||||
* \deprecated: use container equals instead
|
* \deprecated: use container equals instead
|
||||||
*/
|
*/
|
||||||
template<class V>
|
template<class V>
|
||||||
bool assert_equal(const std::vector<V>& expected, const std::vector<V>& actual, double tol = 1e-9) {
|
bool GTSAM_DEPRECATED assert_equal(const std::vector<V>& expected, const std::vector<V>& actual, double tol = 1e-9) {
|
||||||
bool match = true;
|
bool match = true;
|
||||||
if (expected.size() != actual.size())
|
if (expected.size() != actual.size())
|
||||||
match = false;
|
match = false;
|
||||||
|
|
|
@ -207,14 +207,14 @@ inline double inner_prod(const V1 &a, const V2& b) {
|
||||||
* BLAS Level 1 scal: x <- alpha*x
|
* BLAS Level 1 scal: x <- alpha*x
|
||||||
* \deprecated: use operators instead
|
* \deprecated: use operators instead
|
||||||
*/
|
*/
|
||||||
inline void scal(double alpha, Vector& x) { x *= alpha; }
|
inline void GTSAM_DEPRECATED scal(double alpha, Vector& x) { x *= alpha; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BLAS Level 1 axpy: y <- alpha*x + y
|
* BLAS Level 1 axpy: y <- alpha*x + y
|
||||||
* \deprecated: use operators instead
|
* \deprecated: use operators instead
|
||||||
*/
|
*/
|
||||||
template<class V1, class V2>
|
template<class V1, class V2>
|
||||||
inline void axpy(double alpha, const V1& x, V2& y) {
|
inline void GTSAM_DEPRECATED axpy(double alpha, const V1& x, V2& y) {
|
||||||
assert (y.size()==x.size());
|
assert (y.size()==x.size());
|
||||||
y += alpha * x;
|
y += alpha * x;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,14 @@
|
||||||
#include <tbb/scalable_allocator.h>
|
#include <tbb/scalable_allocator.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
|
#define GTSAM_DEPRECATED __attribute__((deprecated))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define GTSAM_DEPRECATED __declspec(deprecated)
|
||||||
|
#else
|
||||||
|
#define GTSAM_DEPRECATED
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef GTSAM_USE_EIGEN_MKL_OPENMP
|
#ifdef GTSAM_USE_EIGEN_MKL_OPENMP
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <gtsam/discrete/DecisionTree-inl.h>
|
#include <gtsam/discrete/DecisionTree-inl.h>
|
||||||
|
#include <gtsam/dllexport.h>
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@ namespace gtsam {
|
||||||
* TODO: consider eliminating this class altogether?
|
* TODO: consider eliminating this class altogether?
|
||||||
*/
|
*/
|
||||||
template<typename L>
|
template<typename L>
|
||||||
class AlgebraicDecisionTree: public DecisionTree<L, double> {
|
class GTSAM_EXPORT AlgebraicDecisionTree: public DecisionTree<L, double> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace gtsam {
|
||||||
// Leaf
|
// Leaf
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
template<typename L, typename Y>
|
template<typename L, typename Y>
|
||||||
class DecisionTree<L, Y>::Leaf: public DecisionTree<L, Y>::Node {
|
class GTSAM_EXPORT DecisionTree<L, Y>::Leaf: public DecisionTree<L, Y>::Node {
|
||||||
|
|
||||||
/** constant stored in this leaf */
|
/** constant stored in this leaf */
|
||||||
Y constant_;
|
Y constant_;
|
||||||
|
@ -139,7 +139,7 @@ namespace gtsam {
|
||||||
// Choice
|
// Choice
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
template<typename L, typename Y>
|
template<typename L, typename Y>
|
||||||
class DecisionTree<L, Y>::Choice: public DecisionTree<L, Y>::Node {
|
class GTSAM_EXPORT DecisionTree<L, Y>::Choice: public DecisionTree<L, Y>::Node {
|
||||||
|
|
||||||
/** the label of the variable on which we split */
|
/** the label of the variable on which we split */
|
||||||
L label_;
|
L label_;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <gtsam/discrete/Assignment.h>
|
#include <gtsam/discrete/Assignment.h>
|
||||||
|
#include <gtsam/dllexport.h>
|
||||||
|
|
||||||
#include <boost/function.hpp>
|
#include <boost/function.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
@ -35,7 +36,7 @@ namespace gtsam {
|
||||||
* Y = function range (any algebra), e.g., bool, int, double
|
* Y = function range (any algebra), e.g., bool, int, double
|
||||||
*/
|
*/
|
||||||
template<typename L, typename Y>
|
template<typename L, typename Y>
|
||||||
class DecisionTree {
|
class GTSAM_EXPORT DecisionTree {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -47,11 +48,11 @@ namespace gtsam {
|
||||||
typedef std::pair<L,size_t> LabelC;
|
typedef std::pair<L,size_t> LabelC;
|
||||||
|
|
||||||
/** DTs consist of Leaf and Choice nodes, both subclasses of Node */
|
/** DTs consist of Leaf and Choice nodes, both subclasses of Node */
|
||||||
class Leaf;
|
class GTSAM_EXPORT Leaf;
|
||||||
class Choice;
|
class GTSAM_EXPORT Choice;
|
||||||
|
|
||||||
/** ------------------------ Node base class --------------------------- */
|
/** ------------------------ Node base class --------------------------- */
|
||||||
class Node {
|
class GTSAM_EXPORT Node {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<const Node> Ptr;
|
typedef boost::shared_ptr<const Node> Ptr;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ using namespace std;
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
// Instantiate base class
|
// Instantiate base class
|
||||||
template class Conditional<DecisionTreeFactor, DiscreteConditional> ;
|
template class GTSAM_EXPORT Conditional<DecisionTreeFactor, DiscreteConditional> ;
|
||||||
|
|
||||||
/* ******************************************************************************** */
|
/* ******************************************************************************** */
|
||||||
DiscreteConditional::DiscreteConditional(const size_t nrFrontals,
|
DiscreteConditional::DiscreteConditional(const size_t nrFrontals,
|
||||||
|
@ -91,7 +91,7 @@ bool DiscreteConditional::equals(const DiscreteFactor& other,
|
||||||
return false;
|
return false;
|
||||||
else {
|
else {
|
||||||
const DecisionTreeFactor& f(
|
const DecisionTreeFactor& f(
|
||||||
static_cast<const DecisionTreeFactor&>(other));
|
dynamic_cast<const DecisionTreeFactor&>(other));
|
||||||
return DecisionTreeFactor::equals(f, tol);
|
return DecisionTreeFactor::equals(f, tol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,8 @@ using namespace std;
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
// explicit instantiation
|
// explicit instantiation
|
||||||
template class DecisionTree<Key, double>;
|
//template class GTSAM_EXPORT DecisionTree<Key, double>;
|
||||||
template class AlgebraicDecisionTree<Key>;
|
//template class GTSAM_EXPORT AlgebraicDecisionTree<Key>;
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
double Potentials::safe_div(const double& a, const double& b) {
|
double Potentials::safe_div(const double& a, const double& b) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace gtsam {
|
||||||
/**
|
/**
|
||||||
* A base class for both DiscreteFactor and DiscreteConditional
|
* A base class for both DiscreteFactor and DiscreteConditional
|
||||||
*/
|
*/
|
||||||
class Potentials: public AlgebraicDecisionTree<Key> {
|
class GTSAM_EXPORT Potentials: public AlgebraicDecisionTree<Key> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <boost/range.hpp>
|
#include <boost/range.hpp>
|
||||||
|
|
||||||
#include <gtsam/inference/Key.h>
|
#include <gtsam/inference/Key.h>
|
||||||
|
#include <gtsam/dllexport.h>
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ namespace gtsam {
|
||||||
* \nosubgrouping
|
* \nosubgrouping
|
||||||
*/
|
*/
|
||||||
template<class FACTOR, class DERIVEDCONDITIONAL>
|
template<class FACTOR, class DERIVEDCONDITIONAL>
|
||||||
class Conditional
|
class GTSAM_EXPORT Conditional
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
/** The first nrFrontal variables are frontal and the rest are parents. */
|
/** The first nrFrontal variables are frontal and the rest are parents. */
|
||||||
|
|
|
@ -290,7 +290,7 @@ namespace gtsam {
|
||||||
public:
|
public:
|
||||||
#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V41
|
#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V41
|
||||||
/** \deprecated ordering and orderingType shouldn't both be specified */
|
/** \deprecated ordering and orderingType shouldn't both be specified */
|
||||||
boost::shared_ptr<BayesNetType> eliminateSequential(
|
boost::shared_ptr<BayesNetType> GTSAM_DEPRECATED eliminateSequential(
|
||||||
const Ordering& ordering,
|
const Ordering& ordering,
|
||||||
const Eliminate& function,
|
const Eliminate& function,
|
||||||
OptionalVariableIndex variableIndex,
|
OptionalVariableIndex variableIndex,
|
||||||
|
@ -299,7 +299,7 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \deprecated orderingType specified first for consistency */
|
/** \deprecated orderingType specified first for consistency */
|
||||||
boost::shared_ptr<BayesNetType> eliminateSequential(
|
boost::shared_ptr<BayesNetType> GTSAM_DEPRECATED eliminateSequential(
|
||||||
const Eliminate& function,
|
const Eliminate& function,
|
||||||
OptionalVariableIndex variableIndex = boost::none,
|
OptionalVariableIndex variableIndex = boost::none,
|
||||||
OptionalOrderingType orderingType = boost::none) const {
|
OptionalOrderingType orderingType = boost::none) const {
|
||||||
|
@ -307,7 +307,7 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \deprecated ordering and orderingType shouldn't both be specified */
|
/** \deprecated ordering and orderingType shouldn't both be specified */
|
||||||
boost::shared_ptr<BayesTreeType> eliminateMultifrontal(
|
boost::shared_ptr<BayesTreeType> GTSAM_DEPRECATED eliminateMultifrontal(
|
||||||
const Ordering& ordering,
|
const Ordering& ordering,
|
||||||
const Eliminate& function,
|
const Eliminate& function,
|
||||||
OptionalVariableIndex variableIndex,
|
OptionalVariableIndex variableIndex,
|
||||||
|
@ -316,7 +316,7 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \deprecated orderingType specified first for consistency */
|
/** \deprecated orderingType specified first for consistency */
|
||||||
boost::shared_ptr<BayesTreeType> eliminateMultifrontal(
|
boost::shared_ptr<BayesTreeType> GTSAM_DEPRECATED eliminateMultifrontal(
|
||||||
const Eliminate& function,
|
const Eliminate& function,
|
||||||
OptionalVariableIndex variableIndex = boost::none,
|
OptionalVariableIndex variableIndex = boost::none,
|
||||||
OptionalOrderingType orderingType = boost::none) const {
|
OptionalOrderingType orderingType = boost::none) const {
|
||||||
|
@ -324,7 +324,7 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \deprecated */
|
/** \deprecated */
|
||||||
boost::shared_ptr<BayesNetType> marginalMultifrontalBayesNet(
|
boost::shared_ptr<BayesNetType> GTSAM_DEPRECATED marginalMultifrontalBayesNet(
|
||||||
boost::variant<const Ordering&, const KeyVector&> variables,
|
boost::variant<const Ordering&, const KeyVector&> variables,
|
||||||
boost::none_t,
|
boost::none_t,
|
||||||
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
|
@ -333,7 +333,7 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \deprecated */
|
/** \deprecated */
|
||||||
boost::shared_ptr<BayesTreeType> marginalMultifrontalBayesTree(
|
boost::shared_ptr<BayesTreeType> GTSAM_DEPRECATED marginalMultifrontalBayesTree(
|
||||||
boost::variant<const Ordering&, const KeyVector&> variables,
|
boost::variant<const Ordering&, const KeyVector&> variables,
|
||||||
boost::none_t,
|
boost::none_t,
|
||||||
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
const Eliminate& function = EliminationTraitsType::DefaultEliminate,
|
||||||
|
|
|
@ -90,7 +90,7 @@ class CRefCallAddCopy {
|
||||||
* \nosubgrouping
|
* \nosubgrouping
|
||||||
*/
|
*/
|
||||||
template <class FACTOR>
|
template <class FACTOR>
|
||||||
class FactorGraph {
|
class GTSAM_EXPORT FactorGraph {
|
||||||
public:
|
public:
|
||||||
typedef FACTOR FactorType; ///< factor type
|
typedef FACTOR FactorType; ///< factor type
|
||||||
typedef boost::shared_ptr<FACTOR>
|
typedef boost::shared_ptr<FACTOR>
|
||||||
|
|
|
@ -305,7 +305,7 @@ struct traits<ExpressionFactorN<T, Args...>>
|
||||||
* \deprecated Prefer the more general ExpressionFactorN<>.
|
* \deprecated Prefer the more general ExpressionFactorN<>.
|
||||||
*/
|
*/
|
||||||
template <typename T, typename A1, typename A2>
|
template <typename T, typename A1, typename A2>
|
||||||
class ExpressionFactor2 : public ExpressionFactorN<T, A1, A2> {
|
class GTSAM_DEPRECATED ExpressionFactor2 : public ExpressionFactorN<T, A1, A2> {
|
||||||
public:
|
public:
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~ExpressionFactor2() override {}
|
~ExpressionFactor2() override {}
|
||||||
|
|
|
@ -133,15 +133,15 @@ protected:
|
||||||
public:
|
public:
|
||||||
#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V41
|
#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V41
|
||||||
/** \deprecated argument order changed due to removing boost::optional<Ordering> */
|
/** \deprecated argument order changed due to removing boost::optional<Ordering> */
|
||||||
Marginals(const NonlinearFactorGraph& graph, const Values& solution, Factorization factorization,
|
GTSAM_DEPRECATED Marginals(const NonlinearFactorGraph& graph, const Values& solution, Factorization factorization,
|
||||||
const Ordering& ordering) : Marginals(graph, solution, ordering, factorization) {}
|
const Ordering& ordering) : Marginals(graph, solution, ordering, factorization) {}
|
||||||
|
|
||||||
/** \deprecated argument order changed due to removing boost::optional<Ordering> */
|
/** \deprecated argument order changed due to removing boost::optional<Ordering> */
|
||||||
Marginals(const GaussianFactorGraph& graph, const Values& solution, Factorization factorization,
|
GTSAM_DEPRECATED Marginals(const GaussianFactorGraph& graph, const Values& solution, Factorization factorization,
|
||||||
const Ordering& ordering) : Marginals(graph, solution, ordering, factorization) {}
|
const Ordering& ordering) : Marginals(graph, solution, ordering, factorization) {}
|
||||||
|
|
||||||
/** \deprecated argument order changed due to removing boost::optional<Ordering> */
|
/** \deprecated argument order changed due to removing boost::optional<Ordering> */
|
||||||
Marginals(const GaussianFactorGraph& graph, const VectorValues& solution, Factorization factorization,
|
GTSAM_DEPRECATED Marginals(const GaussianFactorGraph& graph, const VectorValues& solution, Factorization factorization,
|
||||||
const Ordering& ordering) : Marginals(graph, solution, ordering, factorization) {}
|
const Ordering& ordering) : Marginals(graph, solution, ordering, factorization) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -267,12 +267,12 @@ namespace gtsam {
|
||||||
|
|
||||||
#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V41
|
#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V41
|
||||||
/** \deprecated */
|
/** \deprecated */
|
||||||
boost::shared_ptr<HessianFactor> linearizeToHessianFactor(
|
boost::shared_ptr<HessianFactor> GTSAM_DEPRECATED linearizeToHessianFactor(
|
||||||
const Values& values, boost::none_t, const Dampen& dampen = nullptr) const
|
const Values& values, boost::none_t, const Dampen& dampen = nullptr) const
|
||||||
{return linearizeToHessianFactor(values, dampen);}
|
{return linearizeToHessianFactor(values, dampen);}
|
||||||
|
|
||||||
/** \deprecated */
|
/** \deprecated */
|
||||||
Values updateCholesky(const Values& values, boost::none_t,
|
Values GTSAM_DEPRECATED updateCholesky(const Values& values, boost::none_t,
|
||||||
const Dampen& dampen = nullptr) const
|
const Dampen& dampen = nullptr) const
|
||||||
{return updateCholesky(values, dampen);}
|
{return updateCholesky(values, dampen);}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue