.. Generated automatically by cpp2rst .. highlight:: c .. role:: red .. role:: green .. role:: param .. _triqs__stat__accumulator__n_lin_bins: triqs::stat::accumulator::n_lin_bins ==================================== *#include * **Synopsis** .. rst-class:: cppsynopsis | int :red:`n_lin_bins` () const Returns the number of bins currently in the linear part of the accumulator. When the accumulator is active (n_lin_bins_max != 0), there is always at least one zeroed bin even if no data has been passed to the accumulator. Returns ^^^^^^^ Number of bins Example ^^^^^^^ .. Included automatically from /src/triqs/doc/documentation/examples/triqs/stat/acc_nlinbin.cpp .. code-block:: cpp #include #include using namespace triqs::stat; int main() { // Accumulating a simple scalar // Defines linear bins of capacity 2, up to a maximum of 100 bins accumulator my_acc(0.0, 0, 100, 2); // Always at least one bin for an active accumulatotr std::cout << "A. Number of Bins: " << my_acc.n_lin_bins() << std::endl; // Add data: fill first bin to full capacity my_acc << 0.0; my_acc << 1.0; std::cout << "B. Number of Bins: " << my_acc.n_lin_bins() << std::endl; // Fill up 2nd bin to full capacity and 3rd bin halfway my_acc << 2.0; my_acc << 3.0; my_acc << 4.0; std::cout << "C. Number of Bins: " << my_acc.n_lin_bins() << std::endl; // ****************** // accumulator with linear binning turned off accumulator my_acc_no_lin(0.0, 1, 0, 1); std::cout << "D. Number of Bins: " << my_acc_no_lin.n_lin_bins() << std::endl; } *Output* .. code-block:: text A. Number of Bins: 1 B. Number of Bins: 1 C. Number of Bins: 3 D. Number of Bins: 0