LTL
2.0.x
|
To represent geometries or subarrays of N-dimensional arrays. More...
Public Member Functions | |
Region (const std::size_t N) | |
Construct an N dimensional Region. More... | |
Region (const Region &other) | |
Construct as copy from other. More... | |
Region (const std::string &s, const std::size_t N) | |
Construct as N dimensional Region from input string with format start_1:end_1,...,start_N:end_N. More... | |
~Region () | |
std::size_t | getDim () const |
Return number of dimensions. More... | |
int | getStart (const std::size_t i) const |
Return start coordinate of dimension i. More... | |
int | getEnd (const std::size_t i) const |
Return end coordinate of dimension i. More... | |
std::size_t | getLength () const |
Return size of Region. More... | |
std::size_t | getLength (const std::size_t i) const |
Return length along dimension i. More... | |
Region | getSlice (const std::size_t startdim, const std::size_t enddim) const |
Return a (rand reduced) slice of Region. More... | |
void | setStart (const std::size_t i, const int x) |
Set start coordinate of dimension i to x. More... | |
void | setEnd (const std::size_t i, const int x) |
Set end coordinate of dimension i to x. More... | |
void | setRange (const std::size_t i, const int s, const int e) |
Set range of dimension i to start at s and end at e. More... | |
void | setRegion (const Region ®ion) |
Copy settings from region. More... | |
std::string | toString () const |
Parse Region to a string with format start_1:end_1,...,start_N:end_N. More... | |
Protected Attributes | |
const std::size_t | N_ |
Number of dimensions. More... | |
int *const | start_ |
Pointer to array with start coordinates. More... | |
int *const | end_ |
Pointer to array with end coordinates. More... | |
Static Protected Attributes | |
static const std::string | error_get_dim |
Error message for invalid dimension requests. More... | |
static const std::string | error_set_dim |
Error message for invalid dimension requests. More... | |
To represent geometries or subarrays of N-dimensional arrays.
A utility class to allow an easy selection of regions within N-dimensional arrays. Used for Interfacing with command line, config file and FITS I/O.
UException | on request of illegal (i.e. > N or < 0) dimensions. |
util::Region::Region | ( | const std::size_t | N | ) |
Construct an N dimensional Region.
util::Region::Region | ( | const Region & | other | ) |
Construct as copy from other.
util::Region::Region | ( | const std::string & | s, |
const std::size_t | N | ||
) |
Construct as N dimensional Region from input string with format start_1:end_1,...,start_N:end_N.
|
inline |
References start_.
|
inline |
Return number of dimensions.
References N_.
int util::Region::getStart | ( | const std::size_t | i | ) | const |
Return start coordinate of dimension i.
Referenced by ltl::getMArrayRegion().
int util::Region::getEnd | ( | const std::size_t | i | ) | const |
Return end coordinate of dimension i.
Referenced by ltl::getMArrayRegion().
std::size_t util::Region::getLength | ( | ) | const |
Return size of Region.
Referenced by ltl::getMArrayRegion().
std::size_t util::Region::getLength | ( | const std::size_t | i | ) | const |
Return length along dimension i.
Region util::Region::getSlice | ( | const std::size_t | startdim, |
const std::size_t | enddim | ||
) | const |
Return a (rand reduced) slice of Region.
void util::Region::setStart | ( | const std::size_t | i, |
const int | x | ||
) |
Set start coordinate of dimension i to x.
void util::Region::setEnd | ( | const std::size_t | i, |
const int | x | ||
) |
Set end coordinate of dimension i to x.
Set range of dimension i to start at s and end at e.
Referenced by ltl::insertFitsMArray().
void util::Region::setRegion | ( | const Region & | region | ) |
Copy settings from region.
std::string util::Region::toString | ( | ) | const |
Parse Region to a string with format start_1:end_1,...,start_N:end_N.
|
protected |
Number of dimensions.
Referenced by getDim().
|
protected |
Pointer to array with start coordinates.
Referenced by ~Region().
|
protected |
Pointer to array with end coordinates.
|
staticprotected |
Error message for invalid dimension requests.
|
staticprotected |
Error message for invalid dimension requests.