LSST Applications 29.1.0,g0fba68d861+6b120c4394,g123d84c11c+8c5ae1fdc5,g1ec0fe41b4+191117f6ec,g1fd858c14a+c8450ae71a,g3533f9d6cb+a04f9ee0ab,g35bb328faa+8c5ae1fdc5,g3f0dcc2b1b+7df08700bd,g4178042926+b4254969db,g44ba364a48+04455b336b,g53246c7159+8c5ae1fdc5,g60b5630c4e+a04f9ee0ab,g663da51e9b+b05e6e1875,g67b6fd64d1+250bf6acd3,g78460c75b0+7e33a9eb6d,g786e29fd12+668abc6043,g8352419a5c+8c5ae1fdc5,g87e3079a85+d3fa38de54,g8852436030+cd899e2626,g89139ef638+250bf6acd3,g93a033419f+31ead11197,g989de1cb63+250bf6acd3,g9f33ca652e+f6053ecf14,ga1e959baac+5fbc491aed,ga2f891cd6c+a04f9ee0ab,gabe3b4be73+8856018cbb,gabf8522325+1f7e6d67b9,gac2eed3f23+250bf6acd3,gb1101e3267+0c331e9486,gb89ab40317+250bf6acd3,gcf25f946ba+cd899e2626,gd107969129+8964d67276,gd6cbbdb0b4+6bbecc8878,gde0f65d7ad+d65f9e019a,ge278dab8ac+eb3bbeb12f,ge410e46f29+250bf6acd3,gf5e32f922b+8c5ae1fdc5,gff02db199a+747430a128,gffe7e49bb4+a04f9ee0ab
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst::geom::Extent< T, 3 > Class Template Reference

A coordinate class intended to represent offsets and dimensions (3-d specialization). More...

#include <Extent.h>

Inheritance diagram for lsst::geom::Extent< T, 3 >:
lsst::geom::ExtentBase< T, N > lsst::geom::ExtentBase< T, 3 > lsst::geom::CoordinateBase< Extent< T, N >, T, N > lsst::geom::CoordinateBase< Extent< T, N >, T, N >

Public Types

typedef Super::EigenVector EigenVector
 
typedef Super::EigenVector EigenVector
 
typedef T Element
 

