17 template <
typename InType,
typename OutType,
template <
typename,
typename>
class CalcType>
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;
34 template <
typename InType,
typename OutType,
template <
typename,
typename>
class CalcType>
42 template <
typename InType,
typename OutType,
template <
typename,
typename>
class CalcType>
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]);
57 template <
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());
81 template <
typename InType,
typename OutType>
87 virtual std::vector<std::vector<OutType>>
compute(
const std::vector<InType> &,
94 template <
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);
107 template <
typename InType,
typename OutType>
110 static std::unique_ptr<Calculator<std::vector<InType>, std::vector<OutType>>>
114 template <
typename InType,
typename OutType>
117 static std::unique_ptr<BootstrapCalculator<std::vector<InType>, std::vector<OutType>>>
120 const std::vector<Real> &,
IntRange< T > make_range(T beg, T end)
auto index_range(const T &sizable)