30 for (
const auto& [
key,
e] : V) {
44 struct equalsVector :
public std::function<bool(const Vector&, const Vector&)> {
53 if (actual.size() != expected.size())
return false;
54 return equal(actual.begin(), actual.end(), expected.begin(),
63 throw(std::invalid_argument(
"Errors::operator+: incompatible sizes"));
66 Errors::const_iterator it = b.begin();
68 result.push_back(ai + *(it++));
78 throw(std::invalid_argument(
"Errors::operator-: incompatible sizes"));
81 Errors::const_iterator it = b.begin();
83 result.push_back(ai - *(it++));
91 result.push_back(-ai);
100 throw(std::invalid_argument(
"Errors::dot: incompatible sizes"));
103 Errors::const_iterator it = b.begin();
105 result += gtsam::dot<Vector,Vector>(ai, *(it++));
111 Errors::const_iterator it = x.begin();
113 yi += alpha * (*(it++));
void print(const Matrix &A, const string &s, ostream &stream)
const gtsam::Symbol key('X', 0)
void print(const Errors &e, const string &s)
Print an Errors instance.
equalsVector(double tol=1e-9)
Errors operator-(const Errors &a)
Negation.
Array< int, Dynamic, 1 > v
double dot(const Errors &a, const Errors &b)
Dot product.
Errors operator+(const Errors &a, const Errors &b)
Addition.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
Errors createErrors(const VectorValues &V)
Break V into pieces according to its start indices.
bool operator()(const Vector &expected, const Vector &actual)
bool equality(const Errors &actual, const Errors &expected, double tol)
int EIGEN_BLAS_FUNC() axpy(const int *n, const RealScalar *palpha, const RealScalar *px, const int *incx, RealScalar *py, const int *incy)
bool equal(const T &obj1, const T &obj2, double tol)
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