BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
class describing the range in the coordinates it supports multiple range in a coordinate. The rnage dimension is the dimension of the coordinate, its size is the number of interval for each coordinate. Default range is -inf, inf Range can be modified with the add range method
Definition at line 34 of file DataRange.h.
Public Types | |
typedef std::vector< RangeSet > | RangeIntervals |
typedef std::vector< std::pair< double, double > > | RangeSet |
Public Member Functions | |
DataRange (double xmin, double xmax) | |
DataRange (double xmin, double xmax, double ymin, double ymax) | |
DataRange (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) | |
DataRange (unsigned int dim=1) | |
~DataRange () | |
void | AddRange (double xmin, double xmax) |
void | AddRange (double xmin, double xmax, double ymin, double ymax) |
void | AddRange (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) |
void | AddRange (unsigned int icoord, double xmin, double xmax) |
void | Clear (unsigned int icoord=0) |
void | GetRange (double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, unsigned int irange=0) const |
void | GetRange (double &xmin, double &xmax, double &ymin, double &ymax, unsigned int irange=0) const |
void | GetRange (double &xmin, double &xmax, unsigned int irange=0) const |
void | GetRange (double *xmin, double *xmax, unsigned int irange=0) const |
void | GetRange (unsigned int icoord, double &xmin, double &xmax) const |
void | GetRange (unsigned int irange, unsigned int icoord, double &xmin, double &xmax) const |
bool | IsInside (const double *x) const |
bool | IsInside (double x, unsigned int icoord=0) const |
bool | IsSet () const |
unsigned int | NDim () const |
std::pair< double, double > | operator() (unsigned int icoord=0, unsigned int irange=0) const |
const RangeSet & | Ranges (unsigned int icoord=0) const |
void | SetRange (double xmin, double xmax) |
void | SetRange (double xmin, double xmax, double ymin, double ymax) |
void | SetRange (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) |
void | SetRange (unsigned int icoord, double xmin, double xmax) |
unsigned int | Size (unsigned int icoord=0) const |
Protected Member Functions | |
void | CleanRangeSet (unsigned int icoord, double xmin, double xmax) |
Static Protected Member Functions | |
static void | GetInfRange (double &x1, double &x2) |
Private Attributes | |
RangeIntervals | fRanges |
typedef std::vector< RangeSet > ROOT::Fit::DataRange::RangeIntervals |
Definition at line 39 of file DataRange.h.
typedef std::vector<std::pair<double,double> > ROOT::Fit::DataRange::RangeSet |
Definition at line 38 of file DataRange.h.
|
inlineexplicit |
ROOT::Fit::DataRange::DataRange | ( | double | xmin, |
double | xmax | ||
) |
construct a range for [xmin, xmax]
ROOT::Fit::DataRange::DataRange | ( | double | xmin, |
double | xmax, | ||
double | ymin, | ||
double | ymax | ||
) |
construct a range for [xmin, xmax] , [ymin, ymax]
ROOT::Fit::DataRange::DataRange | ( | double | xmin, |
double | xmax, | ||
double | ymin, | ||
double | ymax, | ||
double | zmin, | ||
double | zmax | ||
) |
construct a range for [xmin, xmax] , [ymin, ymax] , [zmin, zmax]
|
inline |
|
inline |
add a range [xmin,xmax] for the first coordinate icoord
Definition at line 163 of file DataRange.h.
References AddRange().
Referenced by AddRange().
|
inline |
add a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate
Definition at line 167 of file DataRange.h.
References AddRange().
Referenced by AddRange().
|
inline |
add a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate and [zmin,zmax] for the third coordinate
Definition at line 172 of file DataRange.h.
References AddRange().
void ROOT::Fit::DataRange::AddRange | ( | unsigned int | icoord, |
double | xmin, | ||
double | xmax | ||
) |
add a range [xmin,xmax] for the new coordinate icoord Adding a range does not delete existing one, but takes the OR with existing ranges. if want to replace range use method SetRange, which replace range with existing one
Referenced by AddRange().
|
protected |
internal function to remove all the existing ranges between xmin and xmax called when a new range is inserted
void ROOT::Fit::DataRange::Clear | ( | unsigned int | icoord = 0 | ) |
clear all ranges in one coordinate (is now -inf, +inf)
|
staticprotected |
Referenced by GetRange().
|
inline |
get range for the x and y and z coordinates
Definition at line 134 of file DataRange.h.
References GetRange().
|
inline |
get range for the x and y coordinates
Definition at line 128 of file DataRange.h.
References GetRange().
|
inline |
get first range for the x - coordinate
Definition at line 124 of file DataRange.h.
References GetRange().
Referenced by GetRange().
|
inline |
get range for coordinates and fill the vector
Definition at line 140 of file DataRange.h.
References fRanges, and GetRange().
|
inline |
get the first range for given coordinate. If range does not exist return -inf, +inf
Definition at line 114 of file DataRange.h.
References fRanges, GetInfRange(), and Size().
|
inline |
get the i-th range for given coordinate. If range does not exist return -inf, +inf
Definition at line 103 of file DataRange.h.
References fRanges, GetInfRange(), and Size().
Referenced by GetRange().
|
inline |
check if a multi-dimpoint is inside the range
Definition at line 210 of file DataRange.h.
References fRanges, and IsInside().
bool ROOT::Fit::DataRange::IsInside | ( | double | x, |
unsigned int | icoord = 0 |
||
) | const |
check if a point is inside the range for the given coordinate
Referenced by IsInside().
|
inline |
return true if a range has been set in any of the coordinates i.e. when it is not [-inf,+inf] for all coordinates Avoid in case of multi-dim to loop on all the coordinated and ask the size
Definition at line 79 of file DataRange.h.
References fRanges.
|
inline |
std::pair<double, double> ROOT::Fit::DataRange::operator() | ( | unsigned int | icoord = 0 , |
unsigned int | irange = 0 |
||
) | const |
return the i-th range for the coordinate icoord. Useful method when only one range is present for the given coordinate
|
inline |
return the vector of ranges for the coordinate icoord
Definition at line 88 of file DataRange.h.
References fRanges.
|
inline |
set a range [xmin,xmax] for the first coordinate icoord
Definition at line 185 of file DataRange.h.
References SetRange().
Referenced by SetRange().
|
inline |
set a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate
Definition at line 189 of file DataRange.h.
References SetRange().
Referenced by SetRange().
|
inline |
set a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate and [zmin,zmax] for the third coordinate
Definition at line 194 of file DataRange.h.
References SetRange().
void ROOT::Fit::DataRange::SetRange | ( | unsigned int | icoord, |
double | xmin, | ||
double | xmax | ||
) |
set a range [xmin,xmax] for the new coordinate icoord If more range exists for other coordinates, delete the existing one and use it the new one Use Add range if want to keep the union of the existing ranges
Referenced by SetRange().
|
inline |
return range size for coordinate icoord (starts from zero) Size == 0 indicates no range is present [-inf, + inf]
Definition at line 70 of file DataRange.h.
References fRanges.
Referenced by GetRange().
|
private |
Definition at line 231 of file DataRange.h.
Referenced by GetRange(), IsInside(), IsSet(), NDim(), Ranges(), and Size().