8 #ifndef READUCT_ELEMENTARYSTEPOPTIMIZATION_POINTSEQUENCE_H
9 #define READUCT_ELEMENTARYSTEPOPTIMIZATION_POINTSEQUENCE_H
19 namespace ElementaryStepOptimization {
38 double operator[](
int index)
const;
39 double at(
int index)
const;
44 const std::vector<double>& underlyingArray()
const;
47 using container = std::vector<double>;
53 inline PointSequence::PointSequence(
double min,
double max,
int numberPoints) {
55 assert(numberPoints > 1);
57 interval_ = (max - min) / (numberPoints - 1);
59 points_.resize(numberPoints);
61 for (
int i = 0; i < numberPoints; ++i) {
62 points_[i] = min + i * interval_;
66 inline int PointSequence::count()
const {
67 return static_cast<int>(points_.size());
79 inline double PointSequence::operator[](
int index)
const {
80 return points_[
static_cast<container::size_type
>(index)];
83 inline double PointSequence::at(
int index)
const {
84 return points_.at(static_cast<container::size_type>(index));
87 inline double PointSequence::min()
const {
88 return points_.front();
91 inline double PointSequence::max()
const {
92 return points_.back();
95 inline const std::vector<double>& PointSequence::underlyingArray()
const {
103 #endif // ELEMENTARYSTEPOPTIMIZATION_POINTSEQUENCE_H
Definition: PointSequence.h:25
double interval() const
Definition: PointSequence.h:74
bool isUniform() const
Definition: PointSequence.h:70