20#ifndef OBSERVABLES_OBSERVABLE_HPP
21#define OBSERVABLES_OBSERVABLE_HPP
28#include <boost/mpi/communicator.hpp>
47 virtual std::vector<double>
48 operator()(boost::mpi::communicator
const &comm)
const = 0;
52 auto const v =
shape();
53 return std::accumulate(v.begin(), v.end(), std::size_t{1u},
58 virtual std::vector<std::size_t>
shape()
const = 0;
virtual std::vector< double > operator()(boost::mpi::communicator const &comm) const =0
Calculate the set of values measured by the observable.
virtual std::vector< std::size_t > shape() const =0
Dimensions needed to reshape the flat array returned by the observable.
virtual ~Observable()=default
std::size_t n_values() const
Size of the flat array returned by the observable.