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 > (std::make_shared < LinearCost > (*this));
LinearCost(const JacobianFactor &jf)
LinearCost(const HessianFactor &hf)
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
static const KeyFormatter DefaultKeyFormatter
Vector unweighted_error(const VectorValues &c) const
const KeyFormatter & formatter
double error(const VectorValues &c) const override
bool equals(const GaussianFactor &lf, double tol=1e-9) const override
bool isConstrained() const
LinearCost(const TERMS &terms)
LinearCost This
Typedef to this class.
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.)
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
LinearCost(Key i1, const RowVector &A1, Key i2, const RowVector &A2, Key i3, const RowVector &A3)
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.
Vector error_vector(const VectorValues &c) const
std::shared_ptr< This > shared_ptr
shared_ptr to this class
std::uint64_t Key
Integer nonlinear key type.
const SharedDiagonal & get_model() const
Eigen::RowVectorXd RowVector