63 std::cout << s <<
"AntiFactor version of:" << std::endl;
64 factor_->print(s, keyFormatter);
69 const This *
e =
dynamic_cast<const This*
> (&
expected);
70 return e !=
nullptr &&
Base::equals(*e,
tol) && this->factor_->equals(*e->factor_,
tol);
80 double error(
const Values&
c)
const override {
return -factor_->error(c); }
83 size_t dim()
const override {
return factor_->dim(); }
89 bool active(
const Values&
c)
const override {
return factor_->active(c); }
103 return gaussianFactor->negate();
111 template<
class ARCHIVE>
113 ar & boost::serialization::make_nvp(
"AntiFactor",
114 boost::serialization::base_object<Base>(*
this));
115 ar & BOOST_SERIALIZATION_NVP(factor_);
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
A factor with a quadratic error function - a Gaussian.
friend class boost::serialization::access
static const KeyFormatter DefaultKeyFormatter
void serialize(ARCHIVE &ar, const unsigned int)
void print(const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
double error(const Values &c) const override
boost::shared_ptr< This > shared_ptr
boost::shared_ptr< AntiFactor > shared_ptr
boost::shared_ptr< GaussianFactor > linearize(const Values &c) const override
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
virtual bool equals(const NonlinearFactor &f, double tol=1e-9) const
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
bool active(const Values &c) const override
Non-linear factor base classes.
const KeyVector & keys() const
Access the factor's involved variable keys.
gtsam::NonlinearFactor::shared_ptr clone() const override
AntiFactor(NonlinearFactor::shared_ptr factor)
NonlinearFactor::shared_ptr sharedFactor
size_t dim() const override