41 #include "../Numeric/NumConstants.h" 43 #include "../Text/KeyvalTools.h" 72 vector<double> values;
75 if(desc.substr(0,3) ==
"seq")
77 map<string, string> keyvals;
79 if(keyvals.find(
"from") == keyvals.end())
throw Exception(
"Unvalid sequence specification, missing 'from' key: " + desc.substr(3, desc.size() - 5));
80 if(keyvals.find(
"to") == keyvals.end())
throw Exception(
"Unvalid sequence specification, missing 'to' key: " + desc.substr(3, desc.size() - 5));
81 if(keyvals.find(
"step") == keyvals.end() && keyvals.find(
"size") == keyvals.end())
82 throw Exception(
"Unvalid sequence specification, missing 'step' or 'size' key: " + desc.substr(3, desc.size() - 5));
85 if(keyvals.find(
"step") != keyvals.end())
94 double step = (end - start) / (
double)size;
95 for(
int i = 0; i < size - 1; i++)
96 values.push_back(start + i * step);
97 values.push_back(end);
112 for(
unsigned int i = 0; i < pl.
size(); i++)
124 map<string, string>& params,
125 const string& suffix,
126 bool suffixIsOptional,
129 unsigned int nbParams = ApplicationTools::getParameter<unsigned int>(
"grid.number_of_parameters", params, 1, suffix, suffixIsOptional, warn);
131 for(
unsigned int i = 0; i < nbParams; i++)
135 grid->addDimension(name, values);
This class allows to perform a correspondence analysis.
bool hasMoreToken() const
Tell if some tokens are still available.
This class is designed to facilitate the manipulation of parameters.
const std::string & nextToken()
Get the next available token. If no token is availbale, throw an Exception.
static std::string toString(T t)
General template method to convert to a string.
static int toInt(const std::string &s, char scientificNotation='e')
Convert from string to int.
The parameter list object.
const std::string & getToken(size_t pos) const
Get a particular token.
size_t numberOfRemainingTokens() const
Tell how many tokens are available.
This class is a data structure to specify a set of parameter values (most likely for evaluation by a ...
virtual const std::string & getName() const
Get the name of this parameter.
virtual double getValue() const
Get the value of this parameter.
static double toDouble(const std::string &s, char dec='.', char scientificNotation='e')
Convert from string to double.