41 #define G_ACCESS "GModelSpectralTablePars::operator[](std::string&)"
42 #define G_AT "GModelSpectralTablePars::at(int&)"
43 #define G_SET1 "GModelSpectralTablePars::set(int&, GModelSpectralTablePar&)"
44 #define G_SET2 "GModelSpectralTablePars::set(std::string&, "\
45 "GModelSpectralTablePar&)"
46 #define G_APPEND "GModelSpectralTablePars::append(GModelSpectralTablePar&)"
47 #define G_INSERT1 "GModelSpectralTablePars::insert(int&, "\
48 "GModelSpectralTablePar&)"
49 #define G_INSERT2 "GModelSpectralTablePars::insert(std::string&, "\
50 "GModelSpectralTablePar&)"
51 #define G_REMOVE1 "GModelSpectralTablePars::remove(int&)"
52 #define G_REMOVE2 "GModelSpectralTablePars::remove(const std::string& name)"
53 #define G_EXTEND "GModelSpectralTablePars::extend(GModelSpectralTablePars&)"
164 std::string msg =
"Table model parameter \""+name+
"\" not found. "
165 "Please specify a valid parameter name.";
220 #if defined(G_RANGE_CHECK)
221 if (index < 0 || index >=
size()) {
245 #if defined(G_RANGE_CHECK)
246 if (index < 0 || index >=
size()) {
277 #if defined(G_RANGE_CHECK)
278 if (index < 0 || index >=
size()) {
286 if (inx != -1 && inx != index) {
288 "Attempt to set table model parameter with name \""+
289 par.
par().
name()+
"\" in table model parameter container at index "+
290 gammalib::str(index)+
", but a table model parameter with the "
292 " in the container. Every table model parameter in the container "
293 "needs a unique name.";
300 if ((
m_pars[index] != NULL) && (
m_pars[index] != &par)) {
335 std::string msg =
"Table model parameter \""+name+
"\" not found. "
336 "Please specify a valid parameter name.";
341 return (
set(index, par));
363 "Attempt to append table model parameter with name \""+
364 par.
par().
name()+
"\" to table model parameter container, but a "
365 "table model parameter with the same name exists already at "
366 "index "+
gammalib::str(inx)+
" in the container. Every table "
367 "model parameter in the container needs a unique name.";
401 #if defined(G_RANGE_CHECK)
409 if (index < 0 || index >=
size()) {
420 "Attempt to insert table model parameter with name \""+
421 par.
par().
name()+
"\" in table model parameter container before "
422 "index "+
gammalib::str(index)+
", but table model parameter with "
423 "the same name exists already at index "+
424 gammalib::str(inx)+
" in the container. Every model in the table "
425 "model parameter container needs a unique name.";
461 std::string msg =
"Table model parameter \""+name+
"\" not found. "
462 "Please specify a valid parameter name.";
467 return (
insert(index, par));
484 #if defined(G_RANGE_CHECK)
485 if (index < 0 || index >=
size()) {
519 std::string msg =
"Table model parameter \""+name+
"\" not found. "
520 "Please specify a valid parameter name.";
547 int num = pars.
size();
554 for (
int i = 0; i < num; ++i) {
557 int inx =
get_index(pars[i]->par().name());
560 "Attempt to append table model parameter with name \""+
561 pars[i]->par().name()+
"\" to table model parameter "
562 "container, but a table model parameter with the same "
564 "in the container. Every table model parameter in the "
565 "container needs a unique name.";
596 return (index != -1);
615 result.append(
"=== GModelSpectralTablePars ===");
620 for (
int i = 0; i <
size(); ++i) {
659 for (
int i = 0; i < pars.
m_pars.size(); ++i) {
674 for (
int i = 0; i <
m_pars.size(); ++i) {
699 for (
int i = 0; i <
size(); ++i) {
700 if (
m_pars[i]->par().name() == name) {
int get_index(const std::string &name) const
Return parameter index by name.
GModelSpectralTablePar * append(const GModelSpectralTablePar &par)
Append table model parameter to container.
std::vector< GModelSpectralTablePar * > m_pars
List of parameters.
const std::string & name(void) const
Return parameter name.
void init_members(void)
Initialise class members.
void extend(const GModelSpectralTablePars &pars)
Append table model parameter container.
void remove(const int &index)
Remove table model parameter from container.
Spectral table model parameter container class.
GModelSpectralTablePar * at(const int &index)
Return pointer to table model parameter.
GModelSpectralTablePar * set(const int &index, const GModelSpectralTablePar &par)
Set table model parameter in container.
int size(void) const
Return number of table model parameters in container.
GModelSpectralTablePar * operator[](const int &index)
Return pointer to table model parameter.
void copy_members(const GModelSpectralTablePars &model)
Copy class members.
virtual ~GModelSpectralTablePars(void)
Destructor.
Spectral table model parameter container class definition.
GModelSpectralTablePar * clone(void) const
Clone table model parameter.
void clear(void)
Clear table model parameters.
bool contains(const std::string &name) const
Signals if table model parameter exists.
Exception handler interface definition.
void free_members(void)
Delete class members.
GModelSpectralTablePars & operator=(const GModelSpectralTablePars &pars)
Assignment operator.
bool is_empty(void) const
Signals if there are no table model parameters in container.
void reserve(const int &num)
Reserves space for table model parameters in container.
GModelSpectralTablePar * insert(const int &index, const GModelSpectralTablePar &par)
Insert table model parameter into container.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
GModelSpectralTablePars * clone(void) const
Clone table model parameters.
GModelPar & par(void)
Return reference to table model parameter.
GModelSpectralTablePars(void)
Void constructor.
Spectral table model parameter class.
std::string print(const GChatter &chatter=NORMAL) const
Print table model parameters.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.