Reference documentation for deal.II version Git 409ee4b167 2020-08-14 09:46:12 -0400
\(\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\}}\)
histogram.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2018 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_histogram_h
17 #define dealii_histogram_h
18 
19 
20 #include <deal.II/base/config.h>
21 
23 
24 #include <deal.II/lac/vector.h>
25 
26 #include <string>
27 #include <vector>
28 
30 
31 
71 class Histogram
72 {
73 public:
78  {
87  };
88 
89 
113  template <typename number>
114  void
115  evaluate(const std::vector<Vector<number>> &values,
116  const std::vector<double> & y_values,
117  const unsigned int n_intervals,
118  const IntervalSpacing interval_spacing = linear);
119 
124  template <typename number>
125  void
127  const unsigned int n_intervals,
128  const IntervalSpacing interval_spacing = linear);
129 
135  void
136  write_gnuplot(std::ostream &out) const;
137 
142  static std::string
144 
150  static IntervalSpacing
151  parse_interval_spacing(const std::string &name);
152 
157  std::size_t
158  memory_consumption() const;
159 
164  "Your input argument to this function does not appear to "
165  "have any data in it.");
170  int,
171  int,
172  << "The two array sizes " << arg1 << " and " << arg2
173  << " must match, but don't.");
178  std::string,
179  << "The given name <" << arg1
180  << "> does not match any of the known formats.");
181 
182 private:
186  struct Interval
187  {
192  Interval(const double left_point, const double right_point);
193 
198  std::size_t
199  memory_consumption() const;
200 
204  double left_point;
205 
209  double right_point;
210 
214  unsigned int content;
215  };
216 
227  template <typename number>
228  static bool
229  logarithmic_less(const number n1, const number n2);
230 
235  std::vector<std::vector<Interval>> intervals;
236 
241  std::vector<double> y_values;
242 };
243 
244 
246 
247 #endif
std::vector< std::vector< Interval > > intervals
Definition: histogram.h:235
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:538
static ::ExceptionBase & ExcInvalidName(std::string arg1)
Interval(const double left_point, const double right_point)
Definition: histogram.cc:38
static ::ExceptionBase & ExcIncompatibleArraySize(int arg1, int arg2)
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:56
std::size_t memory_consumption() const
Definition: histogram.cc:304
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:515
void write_gnuplot(std::ostream &out) const
Definition: histogram.cc:225
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:493
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:363
static bool logarithmic_less(const number n1, const number n2)
Definition: histogram.cc:30
std::size_t memory_consumption() const
Definition: histogram.cc:47
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:362
std::vector< double > y_values
Definition: histogram.h:241
IntervalSpacing
Definition: histogram.h:77
static IntervalSpacing parse_interval_spacing(const std::string &name)
Definition: histogram.cc:287
static ::ExceptionBase & ExcEmptyData()
static std::string get_interval_spacing_names()
Definition: histogram.cc:279
unsigned int content
Definition: histogram.h:214