85 using weight_type = weight_t;
86 using value_type = value_t;
89 bool isNegligible(
const W &weight,
const weight_t &zero,
double tolerance = 1e-12)
const;
90 template<typename W = weight_t, typename V = value_t, std::size_t D = std::tuple_size<W>::value,
typename std::enable_if<std::is_same<std::array<V, D>, W>::value>::type * =
nullptr>
91 bool isNegligible(
const std::array<V, D> &weight,
const weight_t &zero,
double tolerance = 1e-12)
const;
92 template<
typename W = weight_t,
typename V = value_t,
typename std::enable_if<std::is_same<std::vector<V>, W>::value>::type * =
nullptr>
93 bool isNegligible(
const std::vector<V> &weight,
const weight_t &zero,
double tolerance = 1e-12)
const;
96 void sum(
const W &weight,
double factor, W *target)
const;
97 template<typename W = weight_t, typename V = value_t, std::size_t D = std::tuple_size<W>::value,
typename std::enable_if<std::is_same<std::array<V, D>, W>::value>::type * =
nullptr>
98 void sum(
const std::array<V, D> &weight,
double factor, std::array<V, D> *target)
const;
99 template<
typename W = weight_t,
typename V = value_t,
typename std::enable_if<std::is_same<std::vector<V>, W>::value>::type * =
nullptr>
100 void sum(
const std::vector<V> &weight,
double factor, std::vector<V> *target)
const;
103 void copy(
const W &weight, W *target)
const;
104 template<typename W = weight_t, typename V = value_t, std::size_t D = std::tuple_size<W>::value,
typename std::enable_if<std::is_same<std::array<V, D>, W>::value>::type * =
nullptr>
105 void copy(
const std::array<V, D> &weight, std::array<V, D> *target)
const;
106 template<
typename W = weight_t,
typename V = value_t,
typename std::enable_if<std::is_same<std::vector<V>, W>::value>::type * =
nullptr>
107 void copy(
const std::vector<V> &weight, std::vector<V> *target)
const;
110 void move(W &&weight, W *target)
const;
113 value_t &
at(
const W &weight, std::size_t index);
115 const value_t &
at(
const W &weight, std::size_t index)
const;
116 template<typename W = weight_t, typename V, std::size_t D = std::tuple_size<W>::value,
typename std::enable_if<std::is_same<std::array<V, D>, W>::value>::type * =
nullptr>
117 value_t &
at(
const std::array<V, D> &weight, std::size_t index);
118 template<typename W = weight_t, typename V, std::size_t D = std::tuple_size<W>::value,
typename std::enable_if<std::is_same<std::array<V, D>, W>::value>::type * =
nullptr>
119 const value_t &
at(
const std::array<V, D> &weight, std::size_t index)
const;
120 template<
typename W = weight_t,
typename V,
typename std::enable_if<std::is_same<std::vector<V>, W>::value>::type * =
nullptr>
121 value_t &
at(
const std::vector<V> &weight, std::size_t index);
122 template<
typename W = weight_t,
typename V,
typename std::enable_if<std::is_same<std::vector<V>, W>::value>::type * =
nullptr>
123 const value_t &
at(
const std::vector<V> &weight,
int index)
const;