deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
histogram.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 1999 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_histogram_h
14#define dealii_histogram_h
15
16
17#include <deal.II/base/config.h>
18
20
21#include <deal.II/lac/vector.h>
22
23#include <string>
24#include <vector>
25
27
28
69{
70public:
85
86
110 template <typename number>
111 void
112 evaluate(const std::vector<Vector<number>> &values,
113 const std::vector<double> &y_values,
114 const unsigned int n_intervals,
115 const IntervalSpacing interval_spacing = linear);
116
121 template <typename number>
122 void
123 evaluate(const Vector<number> &values,
124 const unsigned int n_intervals,
125 const IntervalSpacing interval_spacing = linear);
126
132 void
133 write_gnuplot(std::ostream &out) const;
134
139 static std::string
141
147 static IntervalSpacing
148 parse_interval_spacing(const std::string &name);
149
154 std::size_t
155 memory_consumption() const;
156
161 "Your input argument to this function does not appear to "
162 "have any data in it.");
167 int,
168 int,
169 << "The two array sizes " << arg1 << " and " << arg2
170 << " must match, but don't.");
175 std::string,
176 << "The given name <" << arg1
177 << "> does not match any of the known formats.");
178
179private:
183 struct Interval
184 {
189 Interval(const double left_point, const double right_point);
190
195 std::size_t
196 memory_consumption() const;
197
202
207
211 unsigned int content;
212 };
213
224 template <typename number>
225 static bool
226 logarithmic_less(const number n1, const number n2);
227
232 std::vector<std::vector<Interval>> intervals;
233
238 std::vector<double> y_values;
239};
240
241
243
244#endif
void write_gnuplot(std::ostream &out) const
Definition histogram.cc:232
@ logarithmic
Definition histogram.h:83
static std::string get_interval_spacing_names()
Definition histogram.cc:286
std::vector< double > y_values
Definition histogram.h:238
static IntervalSpacing parse_interval_spacing(const std::string &name)
Definition histogram.cc:294
static bool logarithmic_less(const number n1, const number n2)
Definition histogram.cc:37
std::vector< std::vector< Interval > > intervals
Definition histogram.h:232
std::size_t memory_consumption() const
Definition histogram.cc:311
void evaluate(const std::vector< Vector< number > > &values, const std::vector< double > &y_values, const unsigned int n_intervals, const IntervalSpacing interval_spacing=linear)
Definition histogram.cc:63
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
static ::ExceptionBase & ExcInvalidName(std::string arg1)
#define DeclException2(Exception2, type1, type2, outsequence)
#define DeclExceptionMsg(Exception, defaulttext)
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & ExcIncompatibleArraySize(int arg1, int arg2)
static ::ExceptionBase & ExcEmptyData()
unsigned int content
Definition histogram.h:211
std::size_t memory_consumption() const
Definition histogram.cc:54