36 typedef std::shared_ptr<BoundingConstraint1<VALUE> >
shared_ptr;
47 threshold_(threshold), isGreaterThan_(isGreaterThan) {
67 return (isGreaterThan_) ? x <= threshold_ : x >=
threshold_;
74 if (isGreaterThan_) *H =
D;
79 return (
Vector(1) << error).finished();
86 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 88 friend class boost::serialization::access;
89 template<
class ARCHIVE>
90 void serialize(ARCHIVE & ar,
const unsigned int ) {
92 ar & boost::serialization::make_nvp(
"NoiseModelFactor1",
93 boost::serialization::base_object<Base>(*
this));
94 ar & BOOST_SERIALIZATION_NVP(threshold_);
95 ar & BOOST_SERIALIZATION_NVP(isGreaterThan_);
104 template<
class VALUE1,
class VALUE2>
110 typedef std::shared_ptr<BoundingConstraint2<VALUE1, VALUE2> >
shared_ptr;
120 : Base(
noiseModel::Constrained::All(1,
mu), key1, key2),
121 threshold_(threshold), isGreaterThan_(isGreaterThan) {}
132 virtual double value(
const X1&
x1,
const X2&
x2,
140 return (isGreaterThan_) ? x <= threshold_ : x >=
threshold_;
148 if (isGreaterThan_) *H1 = D1;
149 else *H1 = -1.0 * D1;
152 if (isGreaterThan_) *H2 = D2;
153 else *H2 = -1.0 * D2;
157 return (
Vector(1) << error).finished();
164 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 166 friend class boost::serialization::access;
167 template<
class ARCHIVE>
168 void serialize(ARCHIVE & ar,
const unsigned int ) {
170 ar & boost::serialization::make_nvp(
"NoiseModelFactor2",
171 boost::serialization::base_object<Base>(*
this));
172 ar & BOOST_SERIALIZATION_NVP(threshold_);
173 ar & BOOST_SERIALIZATION_NVP(isGreaterThan_);
~BoundingConstraint2() override
std::string serialize(const T &input)
serializes to a string
const ValueType at(Key j) const
BoundingConstraint1(Key key, double threshold, bool isGreaterThan, double mu=1000.0)
flag for greater/less than
virtual Vector evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
NoiseModelFactorN< VALUE1, VALUE2 > Base
bool isGreaterThan() const
bool isGreaterThan() const
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
~BoundingConstraint1() override
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange [*:*] noreverse nowriteback set trange [*:*] noreverse nowriteback set urange [*:*] noreverse nowriteback set vrange [*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
bool active(const Values &c) const override
const SharedNoiseModel & noiseModel() const
access to the noise model
Matrix * OptionalMatrixType
NoiseModelFactorN< VALUE > Base
std::shared_ptr< BoundingConstraint2< VALUE1, VALUE2 > > shared_ptr
Base class and basic functions for Lie types.
BoundingConstraint2(Key key1, Key key2, double threshold, bool isGreaterThan, double mu=1000.0)
flag for greater/less than
Vector evaluateError(const X &x, OptionalMatrixType H) const override
virtual double value(const X &x, OptionalMatrixType H=OptionalNone) const =0
double error(const Values &c) const override
Non-linear factor base classes.
bool active(const Values &c) const override
std::shared_ptr< BoundingConstraint1< VALUE > > shared_ptr
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
std::uint64_t Key
Integer nonlinear key type.
Vector evaluateError(const X1 &x1, const X2 &x2, OptionalMatrixType H1, OptionalMatrixType H2) const override