RETURN CONST REFERENCES WHERE YOU CAN and some inlining
parent
dd9446993a
commit
696be0d0c1
|
|
@ -46,9 +46,9 @@ namespace gtsam {
|
|||
}
|
||||
|
||||
/** get functions for x, y, z */
|
||||
double x() const {return x_;}
|
||||
double y() const {return y_;}
|
||||
double z() const {return z_;}
|
||||
inline double x() const {return x_;}
|
||||
inline double y() const {return y_;}
|
||||
inline double z() const {return z_;}
|
||||
|
||||
/** operators */
|
||||
Point3 operator - () const { return Point3(-x_,-y_,-z_);}
|
||||
|
|
|
|||
11
cpp/Pose2.h
11
cpp/Pose2.h
|
|
@ -56,11 +56,12 @@ namespace gtsam {
|
|||
Matrix matrix() const;
|
||||
|
||||
/** get functions for x, y, theta */
|
||||
double x() const { return t_.x(); }
|
||||
double y() const { return t_.y(); }
|
||||
double theta() const { return r_.theta(); }
|
||||
Point2 t() const { return t_; }
|
||||
Rot2 r() const { return r_; }
|
||||
inline double x() const { return t_.x(); }
|
||||
inline double y() const { return t_.y(); }
|
||||
inline double theta() const { return r_.theta(); }
|
||||
|
||||
inline const Point2& t() const { return t_; }
|
||||
inline const Rot2& r() const { return r_; }
|
||||
|
||||
static inline size_t dim() { return 3; };
|
||||
|
||||
|
|
|
|||
10
cpp/Pose3.h
10
cpp/Pose3.h
|
|
@ -43,12 +43,12 @@ namespace gtsam {
|
|||
R_(V(0), V(3), V(6), V(1), V(4), V(7), V(2), V(5), V(8)),
|
||||
t_(V(9), V(10),V(11)) {}
|
||||
|
||||
const Rot3& rotation() const { return R_; }
|
||||
inline const Rot3& rotation() const { return R_; }
|
||||
inline const Point3& translation() const { return t_; }
|
||||
|
||||
const Point3& translation() const { return t_; }
|
||||
double x() const { return t_.x(); }
|
||||
double y() const { return t_.y(); }
|
||||
double z() const { return t_.z(); }
|
||||
inline double x() const { return t_.x(); }
|
||||
inline double y() const { return t_.y(); }
|
||||
inline double z() const { return t_.z(); }
|
||||
|
||||
/** convert to 4*4 matrix */
|
||||
Matrix matrix() const;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,9 @@ namespace gtsam {
|
|||
public:
|
||||
|
||||
/** constructor from cos/sin */
|
||||
Rot2(double c, double s) :
|
||||
inline Rot2(double c, double s) :
|
||||
c_(c), s_(s) {
|
||||
#ifdef ROT2_RENORMALIZE
|
||||
// rtodo: Could do this scale correction only when creating from compose
|
||||
// Don't let scale drift
|
||||
double scale = c*c + s*s;
|
||||
|
|
@ -35,6 +36,7 @@ namespace gtsam {
|
|||
c_ *= scale;
|
||||
s_ *= scale;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/** default constructor, zero rotation */
|
||||
|
|
@ -47,10 +49,10 @@ namespace gtsam {
|
|||
double theta() const { return atan2(s_,c_); }
|
||||
|
||||
/** return cos */
|
||||
double c() const { return c_; }
|
||||
inline double c() const { return c_; }
|
||||
|
||||
/** return sin */
|
||||
double s() const { return s_; }
|
||||
inline double s() const { return s_; }
|
||||
|
||||
/** print */
|
||||
void print(const std::string& s = "theta") const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue