46 Base(), active_(true) {
51 throw std::runtime_error(
52 "Cannot convert HessianFactor to LinearInequality");
57 Base(jf), dualKey_(dualKey), active_(true) {
59 throw std::runtime_error(
60 "Cannot convert an unconstrained JacobianFactor to LinearInequality");
64 throw std::runtime_error(
"Only support single-valued inequality factor!");
70 Base(i1, A1, (
Vector(1) << b).finished(),
71 noiseModel::Constrained::All(1)), dualKey_(dualKey), active_(true) {
77 Base(i1, A1, i2, A2, (
Vector(1) << b).finished(),
78 noiseModel::Constrained::All(1)), dualKey_(dualKey), active_(true) {
84 Base(i1, A1, i2, A2, i3, A3, (
Vector(1) << b).finished(),
85 noiseModel::Constrained::All(1)), dualKey_(dualKey), active_(true) {
92 template<
typename TERMS>
94 Base(terms, (
Vector(1) << b).finished(), noiseModel::Constrained::All(1)), dualKey_(
95 dualKey), active_(true) {
119 > (std::make_shared < LinearInequality > (*this));
LinearInequality(Key i1, const RowVector &A1, Key i2, const RowVector &A2, double b, Key dualKey)
bool equals(const GaussianFactor &lf, double tol=1e-9) const override
GaussianFactor::shared_ptr clone() const override
LinearInequality(const HessianFactor &hf)
LinearInequality This
Typedef to this class.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
static const KeyFormatter DefaultKeyFormatter
double error(const VectorValues &c) const override
Vector unweighted_error(const VectorValues &c) const
const KeyFormatter & formatter
void inactivate()
Make this inequality constraint inactive.
bool isConstrained() const
bool active() const
return true if this constraint is active
const_iterator end() const
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print with optional string
bool equals(const GaussianFactor &lf, double tol=1e-9) const override
assert equality up to a tolerance
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Key dualKey() const
dual key
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
void activate()
Make this inequality constraint active.
~LinearInequality() override
LinearInequality(const TERMS &terms, double b, Key dualKey)
LinearInequality(Key i1, const RowVector &A1, Key i2, const RowVector &A2, Key i3, const RowVector &A3, double b, Key dualKey)
A Gaussian factor using the canonical parameters (information form)
LinearInequality(const JacobianFactor &jf, Key dualKey)
KeyVector::const_iterator const_iterator
Const iterator over keys.
const_iterator begin() const
double dotProductRow(const VectorValues &p) const
LinearInequality(Key i1, const RowVector &A1, double b, Key dualKey)
std::uint64_t Key
Integer nonlinear key type.
const SharedDiagonal & get_model() const
JacobianFactor Base
Typedef to base class.
Vector error_vector(const VectorValues &c) const
Eigen::RowVectorXd RowVector