diff --git a/gtsam/base/DSF.h b/gtsam/base/DSF.h index 09b8fa332..af78db45c 100644 --- a/gtsam/base/DSF.h +++ b/gtsam/base/DSF.h @@ -50,6 +50,9 @@ namespace gtsam { // constructor with a list of unconnected keys DSF(const std::list& keys) : Tree() { BOOST_FOREACH(const KEY& key, keys) *this = this->add(key, key); } + // constructor with a set of unconnected keys + DSF(const std::set& keys) : Tree() { BOOST_FOREACH(const KEY& key, keys) *this = this->add(key, key); } + // create a new singleton, does nothing if already exists Self makeSet(const KEY& key) const { if (mem(key)) return *this; else return this->add(key, key); } diff --git a/gtsam/base/FastSet.h b/gtsam/base/FastSet.h index 6007dae9b..391521ecc 100644 --- a/gtsam/base/FastSet.h +++ b/gtsam/base/FastSet.h @@ -18,7 +18,7 @@ #pragma once -#include +#include #include namespace gtsam { diff --git a/gtsam/base/blockMatrices.h b/gtsam/base/blockMatrices.h index 5823b1365..445b88df2 100644 --- a/gtsam/base/blockMatrices.h +++ b/gtsam/base/blockMatrices.h @@ -93,11 +93,13 @@ public: typedef BlockColumn constColumn; protected: - FullMatrix& matrix_; - std::vector variableColOffsets_; - size_t rowStart_; - size_t rowEnd_; - size_t blockStart_; + FullMatrix& matrix_; // the reference to the original matrix + std::vector variableColOffsets_; // the starting columns of each block (0-based) + + // for elimination, represent + size_t rowStart_; // 0 initially + size_t rowEnd_; // the number of row - 1, initially + size_t blockStart_; // 0 initially public: /** Construct from an empty matrix (asserts that the matrix is empty) */ diff --git a/gtsam/linear/GaussianFactor.h b/gtsam/linear/GaussianFactor.h index fef2d4e94..4b370a606 100644 --- a/gtsam/linear/GaussianFactor.h +++ b/gtsam/linear/GaussianFactor.h @@ -75,8 +75,8 @@ public: SharedDiagonal model_; // Gaussian noise model with diagonal covariance matrix std::vector firstNonzeroBlocks_; - AbMatrix matrix_; - BlockAb Ab_; + AbMatrix matrix_; // the full matrix correponding to the factor + BlockAb Ab_; // the block view of the full matrix public: