27template <
typename number>
31 return (((
n1 <
n2) && (
n1 > 0)) || ((
n1 <
n2) && (
n2 <= 0)) ||
32 ((
n2 <
n1) && (
n1 > 0) && (
n2 <= 0)));
38 : left_point(left_point)
39 , right_point(right_point)
53template <
typename number>
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)
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()));
101 min_value = *std::min_element(values[0].begin(),
105 max_value = *std::max_element(values[0].begin(),
109 for (
unsigned int i = 1; i < values.size(); ++i)
112 *std::min_element(values[i].begin(),
118 *std::max_element(values[i].begin(),
156 for (
unsigned int n = 0; n < n_intervals; ++n)
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)
208template <
typename number>
211 const unsigned int n_intervals,
214 std::vector<Vector<number>>
values_list(1, values);
216 std::vector<double>(1, 0.),
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
260 <<
' ' <<
intervals[i][n].content << std::endl;
263 for (
unsigned int n = 0; n <
intervals[i].size(); ++n)
280 return "linear|logarithmic";
288 if (name ==
"linear")
290 else if (name ==
"logarithmic")
313Histogram::evaluate<float>(
const std::vector<
Vector<float>> &values,
314 const std::vector<double> &
y_values,
315 const unsigned int n_intervals,
319 const unsigned int n_intervals,
325Histogram::evaluate<double>(
const std::vector<
Vector<double>> &values,
326 const std::vector<double> &
y_values,
327 const unsigned int n_intervals,
331 const unsigned int n_intervals,
void write_gnuplot(std::ostream &out) const
static std::string get_interval_spacing_names()
std::vector< double > y_values
static IntervalSpacing parse_interval_spacing(const std::string &name)
static bool logarithmic_less(const number n1, const number n2)
std::vector< std::vector< Interval > > intervals
std::size_t memory_consumption() const
void evaluate(const std::vector< Vector< number > > &values, const std::vector< double > &y_values, const unsigned int n_intervals, const IntervalSpacing interval_spacing=linear)
const value_type * const_iterator
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcInvalidName(std::string arg1)
static ::ExceptionBase & ExcIO()
#define Assert(cond, exc)
static ::ExceptionBase & ExcIncompatibleArraySize(int arg1, int arg2)
static ::ExceptionBase & ExcEmptyData()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
#define DEAL_II_ASSERT_UNREACHABLE()
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
::VectorizedArray< Number, width > log(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > exp(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
Interval(const double left_point, const double right_point)
std::size_t memory_consumption() const