25#define MKL_BLAS MKL_DOMAIN_BLAS
39typedef Eigen::VectorXd Vector;
42typedef Eigen::Matrix<double, 1, 1> Vector1;
43typedef Eigen::Vector2d Vector2;
44typedef Eigen::Vector3d Vector3;
46#define Z_2x1 Vector2::Constant(0.0)
47#define Z_3x1 Vector3::Constant(0.0)
48#define Z_4x1 Vector4::Constant(0.0)
49#define Z_5x1 Vector5::Constant(0.0)
50#define Z_6x1 Vector6::Constant(0.0)
51#define Z_7x1 Vector7::Constant(0.0)
52#define Z_8x1 Vector8::Constant(0.0)
53#define Z_9x1 Vector9::Constant(0.0)
54#define Z_10x1 Vector10::Constant(0.0)
55#define Z_11x1 Vector11::Constant(0.0)
56#define Z_12x1 Vector12::Constant(0.0)
57#define Z_15x1 Vector15::Constant(0.0)
61#define GTSAM_MAKE_VECTOR_DEFS(N) \
62 using Vector##N = Eigen::Matrix<double, N, 1>;
64GTSAM_MAKE_VECTOR_DEFS(4)
65GTSAM_MAKE_VECTOR_DEFS(5)
66GTSAM_MAKE_VECTOR_DEFS(6)
67GTSAM_MAKE_VECTOR_DEFS(7)
68GTSAM_MAKE_VECTOR_DEFS(8)
69GTSAM_MAKE_VECTOR_DEFS(9)
70GTSAM_MAKE_VECTOR_DEFS(10)
71GTSAM_MAKE_VECTOR_DEFS(11)
72GTSAM_MAKE_VECTOR_DEFS(12)
73GTSAM_MAKE_VECTOR_DEFS(15)
75typedef Eigen::VectorBlock<Vector> SubVector;
76typedef Eigen::VectorBlock<const Vector> ConstSubVector;
83#if defined(GTSAM_EIGEN_VERSION_WORLD)
85 GTSAM_EIGEN_VERSION_WORLD==EIGEN_WORLD_VERSION &&
86 GTSAM_EIGEN_VERSION_MAJOR==EIGEN_MAJOR_VERSION,
87 "Error: GTSAM was built against a different version of Eigen");
106GTSAM_EXPORT
bool fpEqual(
double a,
double b,
double tol,
107 bool check_relative_also =
true);
112GTSAM_EXPORT
void print(
const Vector& v,
const std::string& s, std::ostream& stream);
117GTSAM_EXPORT
void print(
const Vector& v,
const std::string& s =
"");
122GTSAM_EXPORT
void save(
const Vector& A,
const std::string &s,
const std::string& filename);
127GTSAM_EXPORT
bool operator==(
const Vector& vec1,
const Vector& vec2);
139GTSAM_EXPORT
bool equal_with_abs_tol(
const Vector& vec1,
const Vector& vec2,
double tol=1e-9);
140GTSAM_EXPORT
bool equal_with_abs_tol(
const SubVector& vec1,
const SubVector& vec2,
double tol=1e-9);
145inline bool equal(
const Vector& vec1,
const Vector& vec2,
double tol) {
152inline bool equal(
const Vector& vec1,
const Vector& vec2) {
163GTSAM_EXPORT
bool assert_equal(
const Vector& vec1,
const Vector& vec2,
double tol=1e-9);
172GTSAM_EXPORT
bool assert_inequal(
const Vector& vec1,
const Vector& vec2,
double tol=1e-9);
181GTSAM_EXPORT
bool assert_equal(
const SubVector& vec1,
const SubVector& vec2,
double tol=1e-9);
182GTSAM_EXPORT
bool assert_equal(
const ConstSubVector& vec1,
const ConstSubVector& vec2,
double tol=1e-9);
191GTSAM_EXPORT
bool linear_dependent(
const Vector& vec1,
const Vector& vec2,
double tol=1e-9);
199GTSAM_EXPORT Vector
ediv_(
const Vector &a,
const Vector &b);
204template<
class V1,
class V2>
205inline double dot(
const V1 &a,
const V2& b) {
206 assert (b.size()==a.size());
211template<
class V1,
class V2>
213 assert (b.size()==a.size());
217#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42
222inline void GTSAM_DEPRECATED scal(
double alpha, Vector& x) { x *= alpha; }
228template<
class V1,
class V2>
229inline void GTSAM_DEPRECATED
axpy(
double alpha,
const V1& x, V2& y) {
230 assert (y.size()==x.size());
233inline void axpy(
double alpha,
const Vector& x, SubVector y) {
234 assert (y.size()==x.size());
244GTSAM_EXPORT std::pair<double,Vector>
house(
const Vector &x);
259GTSAM_EXPORT std::pair<Vector, double>
260weightedPseudoinverse(
const Vector& v,
const Vector& weights);
267GTSAM_EXPORT
double weightedPseudoinverse(
const Vector& a,
const Vector& weights, Vector& pseudo);
272GTSAM_EXPORT Vector
concatVectors(
const std::list<Vector>& vs);
Included from all GTSAM files.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
Vector ediv_(const Vector &a, const Vector &b)
elementwise division, but 0/0 = 0, not inf
Definition Vector.cpp:199
bool greaterThanOrEqual(const Vector &vec1, const Vector &vec2)
Greater than or equal to operation returns true if all elements in v1 are greater than corresponding ...
Definition Vector.cpp:114
void save(const Matrix &A, const string &s, const string &filename)
save a matrix to file, which can be loaded by matlab
Definition Matrix.cpp:167
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
equals with an tolerance, prints out message if unequal
Definition Matrix.cpp:43
bool linear_dependent(const Matrix &A, const Matrix &B, double tol)
check whether the rows of two matrices are linear dependent
Definition Matrix.cpp:117
double inner_prod(const V1 &a, const V2 &b)
compatibility version for ublas' inner_prod()
Definition Vector.h:212
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:156
void axpy(double alpha, const Errors &x, Errors &y)
BLAS level 2 style AXPY, y := alpha*x + y.
Definition Errors.cpp:111
bool assert_inequal(const Matrix &A, const Matrix &B, double tol)
inequals with an tolerance, prints out message if within tolerance
Definition Matrix.cpp:63
double houseInPlace(Vector &v)
beta = house(x) computes the HouseHolder vector in place
Definition Vector.cpp:212
bool equal(const T &obj1, const T &obj2, double tol)
Call equal on the object.
Definition Testable.h:84
double dot(const V1 &a, const V2 &b)
Dot product.
Definition Vector.h:205
bool fpEqual(double a, double b, double tol, bool check_relative_also)
Ensure we are not including a different version of Eigen in user code than while compiling gtsam,...
Definition Vector.cpp:42
Vector concatVectors(const std::list< Vector > &vs)
concatenate Vectors
Definition Vector.cpp:302
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
equals with a tolerance
Definition Matrix.h:108
pair< double, Vector > house(const Vector &x)
house(x,j) computes HouseHolder vector v and scaling factor beta from x, such that the corresponding ...
Definition Vector.cpp:237
bool operator==(const Matrix &A, const Matrix &B)
equality is just equal_with_abs_tol 1e-9
Definition Matrix.h:127