69 explicit GBounds(
const std::vector<double>& array,
const std::string&
unit =
"");
75 const std::string& method,
76 const std::string&
unit =
"",
77 const double& gamma = 1.0);
89 const std::string&
unit(
void)
const;
96 void set(
const std::vector<double>& array);
97 void set(
const int& num,
100 const std::string& method,
101 const double& gamma = 1.0);
104 const bool& clobber =
false)
const;
108 int index(
const double& value)
const;
109 double min(
void)
const;
110 double max(
void)
const;
111 void min(
const int&
index,
const double& value);
112 void max(
const int&
index,
const double& value);
118 bool contains(
const double& value)
const;
156 return (
m_min.size());
168 return (
m_min.empty());
bool operator!=(const GBounds &a, const GBounds &b)
Boundaries inequality operator friend.
Definition of interface for container classes.
Energy value class definition.
Boundaries container class.
void insert(const double &min, const double &max)
Insert interval.
void extend(const GBounds &bounds)
Append boundaries.
void read(const GFitsTable &table)
Read boundaries from FITS table.
void remove(const int &index)
Remove interval.
void clear(void)
Clear boundaries.
friend bool operator!=(const GBounds &a, const GBounds &b)
Boundaries inequality operator friend.
GBounds(void)
Void constructor.
bool is_empty(void) const
Signal if there are no boundaries.
GBounds * clone(void) const
Clone boundaries.
void init_members(void)
Initialise class members.
const std::string & unit(void) const
Return boundary units.
void free_members(void)
Delete class members.
void append(const double &min, const double &max)
Append interval.
friend bool operator==(const GBounds &a, const GBounds &b)
Boundaries equality operator friend.
void reserve(const int &num)
Reserve space for intervals.
void copy_members(const GBounds &bounds)
Copy class members.
std::string m_unit
Unit of values.
std::vector< double > m_max
Array of interval maximum values.
void save(const GFilename &filename, const bool &clobber=false) const
Save boundaries into FITS file.
double max(void) const
Return maximum value of all intervals.
GBounds & operator=(const GBounds &bounds)
Assignment operator.
std::string print(const GChatter &chatter=NORMAL) const
Print boundaries.
double mean(const int &index) const
Returns mean value for a given interval.
double min(void) const
Return minimum value of all intervals.
virtual ~GBounds(void)
Destructor.
void insert_interval(const int &index, const double &min, const double &max)
Insert interval.
void write(GFits &file, const std::string &extname=gammalib::extname_bounds) const
Write boundaries into FITS object.
std::vector< double > m_min
Array of interval minimum values.
int size(void) const
Return number of boundaries.
void set(const std::vector< double > &array)
Set boundaries from array.
bool contains(const double &value) const
Checks whether boundaries contain value.
std::string classname(void) const
Return class name.
double logmean(const int &index) const
Returns logarithmic mean value for a given interval.
void load(const GFilename &filename)
Load boundaries from FITS file.
double width(const int &index) const
Returns interval width.
int index(const double &value) const
Returns bin index for a value.
Interface class for container classes.
Abstract interface for FITS table.
const std::string extname_bounds