26 #include <boost/make_shared.hpp> 27 #include <boost/pool/pool_alloc.hpp> 34 #define GENERICVALUE_VISIBILITY 38 #define GENERICVALUE_VISIBILITY GTSAM_EXPORT 94 void print(
const std::string&
str)
const override {
117 boost::shared_ptr<Value>
clone()
const override {
129 return resultAsValue;
153 size_t dim()
const override {
181 template<
class ARCHIVE>
183 ar & boost::serialization::make_nvp(
"GenericValue",
184 boost::serialization::base_object<Value>(*
this));
185 ar & boost::serialization::make_nvp(
"value", value_);
196 #define GTSAM_VALUE_EXPORT(Type) BOOST_CLASS_EXPORT(gtsam::GenericValue<Type>) 199 template <
typename ValueType>
201 :
public Testable<GenericValue<ValueType> > {};
204 template<
typename ValueType>
Typedefs for easier changing of types.
T value_
The wrapped value.
void print(const std::string &str) const override
Virtual print function, uses traits.
const T & value() const
Return a constant value.
~GenericValue() override
Destructor.
Value * clone_() const override
GenericValue(const T &value)
Construct from value.
#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
friend class boost::serialization::access
void deallocate_() const override
bool equals(const GenericValue &other, double tol=1e-9) const
non virtual equals function, uses traits
STL compatible allocator to use with types requiring a non standrad alignment.
Value & operator=(const Value &rhs) override
Assignment operator.
Base class and basic functions for Manifold types.
std::string demangle(const char *name)
Pretty print Value type name.
Value * retract_(const Vector &delta) const override
Generic Value interface version of retract.
Eigen::Triplet< double > T
virtual Value & operator=(const Value &)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GenericValue< T > genericValue(const T &v)
GenericValue retract(const Vector &delta) const
Non-virtual version of retract.
bool equals_(const Value &p, double tol=1e-9) const override
equals implementing generic Value interface
Vector localCoordinates_(const Value &value2) const override
Generic Value interface version of localCoordinates.
The base class for any variable that can be optimized or used in a factor.
Vector localCoordinates(const GenericValue &value2) const
Non-virtual version of localCoordinates.
boost::shared_ptr< Value > clone() const override
void serialize(ARCHIVE &ar, const unsigned int)
const ValueType & cast() const
T & value()
Return the value.
void Print(const CONTAINER &keys, const string &s, const KeyFormatter &keyFormatter)
size_t dim() const override
Return run-time dimensionality.
GenericValue< T > & operator=(const GenericValue< T > &rhs)