20 #ifndef FST_POWER_WEIGHT_MAPPERS_H_ 21 #define FST_POWER_WEIGHT_MAPPERS_H_ 27 template <
class FromWeight_,
class ToPowerWeight>
32 using Index =
typename ToPowerWeight::Index;
37 return ToPowerWeight(index_, w.Value());
46 template <
class FromPowerWeight,
class ToWeight_>
51 using Index =
typename FromPowerWeight::Index;
66 template <
class PowerWeightT>
71 using Index =
typename PowerWeightT::Index;
77 : from_index_(from_index),
79 default_weight_(default_weight) {}
82 return PowerWeightT(to_index_, w.Value(from_index_), default_weight_);
86 const Index from_index_;
87 const Index to_index_;
93 template <
class PowerWeightT,
class TransformFn_>
102 : transform_(transform) {}
104 PowerWeightT
operator()(
const PowerWeightT &w)
const {
return transform_(w); }
112 #endif // FST_POWER_WEIGHT_MAPPERS_H_
FromPowerWeightMapper(Index index=0)
ProjectPowerWeightMapper(Index from_index=0, Index to_index=0, const ComponentWeight &default_weight=ComponentWeight::Zero())
typename FromPowerWeight::Index Index
ToPowerWeight operator()(const FromWeight &w) const
PowerWeightT operator()(const PowerWeightT &w) const
typename PowerWeightT::Weight ComponentWeight
FromPowerWeight FromWeight
typename ToPowerWeight::Index Index
typename PowerWeightT::Index Index
ToPowerWeightMapper(Index index=0)
ToWeight operator()(const FromPowerWeight &w) const