Skip to content

Commit

Permalink
Merge pull request #762 from borglab/feature/wrapper-interface-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal authored May 5, 2021
2 parents d8f279b + f74453c commit ab92779
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
53 changes: 27 additions & 26 deletions gtsam/gtsam.i
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

namespace gtsam {

// Actually a FastList<Key>
#include <gtsam/inference/Key.h>

const KeyFormatter DefaultKeyFormatter;

// Actually a FastList<Key>
class KeyList {
KeyList();
KeyList(const gtsam::KeyList& other);
Expand Down Expand Up @@ -1284,31 +1284,26 @@ class SymbolicBayesTree {
gtsam::SymbolicBayesNet* jointBayesNet(size_t key1, size_t key2) const;
};

// class SymbolicBayesTreeClique {
// SymbolicBayesTreeClique();
// SymbolicBayesTreeClique(CONDITIONAL* conditional);
// SymbolicBayesTreeClique(const pair<typename ConditionalType::shared_ptr, typename ConditionalType::FactorType::shared_ptr>& result) : Base(result) {}
//
// bool equals(const This& other, double tol) const;
// void print(string s = "",
// const gtsam::KeyFormatter& keyFormatter = gtsam::DefaultKeyFormatter) const;
// void printTree() const; // Default indent of ""
// void printTree(string indent) const;
// size_t numCachedSeparatorMarginals() const;
//
// CONDITIONAL* conditional() const;
// bool isRoot() const;
// size_t treeSize() const;
// const std::list<derived_ptr>& children() const { return children_; }
// derived_ptr parent() const { return parent_.lock(); }
//
class SymbolicBayesTreeClique {
SymbolicBayesTreeClique();
// SymbolicBayesTreeClique(gtsam::sharedConditional* conditional);

bool equals(const gtsam::SymbolicBayesTreeClique& other, double tol) const;
void print(string s = "",
const gtsam::KeyFormatter& keyFormatter = gtsam::DefaultKeyFormatter) const;
size_t numCachedSeparatorMarginals() const;
// gtsam::sharedConditional* conditional() const;
bool isRoot() const;
size_t treeSize() const;
gtsam::SymbolicBayesTreeClique* parent() const;

// // TODO: need wrapped versions graphs, BayesNet
// BayesNet<ConditionalType> shortcut(derived_ptr root, Eliminate function) const;
// FactorGraph<FactorType> marginal(derived_ptr root, Eliminate function) const;
// FactorGraph<FactorType> joint(derived_ptr C2, derived_ptr root, Eliminate function) const;
//
// void deleteCachedShortcuts();
// };
void deleteCachedShortcuts();
};

#include <gtsam/inference/VariableIndex.h>
class VariableIndex {
Expand Down Expand Up @@ -1554,7 +1549,7 @@ class Sampler {

#include <gtsam/linear/VectorValues.h>
class VectorValues {
//Constructors
//Constructors
VectorValues();
VectorValues(const gtsam::VectorValues& other);

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

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

#include <gtsam/slam/SmartProjectionFactor.h>

/// Linearization mode: what factor to linearize to
enum LinearizationMode { HESSIAN, IMPLICIT_SCHUR, JACOBIAN_Q, JACOBIAN_SVD };

/// How to manage degeneracy
enum DegeneracyMode { IGNORE_DEGENERACY, ZERO_ON_DEGENERACY, HANDLE_INFINITY };

class SmartProjectionParams {
SmartProjectionParams();
// TODO(frank): make these work:
// void setLinearizationMode(LinearizationMode linMode);
// void setDegeneracyMode(DegeneracyMode degMode);
void setLinearizationMode(gtsam::LinearizationMode linMode);
void setDegeneracyMode(gtsam::DegeneracyMode degMode);
void setRankTolerance(double rankTol);
void setEnableEPI(bool enableEPI);
void setLandmarkDistanceThreshold(bool landmarkDistanceThreshold);
Expand Down
1 change: 1 addition & 0 deletions python/gtsam/gtsam.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <pybind11/eigen.h>
#include <pybind11/stl_bind.h>
#include <pybind11/pybind11.h>
#include <pybind11/operators.h>
#include <pybind11/functional.h>
#include <pybind11/iostream.h>
#include "gtsam/config.h"
Expand Down

0 comments on commit ab92779

Please sign in to comment.