LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
Extent.h
Go to the documentation of this file.
1/*
2 * Developed for the LSST Data Management System.
3 * This product includes software developed by the LSST Project
4 * (https://www.lsst.org).
5 * See the COPYRIGHT file at the top-level directory of this distribution
6 * for details of code ownership.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22/*
23 * A coordinate class intended to represent offsets and dimensions.
24 */
25#ifndef LSST_GEOM_EXTENT_H
26#define LSST_GEOM_EXTENT_H
27
28#include <tuple>
29#include <type_traits>
30
31#include "lsst/pex/exceptions.h"
33
34namespace lsst {
35namespace geom {
36
37// These are present to avoid a static assertion for instantiating computeNorm() on integer types.
38namespace detail {
39
40template <int N>
42 return s.asEigen().norm();
43}
44
45template <int N>
47 throw LSST_EXCEPT(pex::exceptions::LogicError, "Cannot compute norm of integer extent");
48#if 1 // make compilers happy in non-void function
49 return -1;
50#endif
51}
52
53} // namespace detail
54
55template <typename T, int N>
56class ExtentBase : public CoordinateBase<Extent<T, N>, T, N> {
58
59public:
60 ExtentBase(ExtentBase const &) = default;
61 ExtentBase(ExtentBase &&) = default;
62 ExtentBase &operator=(ExtentBase const &) = default;
64 ~ExtentBase() = default;
65
67 T computeSquaredNorm() const { return this->asEigen().squaredNorm(); }
68
70 T computeNorm() const { return detail::computeExtentNorm(static_cast<Extent<T, N> const &>(*this)); }
71
77 bool operator==(Extent<T, N> const &other) const noexcept { return all(this->eq(other)); }
78
84 bool operator!=(Extent<T, N> const &other) const noexcept { return any(this->ne(other)); }
85
99 CoordinateExpr<N> eq(Extent<T, N> const &other) const noexcept;
100 CoordinateExpr<N> ne(Extent<T, N> const &other) const noexcept;
101 CoordinateExpr<N> lt(Extent<T, N> const &other) const noexcept;
102 CoordinateExpr<N> le(Extent<T, N> const &other) const noexcept;
103 CoordinateExpr<N> gt(Extent<T, N> const &other) const noexcept;
104 CoordinateExpr<N> ge(Extent<T, N> const &other) const noexcept;
106 return this->eq(Extent<T, N>(scalar));
107 }
109 return this->ne(Extent<T, N>(scalar));
110 }
112 return this->lt(Extent<T, N>(scalar));
113 }
115 return this->le(Extent<T, N>(scalar));
116 }
118 return this->gt(Extent<T, N>(scalar));
119 }
121 return this->ge(Extent<T, N>(scalar));
122 }
124
133 return Extent<T, N>(this->_vector + other._vector);
134 }
136 return Extent<T, N>(this->_vector - other._vector);
137 }
139 this->_vector += other._vector;
140 return static_cast<Extent<T, N> &>(*this);
141 }
143 this->_vector -= other._vector;
144 return static_cast<Extent<T, N> &>(*this);
145 }
147 return static_cast<Extent<T, N> const &>(*this);
148 }
150 return Extent<T, N>(-this->_vector);
151 }
153
161 return Extent<T, N>(this->_vector * scalar);
162 }
164 this->_vector *= scalar;
165 return static_cast<Extent<T, N> &>(*this);
166 }
168 return Extent<T, N>(this->_vector / scalar);
169 }
171 this->_vector /= scalar;
172 return static_cast<Extent<T, N> &>(*this);
173 }
175
177 Point<T, N> asPoint() const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE);
178
179 std::string toString() const {
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 }
191
192protected:
194 explicit ExtentBase(T val = static_cast<T>(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
195 : Super(val) {}
196
198 template <typename Vector>
199 explicit ExtentBase(Eigen::MatrixBase<Vector> const &vector) : Super(vector) {}
200};
201
209template <typename T, int N>
210class Extent : public ExtentBase<T, N> {
211 typedef ExtentBase<T, N> Super;
212
213public:
215
217 explicit Extent(T val = static_cast<T>(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) : Super(val) {}
218
220 explicit Extent(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) : Super(vector) {}
221
223 explicit Extent(Point<T, N> const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE);
224
226 template <typename U>
227 explicit Extent(Extent<U, N> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>);
228 template <typename U>
229 explicit Extent(Point<U, N> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>);
230
231 // Should be consistent with converting constructors
232 Extent(Extent const &other) = default;
233 Extent(Extent &&other) = default;
234 ~Extent() = default;
235
236 Extent &operator=(Extent const &other) = default;
237 Extent &operator=(Extent &&other) = default;
238
240 T computeSquaredNorm() const { return this->asEigen().squaredNorm(); }
241
243 T computeNorm() const { return this->asEigen().norm(); }
244
245 void swap(Extent &other) noexcept { this->_swap(other); }
246};
247
253template <typename T>
254class Extent<T, 2> : public ExtentBase<T, 2> {
255 typedef ExtentBase<T, 2> Super;
256
257public:
259
261 explicit Extent(T val = static_cast<T>(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) : Super(val) {}
262
264 explicit Extent(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) : Super(vector) {}
265
267 explicit Extent(Point<T, 2> const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE);
268
270 template <typename U>
271 explicit Extent(Extent<U, 2> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>);
272 template <typename U>
273 explicit Extent(Point<U, 2> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>);
274
277
279 explicit Extent(T const xy[2]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
280 : Super(EigenVector(xy[0], xy[1])) {}
281
284 : Super(EigenVector(xy.first, xy.second)) {}
285
288 : Super(EigenVector(std::get<0>(xy), std::get<1>(xy))) {}
289
290 // Should be consistent with converting constructors
291 Extent(Extent const &other) = default;
292 Extent(Extent &&other) = default;
293 ~Extent() = default;
294
295 Extent &operator=(Extent const &other) = default;
296 Extent &operator=(Extent &&other) = default;
297
298 void swap(Extent &other) noexcept { this->_swap(other); }
299};
300
306template <typename T>
307class Extent<T, 3> : public ExtentBase<T, 3> {
308 typedef ExtentBase<T, 3> Super;
309
310public:
312
314 explicit Extent(T val = static_cast<T>(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) : Super(val) {}
315
317 explicit Extent(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) : Super(vector) {}
318
320 explicit Extent(Point<T, 3> const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE);
321
323 template <typename U>
324 explicit Extent(Extent<U, 3> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>);
325 template <typename U>
326 explicit Extent(Point<U, 3> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>);
327
329 explicit Extent(T x, T y, T z) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
330 : Super(EigenVector(x, y, z)) {}
331
333 explicit Extent(T const xyz[3]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
334 : Super(EigenVector(xyz[0], xyz[1], xyz[2])) {}
335
338 : Super(EigenVector(std::get<0>(xyz), std::get<1>(xyz), std::get<2>(xyz))) {}
339
340 // Should be consistent with converting constructors
341 Extent(Extent const &other) = default;
342 Extent(Extent &&other) = default;
343 ~Extent() = default;
344
345 Extent &operator=(Extent const &other) = default;
346 Extent &operator=(Extent &&other) = default;
347
348 void swap(Extent &other) noexcept { this->_swap(other); }
349};
350
351// Constructor for any 2D type from 2I type
352template <typename T>
353template <typename U>
354Extent<T, 2>::Extent(Extent<U, 2> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>) {
356 "can only construct from Extent of different but integral type");
357 this->setX(static_cast<T>(other.getX()));
358 this->setY(static_cast<T>(other.getY()));
359};
360
361template <typename T>
362template <typename U>
363Extent<T, 2>::Extent(Point<U, 2> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>) {
365 "can only construct from Extent of different but integral type");
366 this->setX(static_cast<T>(other.getX()));
367 this->setY(static_cast<T>(other.getY()));
368};
369
370// Constructor for any 3D type from 3I type
371template <typename T>
372template <typename U>
373Extent<T, 3>::Extent(Extent<U, 3> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>) {
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};
380
381// Constructor for any 3D type from 3I type
382template <typename T>
383template <typename U>
384Extent<T, 3>::Extent(Point<U, 3> const &other) noexcept(IS_NOTHROW_CONVERTIBLE<T, U>) {
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};
391
392// Hash functions
393template <typename T, int N>
394std::size_t hash_value(Extent<T, N> const &extent) noexcept;
395
402
408template <int N>
409Extent<int, N> truncate(Extent<double, N> const &input) noexcept;
410
416template <int N>
417Extent<int, N> floor(Extent<double, N> const &input) noexcept;
418
424template <int N>
425Extent<int, N> ceil(Extent<double, N> const &input) noexcept;
426
427// Some operators below need to take ExtentBase arguments rather than Extent to
428// avoid ambiguous overloads (since some competing operators are defined as member
429// functions on ExtentBase).
430
431template <typename T, int N>
434 return rhs * scalar;
435}
436
437template <int N>
438Extent<double, N> operator*(ExtentBase<int, N> const &lhs, double rhs) noexcept {
439 return Extent<double, N>(static_cast<Extent<int, N> const &>(lhs)) * rhs;
440}
441
442template <int N>
443void operator*=(ExtentBase<int, N> &lhs, double rhs) noexcept {
444 // use "N < 0" so assertion is dependent on template instantiation, instead of triggering all the time
445 static_assert(N < 0, "In-place multiplication of Extent<int,N> by double would truncate.");
446}
447
448template <int N>
449Extent<double, N> operator/(ExtentBase<int, N> const &lhs, double rhs) noexcept {
450 return Extent<double, N>(static_cast<Extent<int, N> const &>(lhs)) / rhs;
451}
452
453template <int N>
454void operator/=(ExtentBase<int, N> &lhs, double rhs) noexcept {
455 // use "N < 0" so assertion is dependent on template instantiation, instead of triggering all the time
456 static_assert(N < 0, "In-place division of Extent<int,N> by double would truncate.");
457}
458
459template <int N>
460Extent<double, N> operator*(double lhs, ExtentBase<int, N> const &rhs) noexcept {
461 return lhs * Extent<double, N>(static_cast<Extent<int, N> const &>(rhs));
462}
463
464template <int N>
466 return lhs + Extent<double, N>(rhs);
467}
468
469template <int N>
471 return lhs += Extent<double, N>(rhs);
472}
473
474template <int N>
476 return lhs - Extent<double, N>(rhs);
477}
478
479template <int N>
481 return lhs -= Extent<double, N>(rhs);
482}
483
484template <int N>
486 return Extent<double, N>(lhs) + rhs;
487}
488
489template <int N>
491 return Extent<double, N>(lhs) - rhs;
492}
493
494} // namespace geom
495} // namespace lsst
496
497namespace std {
498template <typename T, int N>
504} // namespace std
505
506#endif
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
double z
Definition Match.cc:44
int y
Definition SpanSet.cc:48
A CRTP base class for coordinate objects.
void _swap(CoordinateBase &other) noexcept
Eigen::Matrix< T, N, 1, Eigen::DontAlign > EigenVector
EigenVector const & asEigen() const noexcept(IS_ELEMENT_NOTHROW_COPYABLE)
Return a fixed-size Eigen representation of the coordinate object.
A boolean coordinate.
void swap(Extent &other) noexcept
Definition Extent.h:298
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:261
Extent & operator=(Extent const &other)=default
Super::EigenVector EigenVector
Definition Extent.h:258
Extent(Extent const &other)=default
Extent(std::tuple< T, T > const &xy) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from std::tuple.
Definition Extent.h:287
Extent & operator=(Extent &&other)=default
Extent(T const xy[2]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from a two-element array.
Definition Extent.h:279
Extent(Extent &&other)=default
Extent(std::pair< T, T > const &xy) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from a std::pair.
Definition Extent.h:283
Extent(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct an Extent from an Eigen vector.
Definition Extent.h:264
Extent(Point< T, 2 > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Explicit constructor from Point.
Extent(T x, T y) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from two scalars.
Definition Extent.h:276
Extent(Extent const &other)=default
Extent(Extent &&other)=default
Extent(Point< T, 3 > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Explicit constructor from Point.
Super::EigenVector EigenVector
Definition Extent.h:311
Extent(T const xyz[3]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from a three-element array.
Definition Extent.h:333
Extent & operator=(Extent &&other)=default
Extent & operator=(Extent const &other)=default
Extent(T x, T y, T z) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from three scalars.
Definition Extent.h:329
Extent(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct an Extent from an Eigen vector.
Definition Extent.h:317
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
void swap(Extent &other) noexcept
Definition Extent.h:348
Extent(std::tuple< T, T, T > const &xyz) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from std::tuple.
Definition Extent.h:337
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.
Definition Extent.h:167
ExtentBase & operator=(ExtentBase &&)=default
CoordinateExpr< N > lt(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:111
Extent< T, N > operator+(Extent< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:132
Extent< T, N > & operator-=(Extent< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
Definition Extent.h:142
CoordinateExpr< N > gt(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:117
CoordinateExpr< N > eq(Extent< T, N > const &other) const noexcept
Definition Extent.cc:47
CoordinateExpr< N > ne(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:108
ExtentBase & operator=(ExtentBase const &)=default
CoordinateExpr< N > eq(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:105
CoordinateExpr< N > le(Extent< T, N > const &other) const noexcept
Definition Extent.cc:68
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.
Definition Extent.h:170
bool operator==(Extent< T, N > const &other) const noexcept
Standard equality comparison.
Definition Extent.h:77
CoordinateExpr< N > lt(Extent< T, N > const &other) const noexcept
Definition Extent.cc:61
ExtentBase(Eigen::MatrixBase< Vector > const &vector)
Construct an Extent from an Eigen vector.
Definition Extent.h:199
ExtentBase(T val=static_cast< T >(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct an Extent<T,N> with all elements set to the same scalar value.
Definition Extent.h:194
T computeNorm() const
Return the L2 norm of the Extent (sqrt(x^2 + y^2 + ...)).
Definition Extent.h:70
CoordinateExpr< N > ge(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:120
bool operator!=(Extent< T, N > const &other) const noexcept
Standard inequality comparison.
Definition Extent.h:84
std::string toString() const
Cast this object to an Extent of the same numeric type and dimensionality.
Definition Extent.h:179
CoordinateExpr< N > ne(Extent< T, N > const &other) const noexcept
Definition Extent.cc:54
Point< T, N > asPoint() const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
Definition Extent.cc:89
CoordinateExpr< N > le(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:114
CoordinateExpr< N > gt(Extent< T, N > const &other) const noexcept
Definition Extent.cc:75
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.
Definition Extent.h:163
ExtentBase(ExtentBase const &)=default
Extent< T, N > & operator+=(Extent< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
Definition Extent.h:138
T computeSquaredNorm() const
Return the squared L2 norm of the Extent (x^2 + y^2 + ...).
Definition Extent.h:67
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.
Definition Extent.h:160
Extent< T, N > operator-(Extent< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:135
Extent< T, N > operator+() const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:146
CoordinateExpr< N > ge(Extent< T, N > const &other) const noexcept
Definition Extent.cc:82
ExtentBase(ExtentBase &&)=default
Extent< T, N > operator-() const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition Extent.h:149
A coordinate class intended to represent offsets and dimensions.
Definition Extent.h:210
Extent(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct an Extent from an Eigen vector.
Definition Extent.h:220
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:217
Extent(Point< U, N > const &other) noexcept(IS_NOTHROW_CONVERTIBLE< T, U >)
Extent(Extent const &other)=default
T computeSquaredNorm() const
Return the squared L2 norm of the Extent (x^2 + y^2 + ...).
Definition Extent.h:240
Extent(Extent< U, N > const &other) noexcept(IS_NOTHROW_CONVERTIBLE< T, U >)
Explicit constructor from Extent of different type (if allowed)
Extent(Extent &&other)=default
void swap(Extent &other) noexcept
Definition Extent.h:245
Super::EigenVector EigenVector
Definition Extent.h:214
T computeNorm() const
Return the L2 norm of the Extent (sqrt(x^2 + y^2 + ...)).
Definition Extent.h:243
Extent & operator=(Extent const &other)=default
Extent & operator=(Extent &&other)=default
A coordinate class intended to represent absolute positions.
Definition Point.h:169
Reports errors in the logical structure of the program.
Definition Runtime.h:46
double computeExtentNorm(Extent< double, N > const &s)
Definition Extent.h:41
constexpr Angle operator*(Angle a, Angle d) noexcept
Product of two angles.
Definition Angle.h:329
Extent< double, N > & operator+=(Extent< double, N > &lhs, Extent< int, N > const &rhs) noexcept
Definition Extent.h:470
Extent< int, N > floor(Extent< double, N > const &input) noexcept
Return the component-wise floor (round towards more negative).
Definition Extent.cc:109
Extent< double, 2 > ExtentD
Definition Extent.h:399
void operator/=(ExtentBase< int, N > &lhs, double rhs) noexcept
Definition Extent.h:454
constexpr Angle operator+(Angle a, Angle d) noexcept
Sum of two angles.
Definition Angle.h:315
std::size_t hash_value(Extent< T, N > const &extent) noexcept
Definition Extent.cc:127
constexpr Angle operator/(Angle a, int d) noexcept
Ratio of an angle and a scalar.
Definition Angle.h:356
bool any(CoordinateExpr< N > const &expr) noexcept
Return true if any elements are true.
constexpr Angle operator-(Angle a, Angle d) noexcept
Difference of two angles.
Definition Angle.h:321
Extent< int, N > truncate(Extent< double, N > const &input) noexcept
Return the component-wise truncation (round towards zero).
Definition Extent.cc:100
bool all(CoordinateExpr< N > const &expr) noexcept
Return true if all elements are true.
Extent< double, 2 > Extent2D
Definition Extent.h:400
Extent< int, 2 > ExtentI
Definition Extent.h:396
void operator*=(ExtentBase< int, N > &lhs, double rhs) noexcept
Definition Extent.h:443
Extent< int, N > ceil(Extent< double, N > const &input) noexcept
Return the component-wise ceil (round towards more positive).
Definition Extent.cc:118
Extent< double, N > & operator-=(Extent< double, N > &lhs, Extent< int, N > const &rhs) noexcept
Definition Extent.h:480
Extent< int, 3 > Extent3I
Definition Extent.h:398
Extent< int, 2 > Extent2I
Definition Extent.h:397
Extent< double, 3 > Extent3D
Definition Extent.h:401
STL namespace.
ImageT val
Definition CR.cc:146
T str(T... args)
result_type operator()(argument_type const &x) const noexcept
Definition Extent.h:502