29 #ifndef LSST_AFW_GEOM_COORDINATEBASE_H
30 #define LSST_AFW_GEOM_COORDINATEBASE_H
36 #include "boost/tuple/tuple.hpp"
38 namespace lsst {
namespace afw {
namespace geom {
40 template <
typename T,
int N=2>
class Point;
41 template <
typename T,
int N=2>
class Extent;
48 template <
typename Derived,
typename T,
int N>
85 template <
typename Vector>
92 template <
typename Derived,
typename T,
int N>
95 T rtol = static_cast<T>(1E-5),
96 T atol = static_cast<T>(1E-8)
102 template <
typename Derived,
typename T>
141 template <
typename Vector>
150 template <
typename Derived,
typename T>
192 template <
typename Vector>
198 template <
typename Derived,
typename T,
int N>
199 std::ostream & operator<<(std::ostream & os, CoordinateBase<Derived,T,N>
const & coordinate) {
200 os <<
"(" << coordinate[0];
201 for (
int n=1; n<N; ++n) os <<
", " << coordinate[n];
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
static int const dimensions
T const & operator[](int n) const
boost::tuple< T, T, T > asTuple() const
Return a boost::tuple representation of the coordinate object.
Eigen::Matrix< T, 3, 1, Eigen::DontAlign > EigenVector
A coordinate class intended to represent offsets and dimensions.
boost::tuple< T, T > asTuple() const
Return a boost::tuple representation of the coordinate object.
void _swap(CoordinateBase &other)
T const & coeffRef(int n) const
A CRTP base class for coordinate objects.
void _swap(CoordinateBase &other)
T const & coeffRef(int n) const
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
CoordinateBase(Eigen::MatrixBase< Vector > const &vector)
void _swap(CoordinateBase &other)
bool allclose(CoordinateBase< Derived, T, N > const &a, CoordinateBase< Derived, T, N > const &b, T rtol=static_cast< T >(1E-5), T atol=static_cast< T >(1E-8))
std::pair< T, T > asPair() const
Return a std::pair representation of the coordinate object.
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
Eigen::Matrix< T, 2, 1, Eigen::DontAlign > EigenVector
T const & coeffRef(int n) const
CoordinateBase(Eigen::MatrixBase< Vector > const &vector)
Initialize all elements from an N-d Eigen vector.
T const & operator[](int n) const
CoordinateBase(T val=static_cast< T >(0))
CoordinateBase(Eigen::MatrixBase< Vector > const &vector)
afw::table::Key< double > b
Eigen::Matrix< T, N, 1, Eigen::DontAlign > EigenVector
T const & operator[](int n) const
CoordinateBase(T val=static_cast< T >(0))
Initialize all elements to a scalar.
CoordinateBase(T val=static_cast< T >(0))