lsst.geom
16.0+1
|
A boolean coordinate. More...
#include <CoordinateExpr.h>
Public Types | |
typedef bool | Element |
typedef Eigen::Matrix< bool, N, 1, Eigen::DontAlign > | EigenVector |
Public Member Functions | |
CoordinateExpr (bool val=false) | |
Construct a CoordinateExpr with all elements set to the same scalar value. More... | |
template<typename Vector > | |
CoordinateExpr (Eigen::MatrixBase< Vector > const &vector) | |
Construct a CoordinateExpr from an Eigen vector. More... | |
CoordinateExpr (CoordinateExpr const &)=default | |
CoordinateExpr (CoordinateExpr &&)=default | |
CoordinateExpr & | operator= (CoordinateExpr const &)=default |
CoordinateExpr & | operator= (CoordinateExpr &&)=default |
~CoordinateExpr ()=default | |
bool & | operator[] (int n) |
bool const & | operator[] (int n) const |
bool & | coeffRef (int n) |
bool const & | coeffRef (int n) const |
EigenVector const & | asEigen () const |
Return a fixed-size Eigen representation of the coordinate object. More... | |
Logical operators | |
These operators do not provide interoperability with scalars. | |
CoordinateExpr | and_ (CoordinateExpr const &rhs) const |
CoordinateExpr | or_ (CoordinateExpr const &rhs) const |
CoordinateExpr | not_ () const |
Static Public Attributes | |
static int const | dimensions |
Protected Member Functions | |
void | _swap (CoordinateBase &other) |
Protected Attributes | |
EigenVector | _vector |
Related Functions | |
(Note that these are not member functions.) | |
bool | allclose (CoordinateBase< CoordinateExpr< N >, bool, N > const &a, CoordinateBase< CoordinateExpr< N >, bool, N > const &b, bool rtol=static_cast< bool >(1E-5), bool atol=static_cast< bool >(1E-8)) |
Floating-point comparison with tolerance. More... | |
A boolean coordinate.
CoordinateExpr is intended to be used as a temporary in coordinate comparisons:
Point2D a(3.5,1.2); Point2D b(-1.5,4.3); std::cout << all(a.lt(b)) << std::endl; // false std::cout << any(a.lt(b)) << std::endl; // true
CoordinateExpr is not a true lazy-evaluation expression template, as that seems unnecessary when the object is typically only two bools large (smaller than the raw pointers necessary to implement a lazy solution). The consequence is that there's no short-circuiting of logical operators, but I don't think that will even remotely matter for most use cases. The any() and all() functions do support short-circuiting.
Definition at line 50 of file CoordinateExpr.h.
|
inherited |
Definition at line 52 of file CoordinateBase.h.
|
inherited |
Definition at line 50 of file CoordinateBase.h.
|
inlineexplicit |
Construct a CoordinateExpr with all elements set to the same scalar value.
Definition at line 55 of file CoordinateExpr.h.
|
inlineexplicit |
Construct a CoordinateExpr from an Eigen vector.
Definition at line 59 of file CoordinateExpr.h.
|
default |
|
default |
|
default |
|
inlineprotectedinherited |
Definition at line 89 of file CoordinateBase.h.
CoordinateExpr< N > lsst::geom::CoordinateExpr< N >::and_ | ( | CoordinateExpr< N > const & | rhs | ) | const |
Definition at line 30 of file CoordinateExpr.cc.
|
inlineinherited |
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 71 of file CoordinateBase.h.
|
inlineinherited |
Definition at line 62 of file CoordinateBase.h.
|
inlineinherited |
Definition at line 63 of file CoordinateBase.h.
CoordinateExpr< N > lsst::geom::CoordinateExpr< N >::not_ | ( | ) | const |
Definition at line 48 of file CoordinateExpr.cc.
|
default |
|
default |
|
inlineinherited |
Definition at line 60 of file CoordinateBase.h.
|
inlineinherited |
Definition at line 61 of file CoordinateBase.h.
CoordinateExpr< N > lsst::geom::CoordinateExpr< N >::or_ | ( | CoordinateExpr< N > const & | rhs | ) | const |
Definition at line 39 of file CoordinateExpr.cc.
|
related |
Floating-point comparison with tolerance.
Interface, naming, and default tolerances matches Numpy.
Definition at line 30 of file CoordinateBase.cc.
|
protectedinherited |
Definition at line 90 of file CoordinateBase.h.
|
staticinherited |
Definition at line 51 of file CoordinateBase.h.