LSSTApplications  16.0-1-gce273f5+17,16.0-1-gf77f410+12,16.0-10-g5a5abec+8,16.0-10-gc1446dd+12,16.0-12-g1dc09ba+6,16.0-12-g569485f,16.0-12-ga22ed6e+1,16.0-13-g4c33ca5+12,16.0-13-gb122224+3,16.0-13-gd9b1b71+12,16.0-14-g22e2ff2,16.0-14-g71e547a+8,16.0-17-g0bdc215+4,16.0-17-g6a7bfb3b+12,16.0-2-g0febb12+14,16.0-2-g839ba83+50,16.0-2-g9d5294e+39,16.0-20-ga7ad2685,16.0-3-g404ea43+9,16.0-3-gbc759ec+10,16.0-3-gcfd6c53+37,16.0-4-g03cf288+28,16.0-4-g13a27c5+14,16.0-4-g5f3a788+13,16.0-4-g8a0f11a+34,16.0-4-ga3eb747+3,16.0-45-g4805a823c,16.0-5-g1991253+12,16.0-5-g1e9226d+1,16.0-5-g865efd9+12,16.0-5-gb3f8a4b+44,16.0-5-gd0f1235+6,16.0-6-gf0acd13+31,16.0-6-gf9cb114+13,16.0-7-g6043bfc,16.0-7-ga8e1655+8,16.0-8-g23bbf3f+3,16.0-8-g4dec96c+25,16.0-8-gfd407c0+2,master-g965b868a3d+1,master-gdc6be1965f+1,w.2018.39
LSSTDataManagementBasePackage
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 
34 namespace lsst {
35 namespace geom {
36 
37 // These are present to avoid a static assertion for instantiating computeNorm() on integer types.
38 namespace detail {
39 
40 template <int N>
42  return s.asEigen().norm();
43 }
44 
45 template <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 
55 template <typename T, int N>
56 class ExtentBase : public CoordinateBase<Extent<T, N>, T, N> {
57  typedef CoordinateBase<Extent<T, N>, T, N> Super;
58 
59 public:
60  ExtentBase(ExtentBase const &) = default;
61  ExtentBase(ExtentBase &&) = default;
62  ExtentBase &operator=(ExtentBase const &) = default;
63  ExtentBase &operator=(ExtentBase &&) = 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;
105  CoordinateExpr<N> eq(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
106  return this->eq(Extent<T, N>(scalar));
107  }
108  CoordinateExpr<N> ne(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
109  return this->ne(Extent<T, N>(scalar));
110  }
111  CoordinateExpr<N> lt(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
112  return this->lt(Extent<T, N>(scalar));
113  }
114  CoordinateExpr<N> le(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
115  return this->le(Extent<T, N>(scalar));
116  }
117  CoordinateExpr<N> gt(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
118  return this->gt(Extent<T, N>(scalar));
119  }
120  CoordinateExpr<N> ge(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
121  return this->ge(Extent<T, N>(scalar));
122  }
124 
131  Point<T, N> operator+(Point<T, N> const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE);
132  Extent<T, N> operator+(Extent<T, N> const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
133  return Extent<T, N>(this->_vector + other._vector);
134  }
135  Extent<T, N> operator-(Extent<T, N> const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
136  return Extent<T, N>(this->_vector - other._vector);
137  }
138  Extent<T, N> &operator+=(Extent<T, N> const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE) {
139  this->_vector += other._vector;
140  return static_cast<Extent<T, N> &>(*this);
141  }
142  Extent<T, N> &operator-=(Extent<T, N> const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE) {
143  this->_vector -= other._vector;
144  return static_cast<Extent<T, N> &>(*this);
145  }
146  Extent<T, N> operator+() const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
147  return static_cast<Extent<T, N> const &>(*this);
148  }
149  Extent<T, N> operator-() const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
150  return Extent<T, N>(-this->_vector);
151  }
153 
160  Extent<T, N> operator*(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
161  return Extent<T, N>(this->_vector * scalar);
162  }
163  Extent<T, N> &operator*=(T scalar) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE) {
164  this->_vector *= scalar;
165  return static_cast<Extent<T, N> &>(*this);
166  }
167  Extent<T, N> operator/(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) {
168  return Extent<T, N>(this->_vector / scalar);
169  }
170  Extent<T, N> &operator/=(T scalar) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE) {
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 
180  std::stringstream out;
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 
192 protected:
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 
209 template <typename T, int N>
210 class Extent : public ExtentBase<T, N> {
211  typedef ExtentBase<T, N> Super;
212 
213 public:
214  typedef typename Super::EigenVector EigenVector;
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 
253 template <typename T>
254 class Extent<T, 2> : public ExtentBase<T, 2> {
255  typedef ExtentBase<T, 2> Super;
256 
257 public:
258  typedef typename Super::EigenVector EigenVector;
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 
276  explicit Extent(T x, T y) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE) : Super(EigenVector(x, y)) {}
277 
279  explicit Extent(T const xy[2]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
280  : Super(EigenVector(xy[0], xy[1])) {}
281 
283  explicit Extent(std::pair<T, T> const &xy) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
284  : Super(EigenVector(xy.first, xy.second)) {}
285 
287  explicit Extent(std::tuple<T, T> const &xy) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
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 
306 template <typename T>
307 class Extent<T, 3> : public ExtentBase<T, 3> {
308  typedef ExtentBase<T, 3> Super;
309 
310 public:
311  typedef typename Super::EigenVector EigenVector;
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 
337  explicit Extent(std::tuple<T, T, T> const &xyz) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
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
352 template <typename T>
353 template <typename U>
354 Extent<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 
361 template <typename T>
362 template <typename U>
363 Extent<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
371 template <typename T>
372 template <typename U>
373 Extent<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
382 template <typename T>
383 template <typename U>
384 Extent<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 typedef Extent<int, 2> ExtentI;
398 
404 template <int N>
405 Extent<int, N> truncate(Extent<double, N> const &input) noexcept;
406 
412 template <int N>
413 Extent<int, N> floor(Extent<double, N> const &input) noexcept;
414 
420 template <int N>
421 Extent<int, N> ceil(Extent<double, N> const &input) noexcept;
422 
423 // Some operators below need to take ExtentBase arguments rather than Extent to
424 // avoid ambiguous overloads (since some competing operators are defined as member
425 // functions on ExtentBase).
426 
427 template <typename T, int N>
430  return rhs * scalar;
431 }
432 
433 template <int N>
434 Extent<double, N> operator*(ExtentBase<int, N> const &lhs, double rhs) noexcept {
435  return Extent<double, N>(static_cast<Extent<int, N> const &>(lhs)) * rhs;
436 }
437 
438 template <int N>
439 void operator*=(ExtentBase<int, N> &lhs, double rhs) noexcept {
440  // use "N < 0" so assertion is dependent on template instantiation, instead of triggering all the time
441  static_assert(N < 0, "In-place multiplication of Extent<int,N> by double would truncate.");
442 }
443 
444 template <int N>
445 Extent<double, N> operator/(ExtentBase<int, N> const &lhs, double rhs) noexcept {
446  return Extent<double, N>(static_cast<Extent<int, N> const &>(lhs)) / rhs;
447 }
448 
449 template <int N>
450 void operator/=(ExtentBase<int, N> &lhs, double rhs) noexcept {
451  // use "N < 0" so assertion is dependent on template instantiation, instead of triggering all the time
452  static_assert(N < 0, "In-place division of Extent<int,N> by double would truncate.");
453 }
454 
455 template <int N>
456 Extent<double, N> operator*(double lhs, ExtentBase<int, N> const &rhs) noexcept {
457  return lhs * Extent<double, N>(static_cast<Extent<int, N> const &>(rhs));
458 }
459 
460 template <int N>
462  return lhs + Extent<double, N>(rhs);
463 }
464 
465 template <int N>
467  return lhs += Extent<double, N>(rhs);
468 }
469 
470 template <int N>
472  return lhs - Extent<double, N>(rhs);
473 }
474 
475 template <int N>
477  return lhs -= Extent<double, N>(rhs);
478 }
479 
480 template <int N>
482  return Extent<double, N>(lhs) + rhs;
483 }
484 
485 template <int N>
487  return Extent<double, N>(lhs) - rhs;
488 }
489 
490 } // namespace geom
491 } // namespace lsst
492 
493 #endif
void swap(Extent &other) noexcept
Definition: Extent.h:298
T computeSquaredNorm() const
Return the squared L2 norm of the Extent (x^2 + y^2 + ...).
Definition: Extent.h:240
Extent(T const xyz[3]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from a three-element array.
Definition: Extent.h:333
A CRTP base class for coordinate objects.
Extent< double, 3 > Extent3D
Definition: Extent.h:397
Extent< int, N > ceil(Extent< double, N > const &input) noexcept
Return the component-wise ceil (round towards more positive).
Definition: Extent.cc:117
Extent(T x, T y, T z) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from three scalars.
Definition: Extent.h:329
ExtentBase(Eigen::MatrixBase< Vector > const &vector)
Construct an Extent from an Eigen vector.
Definition: Extent.h:199
A coordinate class intended to represent absolute positions (2-d specialization). ...
Definition: Point.h:211
void operator/=(ExtentBase< int, N > &lhs, double rhs) noexcept
Definition: Extent.h:450
CoordinateExpr< N > ge(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:120
A coordinate class intended to represent absolute positions (3-d specialization). ...
Definition: Point.h:268
T computeSquaredNorm() const
Return the squared L2 norm of the Extent (x^2 + y^2 + ...).
Definition: Extent.h:67
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
A coordinate class intended to represent absolute positions.
Extent< T, N > & operator*=(T scalar) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
Definition: Extent.h:163
void operator*=(ExtentBase< int, N > &lhs, double rhs) noexcept
Definition: Extent.h:439
int y
Definition: SpanSet.cc:49
STL namespace.
constexpr Angle operator+(Angle a, Angle d) noexcept
Sum of two angles.
Definition: Angle.h:302
ImageT val
Definition: CR.cc:146
Extent< double, N > & operator+=(Extent< double, N > &lhs, Extent< int, N > const &rhs) noexcept
Definition: Extent.h:466
CoordinateExpr< N > eq(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:105
Extent(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct an Extent from an Eigen vector.
Definition: Extent.h:317
std::string toString() const
Definition: Extent.h:179
Extent< T, N > & operator/=(T scalar) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
Definition: Extent.h:170
CoordinateExpr< N > le(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:114
Extent< T, N > operator-() const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:149
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
bool any(CoordinateExpr< N > const &expr) noexcept
Return true if any elements are true.
bool operator!=(Extent< T, N > const &other) const noexcept
Standard inequality comparison.
Definition: Extent.h:84
Extent< double, N > & operator-=(Extent< double, N > &lhs, Extent< int, N > const &rhs) noexcept
Definition: Extent.h:476
STL class.
Extent(std::pair< T, T > const &xy) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from a std::pair.
Definition: Extent.h:283
T computeNorm() const
Return the L2 norm of the Extent (sqrt(x^2 + y^2 + ...)).
Definition: Extent.h:243
Extent(T x, T y) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from two scalars.
Definition: Extent.h:276
Extent< T, N > operator+() const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:146
constexpr Angle operator-(Angle a, Angle d) noexcept
Difference of two angles.
Definition: Angle.h:308
bool all(CoordinateExpr< N > const &expr) noexcept
Return true if all elements are true.
CoordinateExpr< N > lt(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:111
Eigen::Matrix< int, N, 1, Eigen::DontAlign > EigenVector
A base class for image defects.
Definition: cameraGeom.dox:3
Extent< T, N > operator/(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:167
Extent< int, N > truncate(Extent< double, N > const &input) noexcept
Return the component-wise truncation (round towards zero).
Definition: Extent.cc:99
CoordinateExpr< N > ne(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:108
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
A boolean coordinate.
Extent< T, N > & operator+=(Extent< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
Definition: Extent.h:138
Super::EigenVector EigenVector
Definition: Extent.h:258
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
constexpr Angle operator*(Angle a, Angle d) noexcept
Product of two angles.
Definition: Angle.h:316
Super::EigenVector EigenVector
Definition: Extent.h:311
double computeExtentNorm(Extent< double, N > const &s)
Definition: Extent.h:41
T str(T... args)
Reports errors in the logical structure of the program.
Definition: Runtime.h:46
A coordinate class intended to represent offsets and dimensions.
solver_t * s
double x
Eigen::Vector3d asEigen(sphgeom::Vector3d const &vector) noexcept
Definition: sphgeomUtils.h:36
void swap(Extent &other) noexcept
Definition: Extent.h:245
T computeNorm() const
Return the L2 norm of the Extent (sqrt(x^2 + y^2 + ...)).
Definition: Extent.h:70
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
constexpr Angle operator/(Angle a, int d) noexcept
Ratio of an angle and a scalar.
Definition: Angle.h:343
Extent< int, 2 > Extent2I
Definition: Extent.h:393
Extent< T, N > operator+(Extent< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:132
bool operator==(Extent< T, N > const &other) const noexcept
Standard equality comparison.
Definition: Extent.h:77
Extent< double, 2 > ExtentD
Definition: Extent.h:395
Extent< int, 2 > ExtentI
Definition: Extent.h:390
Super::EigenVector EigenVector
Definition: Extent.h:214
void swap(Extent &other) noexcept
Definition: Extent.h:348
Extent< T, N > & operator-=(Extent< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
Definition: Extent.h:142
Extent(T const xy[2]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from a two-element array.
Definition: Extent.h:279
EigenVector const & asEigen() const noexcept(IS_ELEMENT_NOTHROW_COPYABLE)
Return a fixed-size Eigen representation of the coordinate object.
Extent< int, N > floor(Extent< double, N > const &input) noexcept
Return the component-wise floor (round towards more negative).
Definition: Extent.cc:108
ItemVariant const * other
Definition: Schema.cc:55
Extent< double, 2 > Extent2D
Definition: Extent.h:396
Extent< T, N > operator*(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
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< int, 3 > Extent3I
Definition: Extent.h:394
Extent(std::tuple< T, T > const &xy) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from std::tuple.
Definition: Extent.h:287
Extent(std::tuple< T, T, T > const &xyz) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from std::tuple.
Definition: Extent.h:337
Extent(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct an Extent from an Eigen vector.
Definition: Extent.h:220
Extent(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct an Extent from an Eigen vector.
Definition: Extent.h:264
CoordinateExpr< N > gt(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Definition: Extent.h:117
double z
Definition: Match.cc:44