Reference documentation for deal.II version 9.6.0
\(\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: 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// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_histogram_h
16#define dealii_histogram_h
17
18
19#include <deal.II/base/config.h>
20
22
23#include <deal.II/lac/vector.h>
24
25#include <string>
26#include <vector>
27
29
30
71{
72public:
87
88
112 template <typename number>
113 void
114 evaluate(const std::vector<Vector<number>> &values,
115 const std::vector<double> &y_values,
116 const unsigned int n_intervals,
117 const IntervalSpacing interval_spacing = linear);
118
123 template <typename number>
124 void
125 evaluate(const Vector<number> &values,
126 const unsigned int n_intervals,
127 const IntervalSpacing interval_spacing = linear);
128
134 void
135 write_gnuplot(std::ostream &out) const;
136
141 static std::string
143
149 static IntervalSpacing
150 parse_interval_spacing(const std::string &name);
151
156 std::size_t
157 memory_consumption() const;
158
163 "Your input argument to this function does not appear to "
164 "have any data in it.");
169 int,
170 int,
171 << "The two array sizes " << arg1 << " and " << arg2
172 << " must match, but don't.");
177 std::string,
178 << "The given name <" << arg1
179 << "> does not match any of the known formats.");
180
181private:
185 struct Interval
186 {
191 Interval(const double left_point, const double right_point);
192
197 std::size_t
198 memory_consumption() const;
199
204
209
213 unsigned int content;
214 };
215
226 template <typename number>
227 static bool
228 logarithmic_less(const number n1, const number n2);
229
234 std::vector<std::vector<Interval>> intervals;
235
240 std::vector<double> y_values;
241};
242
243
245
246#endif
void write_gnuplot(std::ostream &out) const
Definition histogram.cc:224
@ logarithmic
Definition histogram.h:85
static std::string get_interval_spacing_names()
Definition histogram.cc:278
std::vector< double > y_values
Definition histogram.h:240
static IntervalSpacing parse_interval_spacing(const std::string &name)
Definition histogram.cc:286
static bool logarithmic_less(const number n1, const number n2)
Definition histogram.cc:29
std::vector< std::vector< Interval > > intervals
Definition histogram.h:234
std::size_t memory_consumption() const
Definition histogram.cc:303
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:55
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
static ::ExceptionBase & ExcInvalidName(std::string arg1)
#define DeclException2(Exception2, type1, type2, outsequence)
Definition exceptions.h:539
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:494
#define DeclException1(Exception1, type1, outsequence)
Definition exceptions.h:516
static ::ExceptionBase & ExcIncompatibleArraySize(int arg1, int arg2)
static ::ExceptionBase & ExcEmptyData()
unsigned int content
Definition histogram.h:213
Interval(const double left_point, const double right_point)
Definition histogram.cc:37
std::size_t memory_consumption() const
Definition histogram.cc:46