TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
histograms.cpp
#include "./histograms.hpp"
#include "../utility/exceptions.hpp"
#include <h5/h5.hpp>
#include <nda/h5.hpp>
#include <algorithm>
#include <cmath>
#include <ostream>
#include <string>

Detailed Description

Implementation details for triqs/stat/histograms.hpp.

Definition in file histograms.cpp.

Go to the source code of this file.

Functions

void triqs::stat::h5_read (h5::group g, std::string const &name, histogram &h)
void triqs::stat::h5_write (h5::group g, std::string const &name, histogram const &h)
histogram triqs::stat::operator+ (histogram h1, histogram const &h2)
std::ostream & triqs::stat::operator<< (std::ostream &os, histogram const &h)

Function Documentation

◆ h5_read()

void triqs::stat::h5_read ( h5::group g,
std::string const & name,
histogram & h )
Parameters
gh5::group containing the dataset.
nameName of the dataset from which the histogram will be read.
hHistogram to be read into.

Definition at line 80 of file histograms.cpp.

◆ h5_write()

void triqs::stat::h5_write ( h5::group g,
std::string const & name,
histogram const & h )
Parameters
gh5::group in which the dataset is created.
nameName of the dataset to which the histogram will be written.
hHistogram to be written.

Definition at line 70 of file histograms.cpp.

◆ operator+()

histogram triqs::stat::operator+ ( histogram h1,
histogram const & h2 )

It simply adds the data vector, the number of accumulated data points and the number of discarded data points together.

It throws an exception if the domains or the number of bins of the two histograms are not equal.

Parameters
h1Left-hand side histogram operand.
h2Right-hand side histogram operand.
Returns
Sum of the two histograms.

Definition at line 61 of file histograms.cpp.

◆ operator<<()

std::ostream & triqs::stat::operator<< ( std::ostream & os,
histogram const & h )
Parameters
osstd::ostream to which the histogram will be written.
hHistogram to be written.
Returns
Reference to the same std::ostream.

Definition at line 91 of file histograms.cpp.