Skip to content

Commit ab92779

Browse files
authored
Merge pull request #762 from borglab/feature/wrapper-interface-updates
2 parents d8f279b + f74453c commit ab92779

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

gtsam/gtsam.i

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
namespace gtsam {
1212

13-
// Actually a FastList<Key>
1413
#include <gtsam/inference/Key.h>
1514

1615
const KeyFormatter DefaultKeyFormatter;
1716

17+
// Actually a FastList<Key>
1818
class KeyList {
1919
KeyList();
2020
KeyList(const gtsam::KeyList& other);
@@ -1284,31 +1284,26 @@ class SymbolicBayesTree {
12841284
gtsam::SymbolicBayesNet* jointBayesNet(size_t key1, size_t key2) const;
12851285
};
12861286

1287-
// class SymbolicBayesTreeClique {
1288-
// SymbolicBayesTreeClique();
1289-
// SymbolicBayesTreeClique(CONDITIONAL* conditional);
1290-
// SymbolicBayesTreeClique(const pair<typename ConditionalType::shared_ptr, typename ConditionalType::FactorType::shared_ptr>& result) : Base(result) {}
1291-
//
1292-
// bool equals(const This& other, double tol) const;
1293-
// void print(string s = "",
1294-
// const gtsam::KeyFormatter& keyFormatter = gtsam::DefaultKeyFormatter) const;
1295-
// void printTree() const; // Default indent of ""
1296-
// void printTree(string indent) const;
1297-
// size_t numCachedSeparatorMarginals() const;
1298-
//
1299-
// CONDITIONAL* conditional() const;
1300-
// bool isRoot() const;
1301-
// size_t treeSize() const;
1302-
// const std::list<derived_ptr>& children() const { return children_; }
1303-
// derived_ptr parent() const { return parent_.lock(); }
1304-
//
1287+
class SymbolicBayesTreeClique {
1288+
SymbolicBayesTreeClique();
1289+
// SymbolicBayesTreeClique(gtsam::sharedConditional* conditional);
1290+
1291+
bool equals(const gtsam::SymbolicBayesTreeClique& other, double tol) const;
1292+
void print(string s = "",
1293+
const gtsam::KeyFormatter& keyFormatter = gtsam::DefaultKeyFormatter) const;
1294+
size_t numCachedSeparatorMarginals() const;
1295+
// gtsam::sharedConditional* conditional() const;
1296+
bool isRoot() const;
1297+
size_t treeSize() const;
1298+
gtsam::SymbolicBayesTreeClique* parent() const;
1299+
13051300
// // TODO: need wrapped versions graphs, BayesNet
13061301
// BayesNet<ConditionalType> shortcut(derived_ptr root, Eliminate function) const;
13071302
// FactorGraph<FactorType> marginal(derived_ptr root, Eliminate function) const;
13081303
// FactorGraph<FactorType> joint(derived_ptr C2, derived_ptr root, Eliminate function) const;
13091304
//
1310-
// void deleteCachedShortcuts();
1311-
// };
1305+
void deleteCachedShortcuts();
1306+
};
13121307

13131308
#include <gtsam/inference/VariableIndex.h>
13141309
class VariableIndex {
@@ -1554,7 +1549,7 @@ class Sampler {
15541549

15551550
#include <gtsam/linear/VectorValues.h>
15561551
class VectorValues {
1557-
//Constructors
1552+
//Constructors
15581553
VectorValues();
15591554
VectorValues(const gtsam::VectorValues& other);
15601555

@@ -2160,7 +2155,7 @@ virtual class NonlinearFactor {
21602155
bool active(const gtsam::Values& c) const;
21612156
gtsam::GaussianFactor* linearize(const gtsam::Values& c) const;
21622157
gtsam::NonlinearFactor* clone() const;
2163-
// gtsam::NonlinearFactor* rekey(const gtsam::KeyVector& newKeys) const; //TODO: Conversion from KeyVector to std::vector does not happen
2158+
gtsam::NonlinearFactor* rekey(const gtsam::KeyVector& newKeys) const;
21642159
};
21652160

21662161
#include <gtsam/nonlinear/NonlinearFactor.h>
@@ -2778,11 +2773,17 @@ virtual class GeneralSFMFactor2 : gtsam::NoiseModelFactor {
27782773
};
27792774

27802775
#include <gtsam/slam/SmartProjectionFactor.h>
2776+
2777+
/// Linearization mode: what factor to linearize to
2778+
enum LinearizationMode { HESSIAN, IMPLICIT_SCHUR, JACOBIAN_Q, JACOBIAN_SVD };
2779+
2780+
/// How to manage degeneracy
2781+
enum DegeneracyMode { IGNORE_DEGENERACY, ZERO_ON_DEGENERACY, HANDLE_INFINITY };
2782+
27812783
class SmartProjectionParams {
27822784
SmartProjectionParams();
2783-
// TODO(frank): make these work:
2784-
// void setLinearizationMode(LinearizationMode linMode);
2785-
// void setDegeneracyMode(DegeneracyMode degMode);
2785+
void setLinearizationMode(gtsam::LinearizationMode linMode);
2786+
void setDegeneracyMode(gtsam::DegeneracyMode degMode);
27862787
void setRankTolerance(double rankTol);
27872788
void setEnableEPI(bool enableEPI);
27882789
void setLandmarkDistanceThreshold(bool landmarkDistanceThreshold);

python/gtsam/gtsam.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <pybind11/eigen.h>
1414
#include <pybind11/stl_bind.h>
1515
#include <pybind11/pybind11.h>
16+
#include <pybind11/operators.h>
1617
#include <pybind11/functional.h>
1718
#include <pybind11/iostream.h>
1819
#include "gtsam/config.h"

0 commit comments

Comments
 (0)