28 #ifndef LSST_AFW_GEOM_COORDINATEBASE_H
29 #define LSST_AFW_GEOM_COORDINATEBASE_H
41 template <
typename T,
int N = 2>
43 template <
typename T,
int N = 2>
51 template <
typename Derived,
typename T,
int N>
84 template <
typename Vector>
98 template <
typename Derived,
typename T,
int N>
100 T rtol = static_cast<T>(1E-5), T atol = static_cast<T>(1E-8));
105 template <
typename Derived,
typename T>
141 template <
typename Vector>
150 template <
typename Derived,
typename T>
186 template <
typename Vector>
192 template <
typename Derived,
typename T,
int N>
193 std::ostream& operator<<(std::ostream& os, CoordinateBase<Derived, T, N>
const& coordinate) {
194 os <<
"(" << coordinate[0];
195 for (
int n = 1; n < N; ++n) os <<
", " << coordinate[n];
T const & operator[](int n) const
CoordinateBase(Eigen::MatrixBase< Vector > const &vector)
Initialize all elements from an N-d Eigen vector.
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))
Floating-point comparison with tolerance.
CoordinateBase(T val=static_cast< T >(0))
Eigen::Matrix< T, 2, 1, Eigen::DontAlign > EigenVector
A coordinate class intended to represent offsets and dimensions.
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
A CRTP base class for coordinate objects.
A coordinate class intended to represent absolute positions.
CoordinateBase(Eigen::MatrixBase< Vector > const &vector)
T const & coeffRef(int n) const
T const & coeffRef(int n) const
CoordinateBase(T val=static_cast< T >(0))
void _swap(CoordinateBase &other)
CoordinateBase(T val=static_cast< T >(0))
Initialize all elements to a scalar.
static int const dimensions
std::pair< T, T > asPair() const
Return a std::pair representation of the coordinate object.
T const & operator[](int n) const
void _swap(CoordinateBase &other)
Eigen::Matrix< T, N, 1, Eigen::DontAlign > EigenVector
void _swap(CoordinateBase &other)
Eigen::Matrix< T, 3, 1, Eigen::DontAlign > EigenVector
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
T const & coeffRef(int n) const
T const & operator[](int n) const
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
CoordinateBase(Eigen::MatrixBase< Vector > const &vector)
std::tuple< T, T, T > asTuple() const
Return a std::tuple representation of the coordinate object.
std::tuple< T, T > asTuple() const
Return a std::tuple representation of the coordinate object.