42 #include "../Numeric/NumConstants.h"
43 #include "../Text/KeyvalTools.h"
54 while (st->hasMoreToken())
56 unique_ptr<StringTokenizer> st2(
new StringTokenizer(st->nextToken(), seqdelim,
true));
58 if (st2->numberOfRemainingTokens() > 1)
74 vector<double> values;
77 if (desc.substr(0, 3) ==
"seq")
79 map<string, string> keyvals;
81 if (keyvals.find(
"from") == keyvals.end())
82 throw Exception(
"Unvalid sequence specification, missing 'from' key: " + desc.substr(3, desc.size() - 5));
83 if (keyvals.find(
"to") == keyvals.end())
84 throw Exception(
"Unvalid sequence specification, missing 'to' key: " + desc.substr(3, desc.size() - 5));
85 if (keyvals.find(
"step") == keyvals.end() && keyvals.find(
"size") == keyvals.end())
86 throw Exception(
"Unvalid sequence specification, missing 'step' or 'size' key: " + desc.substr(3, desc.size() - 5));
89 if (keyvals.find(
"step") != keyvals.end())
100 double step = (end - start) / (
double)size;
101 for (
int i = 0; i < size - 1; i++)
103 values.push_back(start + i * step);
105 values.push_back(end);
120 for (
unsigned int i = 0; i < pl.
size(); i++)
131 map<string, string>& params,
132 const string& suffix,
133 bool suffixIsOptional,
136 unsigned int nbParams = ApplicationTools::getParameter<unsigned int>(
"grid.number_of_parameters", params, 1, suffix, suffixIsOptional, warn);
138 for (
unsigned int i = 0; i < nbParams; i++)
Exception base class. Overload exception constructor (to control the exceptions mechanism)....
This class is a data structure to specify a set of parameter values (most likely for evaluation by a ...
void addDimension(const std::string &name, const Vdouble &values)
Add a new dimension (parameter name + corresponding values).
The parameter list object.
This class is designed to facilitate the manipulation of parameters.
virtual double getValue() const
Get the value of this parameter.
virtual const std::string & getName() const
Get the name of this parameter.
const std::string & nextToken()
Get the next available token. If no token is availbale, throw an Exception.
bool hasMoreToken() const
Tell if some tokens are still available.
int toInt(const std::string &s, char scientificNotation)
Convert from string to int.
double toDouble(const std::string &s, char dec, char scientificNotation)
Convert from string to double.
std::string toString(T t)
General template method to convert to a string.