56 const std::vector<double> &y_values_,
57 const unsigned int n_intervals,
62 "Your input data needs to contain at least one input vector."));
64 ExcMessage(
"The number of intervals needs to be at least one."));
65 for (
unsigned int i = 0; i < values.size(); ++i)
67 Assert(values.size() == y_values_.size(),
75 number min_value = 0, max_value = 0;
76 switch (interval_spacing)
80 min_value = *std::min_element(values[0].begin(), values[0].end());
81 max_value = *std::max_element(values[0].begin(), values[0].end());
83 for (
unsigned int i = 1; i < values.size(); ++i)
87 *std::min_element(values[i].begin(), values[i].end()));
90 *std::max_element(values[i].begin(), values[i].end()));
98 const auto logarithmic_less_function =
101 min_value = *std::min_element(values[0].begin(),
103 logarithmic_less_function);
105 max_value = *std::max_element(values[0].begin(),
107 logarithmic_less_function);
109 for (
unsigned int i = 1; i < values.size(); ++i)
112 *std::min_element(values[i].begin(),
114 logarithmic_less_function),
115 logarithmic_less_function);
118 *std::max_element(values[i].begin(),
120 logarithmic_less_function),
121 logarithmic_less_function);
136 if (max_value <= min_value)
137 max_value = min_value + 1;
150 switch (interval_spacing)
154 const float delta = (max_value - min_value) / n_intervals;
156 for (
unsigned int n = 0; n < n_intervals; ++n)
157 intervals[0].emplace_back(min_value + n * delta,
158 min_value + (n + 1) * delta);
168 for (
unsigned int n = 0; n < n_intervals; ++n)
181 for (
unsigned int i = 1; i < values.size(); ++i)
186 for (
unsigned int i = 0; i < values.size(); ++i)
197 for (
unsigned int n = 0; n < n_intervals; ++n)
228 ExcMessage(
"There is nothing to write into the output file. "
229 "Did you forget to call the evaluate() function?"));
235 for (
const auto &interval :
intervals[0])
236 out << interval.left_point <<
' ' << interval.content << std::endl
237 << interval.right_point <<
' ' << interval.content << std::endl;
248 for (
int i =
intervals.size() - 1; i >= 0; --i)
250 for (
unsigned int n = 0; n <
intervals[i].size(); ++n)
252 << (i <
static_cast<int>(
intervals.size()) - 1 ?
255 <<
' ' <<
intervals[i][n].content << std::endl
257 << (i < static_cast<int>(
intervals.size()) - 1 ?
260 <<
' ' <<
intervals[i][n].content << std::endl;
263 for (
unsigned int n = 0; n <
intervals[i].size(); ++n)
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)