24 using boost::property_tree::ptree;
29 RangeSweep::RangeSweep(
double from,
double to,
double step) : m_from(from), m_to(to), m_step(step)
31 assert(m_from <= m_to && m_step > 0 &&
"The given parameters weren't valid.");
44 os << (m_from + index * m_step);
50 return static_cast<unsigned int>(std::floor((m_to - m_from) / m_step + 1));
57 pt.put(
"range.from", m_from);
58 pt.put(
"range.to", m_to);
59 pt.put(
"range.step", m_step);
64 void RangeSweep::ReadPtree(
const ptree& pt)
66 m_from = pt.get<
double>(
"range.from");
67 m_to = pt.get<
double>(
"range.to");
68 m_step = pt.get<
double>(
"range.step");
Interface for RangeSweep.
RangeSweep(double from, double to, double step)
Constructor.
Namespace for SimPT parameter explorer package.
virtual std::string GetValue(unsigned int index) const
Returns the value on the given index.
virtual boost::property_tree::ptree ToPtree() const
Convert the range sweep to a ptree.
virtual unsigned int GetNumberOfValues() const
Returns the number of values in the sweep.