Public Member Functions

 Extent (T val=static_cast< T >(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Construct an Extent with all elements set to the same scalar value.
 
 Extent (EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Construct an Extent from an Eigen vector.
 
 Extent (Point< T, 3 > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Explicit constructor from Point.
 
template<typename U>
 Extent (Extent< U, 3 > const &other) noexcept(IS_NOTHROW_CONVERTIBLE< T, U >)
 Explicit constructor from Extent of different type (if allowed)
 
template<typename U>
 Extent (Point< U, 3 > const &other) noexcept(IS_NOTHROW_CONVERTIBLE< T, U >)
 
 Extent (T x, T y, T z) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Construct from three scalars.
 
 Extent (T const xyz[3]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Construct from a three-element array.
 
 Extent (std::tuple< T, T, T > const &xyz) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Construct from std::tuple.
 
 Extent (Extent const &other)=default
 
 Extent (Extent &&other)=default
 
 ~Extent ()=default
 
Extentoperator= (Extent const &other)=default
 
Extentoperator= (Extent &&other)=default
 
void swap (Extent &other) noexcept
 
 Extent (T val=static_cast< T >(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Construct an Extent with all elements set to the same scalar value.
 
 Extent (EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Construct an Extent from an Eigen vector.
 
 Extent (Point< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Explicit constructor from Point.
 
 Extent (Extent< U, N > const &other) noexcept(IS_NOTHROW_CONVERTIBLE< T, U >)
 Explicit constructor from Extent of different type (if allowed)
 
 Extent (Point< U, N > const &other) noexcept(IS_NOTHROW_CONVERTIBLE< T, U >)
 
 Extent (Extent const &other)=default
 
 Extent (Extent &&other)=default
 
 ~Extent ()=default
 
Extentoperator= (Extent const &other)=default
 
Extentoperator= (Extent &&other)=default
 
computeSquaredNorm () const
 Return the squared L2 norm of the Extent (x^2 + y^2 + ...).
 
computeNorm () const
 Return the L2 norm of the Extent (sqrt(x^2 + y^2 + ...)).
 
void swap (Extent &other) noexcept
 
bool operator== (Extent< T, N > const &other) const noexcept
 Standard equality comparison.
 
bool operator!= (Extent< T, N > const &other) const noexcept
 Standard inequality comparison.
 
T & operator[] (int n)
 
T const & operator[] (int n) const
 
T & operator[] (int n)
 
T const & operator[] (int n) const
 
T & coeffRef (int n)
 
T const & coeffRef (int n) const
 
T & coeffRef (int n)
 
T const & coeffRef (int n) const
 
EigenVector const & asEigen () const noexcept(IS_ELEMENT_NOTHROW_COPYABLE)
 Return a fixed-size Eigen representation of the coordinate object.
 
EigenVector const & asEigen () const noexcept(IS_ELEMENT_NOTHROW_COPYABLE)
 Return a fixed-size Eigen representation of the coordinate object.
 
Named comparison functions

Note that these return CoordinateExpr, not bool.

Unlike most arithmetic and assignment operators, scalar interoperability is provided for comparisons; expressions like

if (all(extent.gt(0))) ...

are both ubiquitous and easy to interpret.

CoordinateExpr< N > eq (Extent< T, N > const &other) const noexcept
 
CoordinateExpr< N > eq (T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
CoordinateExpr< N > ne (Extent< T, N > const &other) const noexcept
 
CoordinateExpr< N > ne (T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
CoordinateExpr< N > lt (Extent< T, N > const &other) const noexcept
 
CoordinateExpr< N > lt (T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
CoordinateExpr< N > le (Extent< T, N > const &other) const noexcept
 
CoordinateExpr< N > le (T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
CoordinateExpr< N > gt (Extent< T, N > const &other) const noexcept
 
CoordinateExpr< N > gt (T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
CoordinateExpr< N > ge (Extent< T, N > const &other) const noexcept
 
CoordinateExpr< N > ge (T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
Additive arithmetic operators

No scalar interoperability is provided for Extent additive arithmetic operations.

Point< T, N > operator+ (Point< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
Extent< T, N > operator+ (Extent< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
Extent< T, N > operator+ () const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
Extent< T, N > operator- (Extent< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
Extent< T, N > operator- () const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 
Extent< T, N > & operator+= (Extent< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
 
Extent< T, N > & operator-= (Extent< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
 
Multiplicative arithmetic operators

As usual with matrices and vectors, Extent can be multiplied or divided by a scalar.

Extent< T, N > operator* (T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Cast this object to an Extent of the same numeric type and dimensionality.
 
Extent< T, N > & operator*= (T scalar) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
 Cast this object to an Extent of the same numeric type and dimensionality.
 
Extent< T, N > operator/ (T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Cast this object to an Extent of the same numeric type and dimensionality.
 
Extent< T, N > & operator/= (T scalar) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
 Cast this object to an Extent of the same numeric type and dimensionality.
 
Point< T, N > asPoint () const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
 Cast this object to an Extent of the same numeric type and dimensionality.
 
std::string toString () const
 Cast this object to an Extent of the same numeric type and dimensionality.
 

Static Public Attributes

static int const dimensions
 
static int const dimensions
 
static bool constexpr IS_ELEMENT_NOTHROW_COPYABLE
 
static bool constexpr IS_ELEMENT_NOTHROW_COPYABLE
 
static bool constexpr IS_ELEMENT_NOTHROW_ASSIGNABLE
 
static bool constexpr IS_ELEMENT_NOTHROW_ASSIGNABLE
 

Protected Member Functions

void _swap (CoordinateBase &other) noexcept
 
void _swap (CoordinateBase &other) noexcept
 

Protected Attributes

EigenVector _vector
 
EigenVector _vector
 

Related Symbols

(Note that these are not member symbols.)

bool allclose (CoordinateBase< Extent< T, N >, T, N > const &a, CoordinateBase< Extent< T, N >, T, N > const &b, T rtol=static_cast< T >(1E-5), T atol=static_cast< T >(1E-8)) noexcept(std::is_nothrow_copy_constructible< T >::value &&std::is_nothrow_copy_assignable< T >::value)
 Floating-point comparison with tolerance.
 
bool allclose (CoordinateBase< Extent< T, N >, T, N > const &a, CoordinateBase< Extent< T, N >, T, N > const &b, T rtol=static_cast< T >(1E-5), T atol=static_cast< T >(1E-8)) noexcept(std::is_nothrow_copy_constructible< T >::value &&std::is_nothrow_copy_assignable< T >::value)
 Floating-point comparison with tolerance.
 

Detailed Description

template<typename T>
class lsst::geom::Extent< T, 3 >

A coordinate class intended to represent offsets and dimensions (3-d specialization).

See geomOps for mathematical operators on Extent.

Definition at line 307 of file Extent.h.

Member Typedef Documentation

◆ EigenVector [1/2]

typedef Super::EigenVector lsst::geom::Extent< T, N >::EigenVector

Definition at line 214 of file Extent.h.

◆ EigenVector [2/2]

template<typename T>
typedef Super::EigenVector lsst::geom::Extent< T, 3 >::EigenVector

Definition at line 311 of file Extent.h.

◆ Element

typedef T lsst::geom::CoordinateBase< Extent< T, N >, T, N >::Element

Definition at line 57 of file CoordinateBase.h.

Constructor & Destructor Documentation

◆ Extent() [1/17]

template<typename T>
lsst::geom::Extent< T, 3 >::Extent ( T val = static_cast<T>(0))
inlineexplicitnoexcept

Construct an Extent with all elements set to the same scalar value.

Definition at line 314 of file Extent.h.

314: Super(val) {}
A coordinate class intended to represent offsets and dimensions.
Definition Extent.h:210

◆ Extent() [2/17]

template<typename T>
lsst::geom::Extent< T, 3 >::Extent ( EigenVector const & vector)
inlineexplicitnoexcept

Construct an Extent from an Eigen vector.

Definition at line 317 of file Extent.h.

317: Super(vector) {}

◆ Extent() [3/17]

template<typename T>
lsst::geom::Extent< T, 3 >::Extent ( Point< T, 3 > const & other)
explicitnoexcept

Explicit constructor from Point.

◆ Extent() [4/17]

template<typename T>
template<typename U>
lsst::geom::Extent< T, 3 >::Extent ( Extent< U, 3 > const & other)
explicitnoexcept

Explicit constructor from Extent of different type (if allowed)

Definition at line 373 of file Extent.h.

373 {
375 "can only construct from Extent of different but integral type");
376 this->setX(static_cast<T>(other.getX()));
377 this->setY(static_cast<T>(other.getY()));
378 this->setZ(static_cast<T>(other.getZ()));
379};

◆ Extent() [5/17]

template<typename T>
template<typename U>
lsst::geom::Extent< T, 3 >::Extent ( Point< U, 3 > const & other)
explicitnoexcept

Definition at line 384 of file Extent.h.

384 {
386 "can only construct from Extent of different but integral type");
387 this->setX(static_cast<T>(other.getX()));
388 this->setY(static_cast<T>(other.getY()));
389 this->setZ(static_cast<T>(other.getZ()));
390};

◆ Extent() [6/17]

template<typename T>
lsst::geom::Extent< T, 3 >::Extent ( T x,
T y,
T z )
inlineexplicitnoexcept

Construct from three scalars.

Definition at line 329 of file Extent.h.

330 : Super(EigenVector(x, y, z)) {}
Super::EigenVector EigenVector
Definition Extent.h:311

◆ Extent() [7/17]

template<typename T>
lsst::geom::Extent< T, 3 >::Extent ( T const xyz[3])
inlineexplicitnoexcept

Construct from a three-element array.

Definition at line 333 of file Extent.h.

334 : Super(EigenVector(xyz[0], xyz[1], xyz[2])) {}

◆ Extent() [8/17]

template<typename T>
lsst::geom::Extent< T, 3 >::Extent ( std::tuple< T, T, T > const & xyz)
inlineexplicitnoexcept

Construct from std::tuple.

Definition at line 337 of file Extent.h.

◆ Extent() [9/17]

template<typename T>
lsst::geom::Extent< T, 3 >::Extent ( Extent< T, 3 > const & other)
default

◆ Extent() [10/17]

template<typename T>
lsst::geom::Extent< T, 3 >::Extent ( Extent< T, 3 > && other)
default

◆ ~Extent() [1/2]

template<typename T>
lsst::geom::Extent< T, 3 >::~Extent ( )
default

◆ Extent() [11/17]

lsst::geom::Extent< T, N >::Extent ( T val = static_cast<T>(0))
inlineexplicitnoexcept

Construct an Extent with all elements set to the same scalar value.

Definition at line 217 of file Extent.h.

217: Super(val) {}

◆ Extent() [12/17]

lsst::geom::Extent< T, N >::Extent ( EigenVector const & vector)
inlineexplicitnoexcept

Construct an Extent from an Eigen vector.

Definition at line 220 of file Extent.h.

220: Super(vector) {}

◆ Extent() [13/17]

lsst::geom::Extent< T, N >::Extent ( Point< T, N > const & other)
explicitnoexcept

Explicit constructor from Point.

Definition at line 223 of file Extent.cc.

32 : Super(other.asEigen()) {}
EigenVector const & asEigen() const noexcept(IS_ELEMENT_NOTHROW_COPYABLE)
Return a fixed-size Eigen representation of the coordinate object.

◆ Extent() [14/17]

lsst::geom::Extent< T, N >::Extent ( Extent< U, N > const & other)
explicitnoexcept

Explicit constructor from Extent of different type (if allowed)

◆ Extent() [15/17]

lsst::geom::Extent< T, N >::Extent ( Point< U, N > const & other)
explicitnoexcept

◆ Extent() [16/17]

lsst::geom::Extent< T, N >::Extent ( Extent< T, 3 > const & other)
default

◆ Extent() [17/17]

lsst::geom::Extent< T, N >::Extent ( Extent< T, 3 > && other)
default

◆ ~Extent() [2/2]

lsst::geom::Extent< T, N >::~Extent ( )
default

Member Function Documentation

◆ _swap() [1/2]

void lsst::geom::CoordinateBase< Extent< T, N >, T, N >::_swap ( CoordinateBase & other)
inlineprotectednoexcept

Definition at line 108 of file CoordinateBase.h.

◆ _swap() [2/2]

void lsst::geom::CoordinateBase< Extent< T, N >, T, N >::_swap ( CoordinateBase & other)
inlineprotectednoexcept

Definition at line 108 of file CoordinateBase.h.

108{ _vector.swap(other._vector); }

◆ asEigen() [1/2]

EigenVector const & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::asEigen ( ) const
inlinenoexcept

Return a fixed-size Eigen representation of the coordinate object.

The fact that this returns by const reference rather than by value should not be considered part of the API; this is merely an optimization enabled by the implementation.

Definition at line 89 of file CoordinateBase.h.

89{ return _vector; }

◆ asEigen() [2/2]

EigenVector const & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::asEigen ( ) const
inlinenoexcept

Return a fixed-size Eigen representation of the coordinate object.

The fact that this returns by const reference rather than by value should not be considered part of the API; this is merely an optimization enabled by the implementation.

Definition at line 89 of file CoordinateBase.h.

89{ return _vector; }

◆ asPoint()

Point< T, N > lsst::geom::ExtentBase< T, N >::asPoint ( ) const
noexcept

Cast this object to an Extent of the same numeric type and dimensionality.

Definition at line 177 of file Extent.cc.

89 {
90 return Point<T, N>(static_cast<Extent<T, N> const &>(*this));
91}

◆ coeffRef() [1/4]

T & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::coeffRef ( int n)
inline

Definition at line 80 of file CoordinateBase.h.

80{ return _vector.coeffRef(n); }

◆ coeffRef() [2/4]

T & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::coeffRef ( int n)
inline

Definition at line 80 of file CoordinateBase.h.

80{ return _vector.coeffRef(n); }

◆ coeffRef() [3/4]

T const & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::coeffRef ( int n) const
inline

Definition at line 81 of file CoordinateBase.h.

81{ return const_cast<EigenVector&>(_vector).coeffRef(n); }

◆ coeffRef() [4/4]

T const & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::coeffRef ( int n) const
inline

Definition at line 81 of file CoordinateBase.h.

81{ return const_cast<EigenVector&>(_vector).coeffRef(n); }

◆ computeNorm()

T lsst::geom::Extent< T, N >::computeNorm ( ) const
inline

Return the L2 norm of the Extent (sqrt(x^2 + y^2 + ...)).

Definition at line 243 of file Extent.h.

243{ return this->asEigen().norm(); }

◆ computeSquaredNorm()

T lsst::geom::Extent< T, N >::computeSquaredNorm ( ) const
inline

Return the squared L2 norm of the Extent (x^2 + y^2 + ...).

Definition at line 240 of file Extent.h.

240{ return this->asEigen().squaredNorm(); }

◆ eq() [1/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::eq ( Extent< T, N > const & other) const
noexcept

Definition at line 99 of file Extent.cc.

47 {
49 for (int n = 0; n < N; ++n) r[n] = this->_vector[n] == other[n];
50 return r;
51}

◆ eq() [2/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::eq ( T scalar) const
inlinenoexcept

Definition at line 105 of file Extent.h.

105 {
106 return this->eq(Extent<T, N>(scalar));
107 }
CoordinateExpr< N > eq(Extent< T, N > const &other) const noexcept
Definition Extent.cc:47

◆ ge() [1/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::ge ( Extent< T, N > const & other) const
noexcept

Definition at line 104 of file Extent.cc.

82 {
84 for (int n = 0; n < N; ++n) r[n] = this->_vector[n] >= other[n];
85 return r;
86}

◆ ge() [2/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::ge ( T scalar) const
inlinenoexcept

Definition at line 120 of file Extent.h.

120 {
121 return this->ge(Extent<T, N>(scalar));
122 }
CoordinateExpr< N > ge(Extent< T, N > const &other) const noexcept
Definition Extent.cc:82

◆ gt() [1/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::gt ( Extent< T, N > const & other) const
noexcept

Definition at line 103 of file Extent.cc.

75 {
77 for (int n = 0; n < N; ++n) r[n] = this->_vector[n] > other[n];
78 return r;
79}

◆ gt() [2/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::gt ( T scalar) const
inlinenoexcept

Definition at line 117 of file Extent.h.

117 {
118 return this->gt(Extent<T, N>(scalar));
119 }
CoordinateExpr< N > gt(Extent< T, N > const &other) const noexcept
Definition Extent.cc:75

◆ le() [1/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::le ( Extent< T, N > const & other) const
noexcept

Definition at line 102 of file Extent.cc.

68 {
70 for (int n = 0; n < N; ++n) r[n] = this->_vector[n] <= other[n];
71 return r;
72}

◆ le() [2/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::le ( T scalar) const
inlinenoexcept

Definition at line 114 of file Extent.h.

114 {
115 return this->le(Extent<T, N>(scalar));
116 }
CoordinateExpr< N > le(Extent< T, N > const &other) const noexcept
Definition Extent.cc:68

◆ lt() [1/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::lt ( Extent< T, N > const & other) const
noexcept

Definition at line 101 of file Extent.cc.

61 {
63 for (int n = 0; n < N; ++n) r[n] = this->_vector[n] < other[n];
64 return r;
65}

◆ lt() [2/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::lt ( T scalar) const
inlinenoexcept

Definition at line 111 of file Extent.h.

111 {
112 return this->lt(Extent<T, N>(scalar));
113 }
CoordinateExpr< N > lt(Extent< T, N > const &other) const noexcept
Definition Extent.cc:61

◆ ne() [1/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::ne ( Extent< T, N > const & other) const
noexcept

Definition at line 100 of file Extent.cc.

54 {
56 for (int n = 0; n < N; ++n) r[n] = this->_vector[n] != other[n];
57 return r;
58}

◆ ne() [2/2]

CoordinateExpr< N > lsst::geom::ExtentBase< T, N >::ne ( T scalar) const
inlinenoexcept

Definition at line 108 of file Extent.h.

108 {
109 return this->ne(Extent<T, N>(scalar));
110 }
CoordinateExpr< N > ne(Extent< T, N > const &other) const noexcept
Definition Extent.cc:54

◆ operator!=()

bool lsst::geom::ExtentBase< T, N >::operator!= ( Extent< T, N > const & other) const
inlinenoexcept

Standard inequality comparison.

Returns true iff any(this->ne(other));

Definition at line 84 of file Extent.h.

84{ return any(this->ne(other)); }
bool any(CoordinateExpr< N > const &expr) noexcept
Return true if any elements are true.

◆ operator*()

Extent< T, N > lsst::geom::ExtentBase< T, N >::operator* ( T scalar) const
inlinenoexcept

Cast this object to an Extent of the same numeric type and dimensionality.

Definition at line 160 of file Extent.h.

160 {
161 return Extent<T, N>(this->_vector * scalar);
162 }
Extent(T val=static_cast< T >(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct an Extent with all elements set to the same scalar value.
Definition Extent.h:314

◆ operator*=()

Extent< T, N > & lsst::geom::ExtentBase< T, N >::operator*= ( T scalar)
inlinenoexcept

Cast this object to an Extent of the same numeric type and dimensionality.

Definition at line 163 of file Extent.h.

163 {
164 this->_vector *= scalar;
165 return static_cast<Extent<T, N> &>(*this);
166 }

◆ operator+() [1/3]

Extent< T, N > lsst::geom::ExtentBase< T, N >::operator+ ( ) const
inlinenoexcept

Definition at line 146 of file Extent.h.

146 {
147 return static_cast<Extent<T, N> const &>(*this);
148 }

◆ operator+() [2/3]

Extent< T, N > lsst::geom::ExtentBase< T, N >::operator+ ( Extent< T, N > const & other) const
inlinenoexcept

Definition at line 132 of file Extent.h.

132 {
133 return Extent<T, N>(this->_vector + other._vector);
134 }

◆ operator+() [3/3]

Point< T, N > lsst::geom::ExtentBase< T, N >::operator+ ( Point< T, N > const & other) const
noexcept

Definition at line 131 of file Extent.cc.

95 {
96 return Point<T, N>(this->_vector + other.asEigen());
97}

◆ operator+=()

Extent< T, N > & lsst::geom::ExtentBase< T, N >::operator+= ( Extent< T, N > const & other)
inlinenoexcept

Definition at line 138 of file Extent.h.

138 {
139 this->_vector += other._vector;
140 return static_cast<Extent<T, N> &>(*this);
141 }

◆ operator-() [1/2]

Extent< T, N > lsst::geom::ExtentBase< T, N >::operator- ( ) const
inlinenoexcept

Definition at line 149 of file Extent.h.

149 {
150 return Extent<T, N>(-this->_vector);
151 }

◆ operator-() [2/2]

Extent< T, N > lsst::geom::ExtentBase< T, N >::operator- ( Extent< T, N > const & other) const
inlinenoexcept

Definition at line 135 of file Extent.h.

135 {
136 return Extent<T, N>(this->_vector - other._vector);
137 }

◆ operator-=()

Extent< T, N > & lsst::geom::ExtentBase< T, N >::operator-= ( Extent< T, N > const & other)
inlinenoexcept

Definition at line 142 of file Extent.h.

142 {
143 this->_vector -= other._vector;
144 return static_cast<Extent<T, N> &>(*this);
145 }

◆ operator/()

Extent< T, N > lsst::geom::ExtentBase< T, N >::operator/ ( T scalar) const
inlinenoexcept

Cast this object to an Extent of the same numeric type and dimensionality.

Definition at line 167 of file Extent.h.

167 {
168 return Extent<T, N>(this->_vector / scalar);
169 }

◆ operator/=()

Extent< T, N > & lsst::geom::ExtentBase< T, N >::operator/= ( T scalar)
inlinenoexcept

Cast this object to an Extent of the same numeric type and dimensionality.

Definition at line 170 of file Extent.h.

170 {
171 this->_vector /= scalar;
172 return static_cast<Extent<T, N> &>(*this);
173 }

◆ operator=() [1/4]

Extent & lsst::geom::Extent< T, N >::operator= ( Extent< T, 3 > && other)
default

◆ operator=() [2/4]

template<typename T>
Extent & lsst::geom::Extent< T, 3 >::operator= ( Extent< T, 3 > && other)
default

◆ operator=() [3/4]

Extent & lsst::geom::Extent< T, N >::operator= ( Extent< T, 3 > const & other)
default

◆ operator=() [4/4]

template<typename T>
Extent & lsst::geom::Extent< T, 3 >::operator= ( Extent< T, 3 > const & other)
default

◆ operator==()

bool lsst::geom::ExtentBase< T, N >::operator== ( Extent< T, N > const & other) const
inlinenoexcept

Standard equality comparison.

Returns true iff all(this->eq(other));

Definition at line 77 of file Extent.h.

77{ return all(this->eq(other)); }
bool all(CoordinateExpr< N > const &expr) noexcept
Return true if all elements are true.

◆ operator[]() [1/4]

T & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::operator[] ( int n)
inline

Definition at line 78 of file CoordinateBase.h.

78{ return _vector[n]; }

◆ operator[]() [2/4]

T & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::operator[] ( int n)
inline

Definition at line 78 of file CoordinateBase.h.

78{ return _vector[n]; }

◆ operator[]() [3/4]

T const & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::operator[] ( int n) const
inline

Definition at line 79 of file CoordinateBase.h.

79{ return const_cast<EigenVector&>(_vector)[n]; }

◆ operator[]() [4/4]

T const & lsst::geom::CoordinateBase< Extent< T, N >, T, N >::operator[] ( int n) const
inline

Definition at line 79 of file CoordinateBase.h.

79{ return const_cast<EigenVector&>(_vector)[n]; }

◆ swap() [1/2]

void lsst::geom::Extent< T, N >::swap ( Extent< T, 3 > & other)
inlinenoexcept

Definition at line 245 of file Extent.h.

245{ this->_swap(other); }
void _swap(CoordinateBase &other) noexcept

◆ swap() [2/2]

template<typename T>
void lsst::geom::Extent< T, 3 >::swap ( Extent< T, 3 > & other)
inlinenoexcept

Definition at line 348 of file Extent.h.

348{ this->_swap(other); }

◆ toString()

std::string lsst::geom::ExtentBase< T, N >::toString ( ) const
inline

Cast this object to an Extent of the same numeric type and dimensionality.

Definition at line 179 of file Extent.h.

179 {
181 out << "Extent(";
182 for (size_t i = 0; i < N; ++i) {
183 if (i != 0) {
184 out << ",";
185 }
186 out << (*this)[i];
187 }
188 out << ")";
189 return out.str();
190 }

Friends And Related Symbol Documentation

◆ allclose() [1/2]

bool allclose ( CoordinateBase< Extent< T, N >, T, N > const & a,
CoordinateBase< Extent< T, N >, T, N > const & b,
T rtol = static_cast<T>(1E-5),
T atol = static_cast<T>(1E-8) )
related

Floating-point comparison with tolerance.

Interface, naming, and default tolerances matches Numpy.

Definition at line 120 of file CoordinateBase.cc.

32 {
33 Eigen::Array<T, N, 1> diff = (a.asEigen().array() - b.asEigen().array()).abs();
34 Eigen::Array<T, N, 1> rhs = (0.5 * (a.asEigen().array() + b.asEigen().array())).abs();
35 rhs *= rtol;
36 rhs += atol;
37 return (diff <= rhs).all();
38}

◆ allclose() [2/2]

bool allclose ( CoordinateBase< Extent< T, N >, T, N > const & a,
CoordinateBase< Extent< T, N >, T, N > const & b,
T rtol = static_cast<T>(1E-5),
T atol = static_cast<T>(1E-8) )
related

Floating-point comparison with tolerance.

Interface, naming, and default tolerances matches Numpy.

Definition at line 120 of file CoordinateBase.cc.

32 {
33 Eigen::Array<T, N, 1> diff = (a.asEigen().array() - b.asEigen().array()).abs();
34 Eigen::Array<T, N, 1> rhs = (0.5 * (a.asEigen().array() + b.asEigen().array())).abs();
35 rhs *= rtol;
36 rhs += atol;
37 return (diff <= rhs).all();
38}

Member Data Documentation

◆ _vector [1/2]

EigenVector lsst::geom::CoordinateBase< Extent< T, N >, T, N >::_vector
protected

Definition at line 109 of file CoordinateBase.h.

◆ _vector [2/2]

EigenVector lsst::geom::CoordinateBase< Extent< T, N >, T, N >::_vector
protected

Definition at line 109 of file CoordinateBase.h.

◆ dimensions [1/2]

int const lsst::geom::CoordinateBase< Extent< T, N >, T, N >::dimensions
static

Definition at line 58 of file CoordinateBase.h.

◆ dimensions [2/2]

int const lsst::geom::CoordinateBase< Extent< T, N >, T, N >::dimensions
static

Definition at line 58 of file CoordinateBase.h.

◆ IS_ELEMENT_NOTHROW_ASSIGNABLE [1/2]

bool constexpr lsst::geom::CoordinateBase< Extent< T, N >, T, N >::IS_ELEMENT_NOTHROW_ASSIGNABLE
staticconstexpr

Definition at line 61 of file CoordinateBase.h.

◆ IS_ELEMENT_NOTHROW_ASSIGNABLE [2/2]

bool constexpr lsst::geom::CoordinateBase< Extent< T, N >, T, N >::IS_ELEMENT_NOTHROW_ASSIGNABLE
staticconstexpr

Definition at line 61 of file CoordinateBase.h.

◆ IS_ELEMENT_NOTHROW_COPYABLE [1/2]

bool constexpr lsst::geom::CoordinateBase< Extent< T, N >, T, N >::IS_ELEMENT_NOTHROW_COPYABLE
staticconstexpr

Definition at line 60 of file CoordinateBase.h.

◆ IS_ELEMENT_NOTHROW_COPYABLE [2/2]

bool constexpr lsst::geom::CoordinateBase< Extent< T, N >, T, N >::IS_ELEMENT_NOTHROW_COPYABLE
staticconstexpr

Definition at line 60 of file CoordinateBase.h.


The documentation for this class was generated from the following files: