25 #define MKL_BLAS MKL_DOMAIN_BLAS 50 #define GTSAM_MAKE_VECTOR_DEFS(N) \ 51 typedef Eigen::Matrix<double, N, 1> Vector##N; \ 52 static const Eigen::MatrixBase<Vector##N>::ConstantReturnType Z_##N##x1 = Vector##N::Zero(); 72 #if defined(GTSAM_EIGEN_VERSION_WORLD) 76 "Error: GTSAM was built against a different version of Eigen");
95 GTSAM_EXPORT
bool fpEqual(
double a,
double b,
double tol,
96 bool check_relative_also =
true);
101 GTSAM_EXPORT
void print(
const Vector&
v,
const std::string&
s, std::ostream&
stream);
106 GTSAM_EXPORT
void print(
const Vector&
v,
const std::string&
s =
"");
111 GTSAM_EXPORT
void save(
const Vector&
A,
const std::string &
s,
const std::string&
filename);
116 GTSAM_EXPORT
bool operator==(
const Vector&
vec1,
const Vector& vec2);
134 inline bool equal(
const Vector&
vec1,
const Vector& vec2,
double tol) {
141 inline bool equal(
const Vector&
vec1,
const Vector& vec2) {
161 GTSAM_EXPORT
bool assert_inequal(
const Vector& vec1,
const Vector& vec2,
double tol=1
e-9);
170 GTSAM_EXPORT
bool assert_equal(
const SubVector& vec1,
const SubVector& vec2,
double tol=1
e-9);
171 GTSAM_EXPORT
bool assert_equal(
const ConstSubVector& vec1,
const ConstSubVector& vec2,
double tol=1
e-9);
188 GTSAM_EXPORT Vector
ediv_(
const Vector &
a,
const Vector &
b);
193 template<
class V1,
class V2>
194 inline double dot(
const V1 &a,
const V2& b) {
195 assert (b.size()==a.size());
200 template<
class V1,
class V2>
202 assert (b.size()==a.size());
216 template<
class V1,
class V2>
218 assert (y.size()==x.size());
222 assert (y.size()==x.size());
231 GTSAM_EXPORT std::pair<double,Vector>
house(
const Vector &
x);
246 GTSAM_EXPORT std::pair<Vector, double>
259 GTSAM_EXPORT Vector
concatVectors(
const std::list<Vector>& vs);
267 #include <boost/serialization/nvp.hpp> 268 #include <boost/serialization/array.hpp> 269 #include <boost/serialization/split_free.hpp> 272 namespace serialization {
275 template<
class Archive>
277 const size_t size = v.size();
278 ar << BOOST_SERIALIZATION_NVP(size);
279 ar << make_nvp(
"data", make_array(v.data(), v.size()));
282 template<
class Archive>
285 ar >> BOOST_SERIALIZATION_NVP(size);
287 ar >> make_nvp(
"data", make_array(v.data(), v.size()));
291 template<
class Archive,
int D>
293 ar << make_nvp(
"data", make_array(v.
data(), v.RowsAtCompileTime));
296 template<
class Archive,
int D>
298 ar >> make_nvp(
"data", make_array(v.
data(), v.RowsAtCompileTime));
307 BOOST_SERIALIZATION_SPLIT_FREE(gtsam::Vector6)
void print(const Matrix &A, const string &s, ostream &stream)
Generic expression of a matrix where all coefficients are defined by a functor.
Vector ediv_(const Vector &a, const Vector &b)
void save(const Matrix &A, const string &s, const string &filename)
double weightedPseudoinverse(const Vector &a, const Vector &weights, Vector &pseudo)
static const Eigen::MatrixBase< Vector3 >::ConstantReturnType Z_3x1
double dot(const V1 &a, const V2 &b)
GTSAM_MAKE_VECTOR_DEFS(4)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Included from all GTSAM files.
bool operator==(const Matrix &A, const Matrix &B)
bool fpEqual(double a, double b, double tol, bool check_relative_also)
Expression of a fixed-size or dynamic-size sub-vector.
void load(Archive &ar, Eigen::Matrix< double, D, 1 > &v, unsigned int)
#define EIGEN_WORLD_VERSION
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void axpy(double alpha, const V1 &x, V2 &y)
bool greaterThanOrEqual(const Vector &vec1, const Vector &vec2)
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
Eigen::Matrix< double, 1, 1 > Vector1
void scal(double alpha, Vector &x)
bool linear_dependent(const Matrix &A, const Matrix &B, double tol)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
#define EIGEN_MAJOR_VERSION
double inner_prod(const V1 &a, const V2 &b)
bool assert_inequal(const Matrix &A, const Matrix &B, double tol)
pair< double, Vector > house(const Vector &x)
The matrix class, also used for vectors and row-vectors.
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
static const Eigen::MatrixBase< Vector2 >::ConstantReturnType Z_2x1
Vector concatVectors(const std::list< Vector > &vs)
double houseInPlace(Vector &v)
Eigen::VectorBlock< Vector > SubVector
Eigen::VectorBlock< const Vector > ConstSubVector