8 #ifndef SWITCHVARIABLELINEAR_H_ 9 #define SWITCHVARIABLELINEAR_H_ 13 #include <gtsam/base/DerivedValue.h> 14 #include <gtsam/base/Lie.h> 36 inline void print(
const std::string& name=
"")
const {
37 std::cout << name <<
": " <<
d_ << std::endl;
42 return fabs(expected.
d_ -
d_) <= tol;
48 inline size_t dim()
const {
return 1; }
49 inline static size_t Dim() {
return 1; }
53 double x =
value() + v(0);
56 else if (x<0.0) x=0.0;
78 boost::optional<gtsam::Matrix&> H1=boost::none,
79 boost::optional<gtsam::Matrix&> H2=boost::none)
const {
80 if(H1) *H1 = -gtsam::eye(1);
81 if(H2) *H2 = gtsam::eye(1);
111 return key1.
equals(key2, tol);
118 ChartJacobian Horigin = boost::none, ChartJacobian Hother = boost::none) {
122 ChartJacobian H1 = boost::none, ChartJacobian H2 = boost::none) {
void print(const std::string &name="") const
SwitchVariableLinear between(const SwitchVariableLinear &l2, boost::optional< gtsam::Matrix & > H1=boost::none, boost::optional< gtsam::Matrix & > H2=boost::none) const
bool equals(const SwitchVariableLinear &expected, double tol=1e-5) const
SwitchVariableLinear retract(const gtsam::Vector &v) const
GLM_FUNC_DECL genType e()
static gtsam::Vector Logmap(const SwitchVariableLinear &p)
SwitchVariableLinear compose(const SwitchVariableLinear &p) const
static vertigo::SwitchVariableLinear Retract(const vertigo::SwitchVariableLinear &g, const TangentVector &v, ChartJacobian H1=boost::none, ChartJacobian H2=boost::none)
static SwitchVariableLinear Expmap(const gtsam::Vector &v)
static void Print(const vertigo::SwitchVariableLinear &key, const std::string &str="")
gtsam::Vector TangentVector
static bool Equals(const vertigo::SwitchVariableLinear &key1, const vertigo::SwitchVariableLinear &key2, double tol=1e-8)
static int GetDimension(const vertigo::SwitchVariableLinear &key)
OptionalJacobian< 3, 3 > ChartJacobian
SwitchVariableLinear inverse() const
static SwitchVariableLinear identity()
gtsam::Vector localCoordinates(const SwitchVariableLinear &t2) const
static TangentVector Local(const vertigo::SwitchVariableLinear &origin, const vertigo::SwitchVariableLinear &other, ChartJacobian Horigin=boost::none, ChartJacobian Hother=boost::none)
SwitchVariableLinear(double d)