36 #define G_REMOVE "GPhases::remove(int&)"
37 #define G_PMIN "GPhases::pmin(int&)"
38 #define G_PMAX "GPhases::pmax(int&)"
39 #define G_INSERT_INTERVAL "GPhases::insert_interval(int&, double&, double&)"
139 if (
this != &phases) {
203 bool contained =
false;
206 for (
int i = 0; i <
size(); ++i) {
246 #if defined(G_RANGE_CHECK)
248 if (index < 0 || index >=
size()) {
294 int num = phases.
size();
300 for (
int i = 0; i < num; ++i) {
323 #if defined(G_RANGE_CHECK)
325 if (index < 0 || index >=
size()) {
347 #if defined(G_RANGE_CHECK)
349 if (index < 0 || index >=
size()) {
371 for (
int i = 0; i <
size(); ++i) {
395 result.append(
"=== GPhases ===");
402 for (
int i = 0; i <
size(); ++i) {
406 result.append(
" - ");
482 if (pmin < 0.0 || pmin > 1.0) {
484 " outside the valid range [0,1]. Please "
485 "specify phase interval boundaries comprised "
491 if (pmax < 0.0 || pmax > 1.0) {
493 " outside the valid range [0,1]. Please "
494 "specify phase interval boundaries comprised "
502 if (index >=
size()) {
515 else if (pmin > pmax) {
517 if (index >=
size()) {
527 if (index >=
size()) {
void clear(void)
Clear phase intervals.
void remove(const int &index)
Remove phase interval.
#define G_INSERT_INTERVAL
double length(void) const
Returns total length of phase intervals.
void append(const double &pmin, const double &pmax)
Append phase interval.
double pmax(const int &index) const
Returns upper boundary for a given phase interval.
void reserve(const int &num)
Reserve space for phase intervals.
int size(void) const
Return number of phase intervals.
GPhases * clone(void) const
Clone phase intervals.
virtual ~GPhases(void)
Destructor.
bool is_empty(void) const
Signal if there are no phase intervals.
void init_members(void)
Initialise class members.
Phase intervals class interface definition.
void insert_interval(const int &index, const double &pmin, const double &pmax)
Insert phase interval.
bool contains(const double &phase) const
Check whether phase is contained in phases.
void copy_members(const GPhases &phases)
Copy class members.
void extend(const GPhases &phases)
Append phase intervals.
std::vector< double > m_pmax
Exception handler interface definition.
void free_members(void)
Delete class members.
GPhases & operator=(const GPhases &phases)
Assignment operator.
std::vector< double > m_pmin
double pmin(const int &index) const
Returns lower boundary for a given phase interval.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
GPhases(void)
Void constructor.
std::string print(const GChatter &chatter=NORMAL) const
Print phase intervals.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.