45 throw std::runtime_error(
"Cannot convert HessianFactor to LinearCost");
52 throw std::runtime_error(
53 "Cannot convert a constrained JacobianFactor to LinearCost");
57 throw std::runtime_error(
58 "Only support single-valued linear cost factor!");
69 Base(i1, A1, i2, A2,
Vector1::Zero()) {
74 const RowVector& A3) :
75 Base(i1, A1, i2, A2, i3, A3,
Vector1::Zero()) {
81 template<
typename TERMS>
104 > (boost::make_shared < LinearCost > (*this));
LinearCost(const JacobianFactor &jf)
LinearCost(const HessianFactor &hf)
Vector unweighted_error(const VectorValues &c) const
bool equals(const GaussianFactor &lf, double tol=1e-9) const override
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
print
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
static const KeyFormatter DefaultKeyFormatter
const KeyFormatter & formatter
double error(const VectorValues &c) const override
bool equals(const GaussianFactor &lf, double tol=1e-9) const override
LinearCost(const TERMS &terms)
LinearCost This
Typedef to this class.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Array< double, 1, 3 > e(1./3., 0.5, 2.)
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
const SharedDiagonal & get_model() const
bool isConstrained() const
LinearCost(Key i1, const RowVector &A1, Key i2, const RowVector &A2, Key i3, const RowVector &A3)
Vector error_vector(const VectorValues &c) const
A Gaussian factor using the canonical parameters (information form)
GaussianFactor::shared_ptr clone() const override
LinearCost(Key i1, const RowVector &A1)
LinearCost(Key i1, const RowVector &A1, Key i2, const RowVector &A2, double b)
JacobianFactor Base
Typedef to base class.
The matrix class, also used for vectors and row-vectors.
std::uint64_t Key
Integer nonlinear key type.
Eigen::RowVectorXd RowVector