Fixed code comments to indicate that assertInvariants does not check for sorted keys

release/4.3a0
Richard Roberts 2011-06-04 12:54:43 +00:00
parent 1c6901a564
commit 5ea18829b5
3 changed files with 2 additions and 8 deletions

View File

@ -29,12 +29,6 @@ namespace gtsam {
/* ************************************************************************* */ /* ************************************************************************* */
void IndexFactor::assertInvariants() const { void IndexFactor::assertInvariants() const {
Base::assertInvariants(); Base::assertInvariants();
//#ifndef NDEBUG
//#ifndef GTSAM_NO_ENFORCE_ORDERING
// std::set<Index> uniqueSorted(keys_.begin(), keys_.end());
// assert(uniqueSorted.size() == keys_.size() && std::equal(uniqueSorted.begin(), uniqueSorted.end(), keys_.begin()));
//#endif
//#endif
} }
/* ************************************************************************* */ /* ************************************************************************* */

View File

@ -38,7 +38,7 @@ namespace gtsam {
protected: protected:
// Internal function for checking class invariants (sorted keys for this factor) // Internal function for checking class invariants (unique keys for this factor)
void assertInvariants() const; void assertInvariants() const;
public: public:

View File

@ -45,7 +45,7 @@ namespace gtsam {
/* ************************************************************************* */ /* ************************************************************************* */
inline void JacobianFactor::assertInvariants() const { inline void JacobianFactor::assertInvariants() const {
#ifndef NDEBUG #ifndef NDEBUG
IndexFactor::assertInvariants(); // The base class checks for sorted keys GaussianFactor::assertInvariants(); // The base class checks for unique keys
assert((size() == 0 && Ab_.rows() == 0 && Ab_.nBlocks() == 0) || size()+1 == Ab_.nBlocks()); assert((size() == 0 && Ab_.rows() == 0 && Ab_.nBlocks() == 0) || size()+1 == Ab_.nBlocks());
assert(firstNonzeroBlocks_.size() == Ab_.rows()); assert(firstNonzeroBlocks_.size() == Ab_.rows());
for(size_t i=0; i<firstNonzeroBlocks_.size(); ++i) for(size_t i=0; i<firstNonzeroBlocks_.size(); ++i)