Fixed up Doxygen groups

release/4.3a0
Richard Roberts 2012-12-19 02:53:38 +00:00
parent 93b59990e3
commit c713e52355
1 changed files with 33 additions and 12 deletions

View File

@ -31,6 +31,9 @@ namespace gtsam {
*/ */
struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> { struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> {
/// @name Constructors
/// @{
/** default constructor - should be unnecessary */ /** default constructor - should be unnecessary */
LieMatrix() {} LieMatrix() {}
@ -48,10 +51,9 @@ struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> {
/** Specify arguments directly, as in Matrix_() - always force these to be doubles */ /** Specify arguments directly, as in Matrix_() - always force these to be doubles */
LieMatrix(size_t m, size_t n, ...); LieMatrix(size_t m, size_t n, ...);
/** get the underlying vector */ /// @}
inline Matrix matrix() const { /// @name Testable interface
return static_cast<Matrix>(*this); /// @{
}
/** print @param s optional string naming the object */ /** print @param s optional string naming the object */
inline void print(const std::string& name="") const { inline void print(const std::string& name="") const {
@ -63,7 +65,18 @@ struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> {
return gtsam::equal_with_abs_tol(matrix(), expected.matrix(), tol); return gtsam::equal_with_abs_tol(matrix(), expected.matrix(), tol);
} }
// Manifold requirements /// @}
/// @name Standard Interface
/// @{
/** get the underlying vector */
inline Matrix matrix() const {
return static_cast<Matrix>(*this);
}
/// @}
/// @name Manifold interface
/// @{
/** Returns dimensionality of the tangent space */ /** Returns dimensionality of the tangent space */
inline size_t dim() const { return this->size(); } inline size_t dim() const { return this->size(); }
@ -72,22 +85,26 @@ struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> {
* tangent space vector correspond to the matrix entries arranged in * tangent space vector correspond to the matrix entries arranged in
* *row-major* order. */ * *row-major* order. */
inline LieMatrix retract(const Vector& v) const { inline LieMatrix retract(const Vector& v) const {
if(v.size() != this->rows() * this->cols()) if(v.size() != this->size())
throw std::invalid_argument("LieMatrix::retract called with Vector of incorrect size"); throw std::invalid_argument("LieMatrix::retract called with Vector of incorrect size");
return LieMatrix(*this + Eigen::Map<const Matrix>(&v(0), this->cols(), this->rows()).transpose()); return LieMatrix(*this +
Eigen::Map<const Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> >(
&v(0), this->rows(), this->cols()));
} }
/** @return the local coordinates of another object. The elements of the /** @return the local coordinates of another object. The elements of the
* tangent space vector correspond to the matrix entries arranged in * tangent space vector correspond to the matrix entries arranged in
* *row-major* order. */ * *row-major* order. */
inline Vector localCoordinates(const LieMatrix& t2) const { inline Vector localCoordinates(const LieMatrix& t2) const {
Vector result(this->rows() * this->cols()); Vector result(this->size());
Eigen::Map<Matrix>(&result(0), this->cols(), this->rows()).transpose() = Eigen::Map<Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> >(
(t2 - *this); &result(0), this->rows(), this->cols()) = t2 - *this;
return result; return result;
} }
// Group requirements /// @}
/// @name Group interface
/// @{
/** identity - NOTE: no known size at compile time - so zero length */ /** identity - NOTE: no known size at compile time - so zero length */
inline static LieMatrix identity() { inline static LieMatrix identity() {
@ -125,7 +142,9 @@ struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> {
return LieMatrix(-(*this)); return LieMatrix(-(*this));
} }
// Lie functions /// @}
/// @name Lie group interface
/// @{
/** Expmap around identity */ /** Expmap around identity */
static inline LieMatrix Expmap(const Vector& v) { static inline LieMatrix Expmap(const Vector& v) {
@ -136,6 +155,8 @@ struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> {
static inline Vector Logmap(const LieMatrix& p) { static inline Vector Logmap(const LieMatrix& p) {
return Eigen::Map<const Vector>(&p(0,0), p.dim()); } return Eigen::Map<const Vector>(&p(0,0), p.dim()); }
/// @}
private: private:
// Serialization function // Serialization function