LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
Public Member Functions | Private Types | List of all members
lsst::afw::geom::CoordinateExpr< N > Class Template Reference

A boolean coordinate. More...

#include <CoordinateExpr.h>

Inheritance diagram for lsst::afw::geom::CoordinateExpr< N >:
lsst::afw::geom::CoordinateBase< CoordinateExpr< N >, bool, N >

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...
 
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
 
- Public Member Functions inherited from lsst::afw::geom::CoordinateBase< CoordinateExpr< N >, bool, N >
bool & operator[] (int n)
 
boolconst & operator[] (int n) const
 
bool & coeffRef (int n)
 
boolconst & coeffRef (int n) const
 
EigenVector const & asEigen () const
 Return a fixed-size Eigen representation of the coordinate object. More...
 

Private Types

typedef CoordinateBase
< CoordinateExpr< N >, bool, N > 
Super
 

Additional Inherited Members

- Public Types inherited from lsst::afw::geom::CoordinateBase< CoordinateExpr< N >, bool, N >
typedef bool Element
 
typedef Eigen::Matrix< bool, N,
1, Eigen::DontAlign > 
EigenVector
 
- Static Public Attributes inherited from lsst::afw::geom::CoordinateBase< CoordinateExpr< N >, bool, N >
static int const dimensions
 
- Protected Member Functions inherited from lsst::afw::geom::CoordinateBase< CoordinateExpr< N >, bool, N >
 CoordinateBase (boolval=static_cast< bool >(0))
 Initialize all elements to a scalar. More...
 
 CoordinateBase (Eigen::MatrixBase< Vector > const &vector)
 Initialize all elements from an N-d Eigen vector. More...
 
void _swap (CoordinateBase &other)
 
- Protected Attributes inherited from lsst::afw::geom::CoordinateBase< CoordinateExpr< N >, bool, N >
EigenVector _vector
 

Detailed Description

template<int N>
class lsst::afw::geom::CoordinateExpr< N >

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 54 of file CoordinateExpr.h.

Member Typedef Documentation

template<int N>
typedef CoordinateBase<CoordinateExpr<N>,bool,N> lsst::afw::geom::CoordinateExpr< N >::Super
private

Definition at line 55 of file CoordinateExpr.h.

Constructor & Destructor Documentation

template<int N>
lsst::afw::geom::CoordinateExpr< N >::CoordinateExpr ( bool  val = false)
inlineexplicit

Construct a CoordinateExpr with all elements set to the same scalar value.

Definition at line 59 of file CoordinateExpr.h.

59 : Super(val) {}
CoordinateBase< CoordinateExpr< N >, bool, N > Super
ImageT val
Definition: CR.cc:154
template<int N>
template<typename Vector >
lsst::afw::geom::CoordinateExpr< N >::CoordinateExpr ( Eigen::MatrixBase< Vector > const &  vector)
inlineexplicit

Construct a CoordinateExpr from an Eigen vector.

Definition at line 63 of file CoordinateExpr.h.

63 : Super(vector) {}
CoordinateBase< CoordinateExpr< N >, bool, N > Super

Member Function Documentation

template<int N>
CoordinateExpr lsst::afw::geom::CoordinateExpr< N >::and_ ( CoordinateExpr< N > const &  rhs) const
template<int N>
CoordinateExpr lsst::afw::geom::CoordinateExpr< N >::not_ ( ) const
template<int N>
CoordinateExpr lsst::afw::geom::CoordinateExpr< N >::or_ ( CoordinateExpr< N > const &  rhs) const

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