42 cost(), equalities(), inequalities() {
49 cost(_cost), equalities(_linearEqualities), inequalities(
50 _linearInequalities) {
54 void print(
const std::string&
s =
"") {
55 std::cout <<
s << std::endl;
56 cost.
print(
"Quadratic cost factors: ");
57 equalities.
print(
"Linear equality factors: ");
58 inequalities.
print(
"Linear inequality factors: ");
62 if (cachedCostVariableIndex_.
size() == 0)
68 Vector g = Vector::Zero(delta.
at(key).size());
72 g += factor->gradient(key, delta);
const VariableIndex & costVariableIndex() const
const_iterator find(Key key) const
Find the iterator for the requested variable entry.
Factor graph of all LinearInequality factors.
Vector costGradient(Key key, const VectorValues &delta) const
Factor graph of all LinearEquality factors.
void g(const string &key, int i)
size_t size() const
The number of variable entries. This is equal to the number of unique variable Keys.
GaussianFactorGraph cost
Quadratic cost factors.
Linear Factor Graph where all factors are Gaussians.
VariableIndex cachedCostVariableIndex_
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
const_iterator end() const
Iterator to the first variable entry.
const sharedFactor at(size_t i) const
InequalityFactorGraph inequalities
linear inequality constraints: cI(x) <= 0
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
virtual void print(const std::string &s="FactorGraph", const KeyFormatter &formatter=DefaultKeyFormatter) const
print out graph
EqualityFactorGraph equalities
linear equality constraints: cE(x) = 0
QP(const GaussianFactorGraph &_cost, const EqualityFactorGraph &_linearEqualities, const InequalityFactorGraph &_linearInequalities)
void print(const std::string &s="")
utility functions for loading datasets
std::uint64_t Key
Integer nonlinear key type.