Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved empty to Factor base class. #998

Merged
merged 1 commit into from
Dec 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions gtsam/discrete/DiscreteFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ class GTSAM_EXPORT DiscreteFactor: public Factor {
Base::print(s, formatter);
}

/** Test whether the factor is empty */
virtual bool empty() const { return size() == 0; }

/// @}
/// @name Standard Interface
/// @{
Expand Down
3 changes: 3 additions & 0 deletions gtsam/inference/Factor.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ typedef FastSet<FactorIndex> FactorIndexSet;
/// @name Standard Interface
/// @{

/// Whether the factor is empty (involves zero variables).
bool empty() const { return keys_.empty(); }

/// First key
Key front() const { return keys_.front(); }

Expand Down
3 changes: 0 additions & 3 deletions gtsam/linear/GaussianFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ namespace gtsam {
/** Clone a factor (make a deep copy) */
virtual GaussianFactor::shared_ptr clone() const = 0;

/** Test whether the factor is empty */
virtual bool empty() const = 0;

/**
* Construct the corresponding anti-factor to negate information
* stored stored in this factor.
Expand Down
3 changes: 0 additions & 3 deletions gtsam/linear/HessianFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,6 @@ namespace gtsam {
*/
GaussianFactor::shared_ptr negate() const override;

/** Check if the factor is empty. TODO: How should this be defined? */
bool empty() const override { return size() == 0 /*|| rows() == 0*/; }

/** Return the constant term \f$ f \f$ as described above
* @return The constant term \f$ f \f$
*/
Expand Down
3 changes: 0 additions & 3 deletions gtsam/linear/JacobianFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,6 @@ namespace gtsam {
*/
GaussianFactor::shared_ptr negate() const override;

/** Check if the factor is empty. TODO: How should this be defined? */
bool empty() const override { return size() == 0 /*|| rows() == 0*/; }

/** is noise model constrained ? */
bool isConstrained() const {
return model_ && model_->isConstrained();
Expand Down
4 changes: 0 additions & 4 deletions gtsam/slam/RegularImplicitSchurFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ class RegularImplicitSchurFactor: public GaussianFactor {
"RegularImplicitSchurFactor::clone non implemented");
}

bool empty() const override {
return false;
}

GaussianFactor::shared_ptr negate() const override {
return boost::make_shared<RegularImplicitSchurFactor<CAMERA> >(keys_,
FBlocks_, PointCovariance_, E_, b_);
Expand Down
3 changes: 0 additions & 3 deletions gtsam/symbolic/SymbolicFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ namespace gtsam {
/// @name Standard Interface
/// @{

/** Whether the factor is empty (involves zero variables). */
bool empty() const { return keys_.empty(); }

/** Eliminate the variables in \c keys, in the order specified in \c keys, returning a
* conditional and marginal. */
std::pair<boost::shared_ptr<SymbolicConditional>, boost::shared_ptr<SymbolicFactor> >
Expand Down