LSST Applications g07dc498a13+8a3ff5e555,g1409bbee79+8a3ff5e555,g1a7e361dbc+8a3ff5e555,g1fd858c14a+cdfc45a1e6,g28da252d5a+05df2523c9,g33399d78f5+b7ce9b29cb,g35bb328faa+e55fef2c71,g3bd4b5ce2c+801aef9193,g43bc871e57+32b9ddb877,g53246c7159+e55fef2c71,g60b5630c4e+f284161bd5,g6992a3b7c1+89734069dd,g6e5c4a0e23+7c1dc9d5af,g78460c75b0+8427c4cc8f,g786e29fd12+307f82e6af,g8534526c7b+af2545e932,g85d8d04dbe+6bd817bf56,g89139ef638+8a3ff5e555,g8b49a6ea8e+f284161bd5,g9125e01d80+e55fef2c71,g989de1cb63+8a3ff5e555,g9a9baf55bd+a4ec829099,g9f33ca652e+eafd8913dc,gaaedd4e678+8a3ff5e555,gabe3b4be73+9c0c3c7524,gb092a606b0+b01f69f56e,gb58c049af0+28045f66fd,gc2fcbed0ba+f284161bd5,gca43fec769+e55fef2c71,gcf25f946ba+b7ce9b29cb,gd6cbbdb0b4+784e334a77,gde0f65d7ad+3bc0905521,ge278dab8ac+25667260f6,geab183fbe5+f284161bd5,gecb8035dfe+0fa5abcb94,gf1e97e5484+b700727375,gf58bf46354+e55fef2c71,gfe7187db8c+f9d6462591,w.2025.01
LSST Data Management Base Package
Loading...
Searching...
No Matches
CoordinateBase.cc
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
23#include "lsst/geom/Point.h"
24#include "lsst/geom/Extent.h"
25
26namespace lsst {
27namespace geom {
28
29template <typename Derived, typename T, int N>
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}
39
41 CoordinateBase<Point2D, double, 2> const &, double, double);
43 CoordinateBase<Point3D, double, 3> const &, double, double);
45 CoordinateBase<Extent2D, double, 2> const &, double, double);
47 CoordinateBase<Extent3D, double, 3> const &, double, double);
48
49} // namespace geom
50} // namespace lsst
table::Key< int > b
A CRTP base class for coordinate objects.
template bool allclose< Point3D, double, 3 >(CoordinateBase< Point3D, double, 3 > const &, CoordinateBase< Point3D, double, 3 > const &, double, double)
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)) noexcept(std::is_nothrow_copy_constructible< T >::value &&std::is_nothrow_copy_assignable< T >::value)
Floating-point comparison with tolerance.
template bool allclose< Extent3D, double, 3 >(CoordinateBase< Extent3D, double, 3 > const &, CoordinateBase< Extent3D, double, 3 > const &, double, double)
template bool allclose< Point2D, double, 2 >(CoordinateBase< Point2D, double, 2 > const &, CoordinateBase< Point2D, double, 2 > const &, double, double)
template bool allclose< Extent2D, double, 2 >(CoordinateBase< Extent2D, double, 2 > const &, CoordinateBase< Extent2D, double, 2 > const &, double, double)