20#include <gtsam/config.h>
22#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V43
35class FixedVector :
public Eigen::Matrix<double, N, 1> {
37 typedef Eigen::Matrix<double, N, 1> Base;
43 FixedVector(
const FixedVector& v) : Base(v) {}
45 FixedVector& operator=(
const FixedVector& other) =
default;
48 FixedVector(
const Vector& v) : Base(v) {}
51 FixedVector(
const double* values) {
52 std::copy(values, values+N, this->data());
59 inline static FixedVector repeat(
double value) {
60 return FixedVector(Base::Constant(value));
70 inline static FixedVector delta(
size_t i,
double value) {
71 return FixedVector(Base::Unit(i) * value);
80 inline static FixedVector basis(
size_t i) {
return FixedVector(Base::Unit(i)); }
85 inline static FixedVector zero() {
return FixedVector(Base::Zero());}
90 inline static FixedVector ones() {
return FixedVector(FixedVector::Ones());}
92 static size_t dim() {
return Base::max_size; }
94 void print(
const std::string& name=
"")
const {
gtsam::print(Vector(*
this), name); }
97 bool equals(
const FixedVector<M>& other,
double tol=1e-9)
const {
101 bool equals(
const FixedVector& other,
double tol=1e-9)
const {
typedef and functions to augment Eigen's VectorXd
Global functions in a separate testing namespace.
Definition chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
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:81