TRIQS/triqs_ctseg 4.0.0
A TRIQS application
Loading...
Searching...
No Matches
pert_order.hpp
1// Copyright (c) 2022--present, The Simons Foundation
2// Copyright (c) 2022--present, Max Planck Institute for Polymer Research, Mainz, Germany
3// This file is part of TRIQS/ctseg and is licensed under the terms of GPLv3 or later.
4// SPDX-License-Identifier: GPL-3.0-or-later
5// See LICENSE in the root of this distribution for details.
6
7#pragma once
8#include "../configuration.hpp"
9#include "../results.hpp"
10#include "../work_data.hpp"
11
12namespace triqs_ctseg::measures {
13
14 struct pert_order {
15
16 pert_order(std::function<int()> get_order, std::optional<std::vector<double>> &hist_opt,
17 std::optional<double> &average_order_opt);
18
20 void accumulate(double s);
21
23 void collect_results(mpi::communicator const &c);
24
25 private:
26 // Function to get the pert order
27 std::function<int()> get_order;
28
29 // Histogram
30 std::vector<double> &hist;
31
32 // Average order
33 double &average_order;
34
35 // Accumulation counter
36 long N = 0;
37 };
38
39} // namespace triqs_ctseg::measures