LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Member Functions | Private Attributes | List of all members
lsst.afw.math::IntRegion< T > Struct Template Reference

#include <Integrate.h>

Public Member Functions

 IntRegion (T const a, T const b, std::ostream *dbgout=0)
 
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::ostream * getDbgout ()
 

Private Attributes

_a
 
_b
 
_error
 
_area
 
std::vector< T > _splitpoints
 
std::ostream * _dbgout
 

Detailed Description

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

Definition at line 202 of file Integrate.h.

Constructor & Destructor Documentation

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

Definition at line 205 of file Integrate.h.

205  :
206  _a(a), _b(b), _error(0.0), _area(0), _dbgout(dbgout) {}
afw::table::Key< double > b
std::ostream *const dbgout
Definition: dbg.h:64
std::ostream * _dbgout
Definition: Integrate.h:255

Member Function Documentation

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

Definition at line 238 of file Integrate.h.

238 { _splitpoints.push_back(x); }
std::vector< T > _splitpoints
Definition: Integrate.h:254
int x
template<class T>
T const& lsst.afw.math::IntRegion< T >::Area ( ) const
inline

Definition at line 244 of file Integrate.h.

244 { return _area; }
template<class T>
void lsst.afw.math::IntRegion< T >::Bisect ( )
inline

Definition at line 237 of file Integrate.h.

237 { _splitpoints.push_back((_a + _b)/2.0); }
std::vector< T > _splitpoints
Definition: Integrate.h:254
template<class T>
T const& lsst.afw.math::IntRegion< T >::Err ( ) const
inline

Definition at line 243 of file Integrate.h.

243 { return _error; }
template<class T>
std::ostream* lsst.afw.math::IntRegion< T >::getDbgout ( )
inline

Definition at line 250 of file Integrate.h.

250 { return _dbgout; }
std::ostream * _dbgout
Definition: Integrate.h:255
template<class T>
T const& lsst.afw.math::IntRegion< T >::Left ( ) const
inline

Definition at line 241 of file Integrate.h.

241 { return _a; }
template<class T>
size_t lsst.afw.math::IntRegion< T >::NSplit ( ) const
inline

Definition at line 239 of file Integrate.h.

239 { return _splitpoints.size(); }
std::vector< T > _splitpoints
Definition: Integrate.h:254
template<class T>
bool lsst.afw.math::IntRegion< T >::operator< ( IntRegion< T > const &  r2) const
inline

Definition at line 208 of file Integrate.h.

208 { return _error < r2._error; }
template<class T>
bool lsst.afw.math::IntRegion< T >::operator> ( IntRegion< T > const &  r2) const
inline

Definition at line 209 of file Integrate.h.

209 { return _error > r2._error; }
template<class T>
T const& lsst.afw.math::IntRegion< T >::Right ( ) const
inline

Definition at line 242 of file Integrate.h.

242 {return _b; }
template<class T>
void lsst.afw.math::IntRegion< T >::SetArea ( const T &  a,
const T &  e 
)
inline

Definition at line 245 of file Integrate.h.

245  {
246  _area = a;
247  _error = e;
248  }
template<class T>
void lsst.afw.math::IntRegion< T >::SubDivide ( std::vector< IntRegion< T > > *  children)
inline

Definition at line 211 of file Integrate.h.

211  {
212  assert(children->size() == 0);
213  if (_splitpoints.size() == 0) { Bisect(); }
214  if (_splitpoints.size() > 1) {
215  std::sort(_splitpoints.begin(), _splitpoints.end());
216  }
217 
218 #if 0
219  if (_a > _splitpoints[0] || _b < _splitpoints.back()) {
220  std::cerr << "a, b = " << _a << ', ' << _b << std::endl;
221  std::cerr << "_splitpoints = ";
222  for (size_t i = 0; i<_splitpoints.size(); i++) {
223  std::cerr << _splitpoints[i] << " ";
224  }
225  std::cerr << std::endl;
226  }
227 #endif
228  assert(_splitpoints[0] >= _a);
229  assert(_splitpoints.back() <= _b);
230  children->push_back(IntRegion<T>(_a, _splitpoints[0], _dbgout));
231  for (size_t i = 1; i<_splitpoints.size(); i++) {
232  children->push_back(IntRegion<T>(_splitpoints[i-1], _splitpoints[i], _dbgout));
233  }
234  children->push_back(IntRegion<T>(_splitpoints.back(), _b, _dbgout));
235  }
std::vector< T > _splitpoints
Definition: Integrate.h:254
std::ostream * _dbgout
Definition: Integrate.h:255

Member Data Documentation

template<class T>
T lsst.afw.math::IntRegion< T >::_a
private

Definition at line 253 of file Integrate.h.

template<class T>
T lsst.afw.math::IntRegion< T >::_area
private

Definition at line 253 of file Integrate.h.

template<class T>
T lsst.afw.math::IntRegion< T >::_b
private

Definition at line 253 of file Integrate.h.

template<class T>
std::ostream* lsst.afw.math::IntRegion< T >::_dbgout
private

Definition at line 255 of file Integrate.h.

template<class T>
T lsst.afw.math::IntRegion< T >::_error
private

Definition at line 253 of file Integrate.h.

template<class T>
std::vector<T> lsst.afw.math::IntRegion< T >::_splitpoints
private

Definition at line 254 of file Integrate.h.


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