LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Public Member Functions | List of all members
lsst::afw::math::IntRegion< T > Struct Template Referencefinal

#include <Integrate.h>

Public Member Functions

 IntRegion (T const a, T const b, std::ostream *dbgout=0)
 
 IntRegion (IntRegion const &)=default
 
 IntRegion (IntRegion &&)=default
 
IntRegionoperator= (IntRegion const &)=default
 
IntRegionoperator= (IntRegion &&)=default
 
 ~IntRegion ()=default
 
bool operator< (IntRegion< T > const &r2) const
 
bool operator> (IntRegion< T > const &r2) const
 
void SubDivide (std::vector< IntRegion< T > > *children)
 
void Bisect ()
 
void AddSplit (const T x)
 
size_t NSplit () const
 
T const & Left () const
 
T const & Right () const
 
T const & Err () const
 
T const & Area () const
 
void SetArea (const T &a, const T &e)
 
std::ostreamgetDbgout ()
 

Detailed Description

template<class T>
struct lsst::afw::math::IntRegion< T >

Definition at line 209 of file Integrate.h.

Constructor & Destructor Documentation

◆ IntRegion() [1/3]

template<class T>
lsst::afw::math::IntRegion< T >::IntRegion ( T const  a,
T const  b,
std::ostream dbgout = 0 
)
inline

Definition at line 211 of file Integrate.h.

212  : _a(a), _b(b), _error(0.0), _area(0), _dbgout(dbgout) {}
table::Key< int > b
table::Key< int > a

◆ IntRegion() [2/3]

template<class T>
lsst::afw::math::IntRegion< T >::IntRegion ( IntRegion< T > const &  )
default

◆ IntRegion() [3/3]

template<class T>
lsst::afw::math::IntRegion< T >::IntRegion ( IntRegion< T > &&  )
default

◆ ~IntRegion()

template<class T>
lsst::afw::math::IntRegion< T >::~IntRegion ( )
default

Member Function Documentation

◆ AddSplit()

template<class T>
void lsst::afw::math::IntRegion< T >::AddSplit ( const T  x)
inline

Definition at line 252 of file Integrate.h.

252 { _splitpoints.push_back(x); }
double x

◆ Area()

template<class T>
T const& lsst::afw::math::IntRegion< T >::Area ( ) const
inline

Definition at line 258 of file Integrate.h.

258 { return _area; }

◆ Bisect()

template<class T>
void lsst::afw::math::IntRegion< T >::Bisect ( )
inline

Definition at line 251 of file Integrate.h.

251 { _splitpoints.push_back((_a + _b) / 2.0); }

◆ Err()

template<class T>
T const& lsst::afw::math::IntRegion< T >::Err ( ) const
inline

Definition at line 257 of file Integrate.h.

257 { return _error; }

◆ getDbgout()

template<class T>
std::ostream* lsst::afw::math::IntRegion< T >::getDbgout ( )
inline

Definition at line 264 of file Integrate.h.

264 { return _dbgout; }

◆ Left()

template<class T>
T const& lsst::afw::math::IntRegion< T >::Left ( ) const
inline

Definition at line 255 of file Integrate.h.

255 { return _a; }

◆ NSplit()

template<class T>
size_t lsst::afw::math::IntRegion< T >::NSplit ( ) const
inline

Definition at line 253 of file Integrate.h.

253 { return _splitpoints.size(); }

◆ operator<()

template<class T>
bool lsst::afw::math::IntRegion< T >::operator< ( IntRegion< T > const &  r2) const
inline

Definition at line 220 of file Integrate.h.

220 { return _error < r2._error; }

◆ operator=() [1/2]

template<class T>
IntRegion& lsst::afw::math::IntRegion< T >::operator= ( IntRegion< T > const &  )
default

◆ operator=() [2/2]

template<class T>
IntRegion& lsst::afw::math::IntRegion< T >::operator= ( IntRegion< T > &&  )
default

◆ operator>()

template<class T>
bool lsst::afw::math::IntRegion< T >::operator> ( IntRegion< T > const &  r2) const
inline

Definition at line 221 of file Integrate.h.

221 { return _error > r2._error; }

◆ Right()

template<class T>
T const& lsst::afw::math::IntRegion< T >::Right ( ) const
inline

Definition at line 256 of file Integrate.h.

256 { return _b; }

◆ SetArea()

template<class T>
void lsst::afw::math::IntRegion< T >::SetArea ( const T &  a,
const T &  e 
)
inline

Definition at line 259 of file Integrate.h.

259  {
260  _area = a;
261  _error = e;
262  }
table::Key< int > a

◆ SubDivide()

template<class T>
void lsst::afw::math::IntRegion< T >::SubDivide ( std::vector< IntRegion< T > > *  children)
inline

Definition at line 223 of file Integrate.h.

223  {
224  assert(children->size() == 0);
225  if (_splitpoints.size() == 0) {
226  Bisect();
227  }
228  if (_splitpoints.size() > 1) {
229  std::sort(_splitpoints.begin(), _splitpoints.end());
230  }
231 
232 #if 0
233  if (_a > _splitpoints[0] || _b < _splitpoints.back()) {
234  std::cerr << "a, b = " << _a << ', ' << _b << std::endl;
235  std::cerr << "_splitpoints = ";
236  for (size_t i = 0; i<_splitpoints.size(); i++) {
237  std::cerr << _splitpoints[i] << " ";
238  }
239  std::cerr << std::endl;
240  }
241 #endif
242  assert(_splitpoints[0] >= _a);
243  assert(_splitpoints.back() <= _b);
244  children->push_back(IntRegion<T>(_a, _splitpoints[0], _dbgout));
245  for (size_t i = 1; i < _splitpoints.size(); i++) {
246  children->push_back(IntRegion<T>(_splitpoints[i - 1], _splitpoints[i], _dbgout));
247  }
248  children->push_back(IntRegion<T>(_splitpoints.back(), _b, _dbgout));
249  }
T endl(T... args)
T push_back(T... args)
T size(T... args)
T sort(T... args)

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