31 TCS_EXCEPTION(
"ParameterSpace: parameter '" <<
p.name() <<
"|" <<
p.selection() <<
32 "' exists already in parameter space of '" <<
algName() <<
"' and can't be added");
34 m_parameters.push_back(
p);
35 m_parameters.back().setIsDefault(
true);
51 bool foundParameter =
false;
57 ( !pa.isExtended() && pa.name()==
p.name() ) ||
58 ( pa.isExtended() && pa.name()==
p.name() && pa.selection()==
p.selection() );
60 if(! foundParameter)
continue;
62 if( pa.isExtended() ) {
63 pa.setValue(
p.value());
64 pa.setPosition(
p.position());
65 pa.setSelection(
p.selection());
66 pa.setIsExtended(
true);
68 pa.setValue(
p.value());
69 pa.setIsExtended(
false);
71 pa.setIsDefault(
false);
75 if( ! foundParameter ) {
76 cout <<
"Parameter '" <<
p.name() <<
"' not found for algorithm " <<
algName()
77 <<
" and can't be set. Available parameters are" << endl;
80 cout <<
" " << pa.name() <<
" " << (pa.isExtended()?
"array":
"single") << endl;
82 TCS_EXCEPTION(
"Parameter '" <<
p.name() <<
"' not found for algorithm " <<
algName() <<
" and can't be set." );
94 if( (pa.name() == parameterName) && (pa.selection() ==
selection) )
return true;
101 ParameterSpace::parameter(
const std::string & parameterName)
const {
102 for(
const Parameter & pa : m_parameters) {
103 if( pa.isExtended() )
continue;
104 if( pa.name() == parameterName )
108 TCS_EXCEPTION(
"Single parameter " << parameterName <<
" not found for algorithm " <<
algName());
109 return m_parameters[0];
114 ParameterSpace::parameter(
const std::string & parameterName,
unsigned int selection)
const {
115 for(
const Parameter & pa : m_parameters) {
116 if( ! pa.isExtended() )
continue;
117 if( (pa.name() == parameterName) && (pa.selection() ==
selection) )
122 return m_parameters[0];
132 o <<
" parameters: " << ps().size();
134 o << endl <<
" " << parameter;