Discontinuous Galerkin Library
#include "dg/algorithm.h"
dg::Histogram< container > Struct Template Reference

Compute a histogram on a 1D grid. More...

Public Member Functions

 Histogram (const dg::Grid1d &g1d, const std::vector< double > &in)
 Construct a histogram from number of bins and an input vector. More...
 
double binwidth ()
 get binwidth More...
 
double operator() (double x) const
 Access computed histogram. More...
 

Detailed Description

template<class container = thrust::host_vector<double>>
struct dg::Histogram< container >

Compute a histogram on a 1D grid.

Template Parameters
container

Constructor & Destructor Documentation

◆ Histogram()

template<class container = thrust::host_vector<double>>
dg::Histogram< container >::Histogram ( const dg::Grid1d g1d,
const std::vector< double > &  in 
)
inline

Construct a histogram from number of bins and an input vector.

Parameters
g1dgrid on which to compute the histogram ( grid.h() is the binwidth)
ininput vector (if grid.x0() < in[i] <grid.x1() it falls in a bin)

Member Function Documentation

◆ binwidth()

template<class container = thrust::host_vector<double>>
double dg::Histogram< container >::binwidth ( )
inline

get binwidth

Returns

◆ operator()()

template<class container = thrust::host_vector<double>>
double dg::Histogram< container >::operator() ( double  x) const
inline

Access computed histogram.

Parameters
x
Returns

The documentation for this struct was generated from the following file: