23 #include <gtsam/inference/Symbol.h> 25 #include <gtsam/base/VectorSpace.h> 30 class ExpressionFactorShallowTest;
57 std::shared_ptr<internal::ExpressionNode<T> > root_;
70 typedef std::function<
74 template<
class A1,
class A2>
76 typedef std::function<
81 template<
class A1,
class A2,
class A3>
83 typedef std::function<
84 T(
const A1&,
const A2&,
const A3&,
104 Expression(
typename UnaryFunction<A>::type
function,
108 template<
typename A1,
typename A2>
109 Expression(
typename BinaryFunction<A1, A2>::type
function,
113 template<
typename A1,
typename A2,
typename A3>
114 Expression(
typename TernaryFunction<A1, A2, A3>::type
function,
124 template<
typename A1,
typename A2>
131 template<
typename A1,
typename A2,
typename A3>
133 T (A1::*method)(
const A2&,
const A3&,
144 std::set<Key> keys()
const;
147 void dims(std::map<Key, int>& map)
const;
150 void print(
const std::string& s)
const;
157 T value(
const Values& values, std::vector<Matrix>* H =
nullptr)
const;
164 return value(values, &H);
172 virtual std::shared_ptr<Expression>
clone()
const {
173 return std::make_shared<Expression>(*this);
177 const std::shared_ptr<internal::ExpressionNode<T> >& root()
const;
180 size_t traceSize()
const;
192 KeysAndDims keysAndDims()
const;
200 char* traceStorage)
const;
203 T valueAndJacobianMap(
const Values& values,
211 friend class ::ExpressionFactorShallowTest;
218 template <
typename T>
231 template <
typename T>
246 template <
typename T,
typename A>
248 const std::function<T(A)>& f,
const Expression<A>& expression,
266 template <
typename T>
277 template <
typename T>
283 template <
typename T>
286 return e1 + (-1.0) * e2;
303 std::vector<Expression<T> >
createUnknowns(
size_t n,
char c,
size_t start = 0);
std::pair< KeyVector, FastVector< int > > KeysAndDims
Keys and dimensions in same order.
Definition: Expression.h:191
Definition: Expression.h:232
Expression< T > linearExpression(const std::function< T(A)> &f, const Expression< A > &expression, const Eigen::Matrix< double, traits< T >::dimension, traits< A >::dimension > &dTdA)
Definition: Expression.h:247
Definition: Expression.h:82
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
Definition: FastVector.h:34
Definition: Expression.h:47
JacobianMap for returning derivatives from expressions.
std::vector< Expression< T > > createUnknowns(size_t n, char c, size_t start)
Construct an array of leaves.
Definition: Expression-inl.h:283
Vector Space concept.
Definition: VectorSpace.h:470
Point2 operator*(double s, const Point2 &p)
multiply with scalar
Definition: Point2.h:52
Definition: Expression.h:219
Expression< T > type
Define type so we can apply it as a meta-function.
Definition: Expression.h:52
Definition: JacobianMap.h:32
virtual ~Expression()
Destructor.
Definition: Expression.h:140
GTSAM_EXPORT void print(const Matrix &A, const std::string &s, std::ostream &stream)
Expression(const std::shared_ptr< internal::ExpressionNode< T > > &root)
Construct with a custom root.
Definition: Expression.h:60
Definition: Expression.h:40
virtual std::shared_ptr< Expression > clone() const
Definition: Expression.h:172
Key symbol(unsigned char c, std::uint64_t j)
Definition: Symbol.h:139
Definition: chartTesting.h:28
Internals for Expression.h, not for general consumption.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
Definition: OptionalJacobian.h:38
GTSAM_EXPORT Errors operator-(const Errors &a, const Errors &b)
Subtraction.
Expression()
Default constructor, for serialization.
Definition: Expression.h:188
Definition: Expression.h:69
Special class for optional Jacobian arguments.
Definition: Expression.h:36
T value(const Values &values, std::vector< Matrix > &H) const
Definition: Expression.h:163
Definition: Expression.h:75
GTSAM_EXPORT Errors operator+(const Errors &a, const Errors &b)
Addition.
Definition: Expression.h:39
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102