17template <
typename InType,
typename OutType,
template <
typename,
typename>
class CalcType>
21 using Calculator<std::vector<InType>, std::vector<OutType>>::Calculator;
25 virtual void update(
const InType & data)
override;
26 virtual void finalize(
bool is_distributed)
override;
27 virtual std::vector<OutType>
get()
const override {
return _values; }
30 std::vector<CalcType<InType, OutType>>
_calcs;
34template <
typename InType,
typename OutType,
template <
typename,
typename>
class CalcType>
42template <
typename InType,
typename OutType,
template <
typename,
typename>
class CalcType>
46 for (
const auto & i : index_range(data))
48 if (i >= _calcs.size())
50 _calcs.emplace_back(*
this, this->
name() +
"_" + std::to_string(i));
51 _calcs.back().initializeCalculator();
53 _calcs[i].updateCalculator(data[i]);
57template <
typename InType,
typename OutType,
template <
typename,
typename>
class CalcType>
64 auto ncalc = _calcs.size();
65 this->_communicator.max(ncalc);
66 for (
const auto & i : make_range(_calcs.size(), ncalc))
68 _calcs.emplace_back(*
this, this->
name() +
"_" + std::to_string(i));
69 _calcs.back().initializeCalculator();
73 _values.reserve(_calcs.size());
74 for (
auto & cc : _calcs)
76 cc.finalizeCalculator(is_distributed);
77 _values.push_back(cc.getValue());
81template <
typename InType,
typename OutType>
87 virtual std::vector<std::vector<OutType>>
compute(
const std::vector<InType> &,
94template <
typename InType,
typename OutType>
100 virtual std::vector<std::vector<OutType>>
compute(
const std::vector<InType> &,
101 const bool)
override;
104 std::vector<OutType>
acceleration(
const std::vector<InType> &,
const bool);
107template <
typename InType,
typename OutType>
110 static std::unique_ptr<Calculator<std::vector<InType>, std::vector<OutType>>>
114template <
typename InType,
typename OutType>
117 static std::unique_ptr<BootstrapCalculator<std::vector<InType>, std::vector<OutType>>>
120 const std::vector<Real> &,