16 template <
typename Quantity>
18 static_assert(is_quantity_v<Quantity>,
"usable only with Quantity types");
20 typedef typename Quantity::value_type real_type;
21 typedef std::uniform_real_distribution<real_type> distribution_type;
24 typedef Quantity value_type;
29 : min_{value_type::zero()}
34 , diff_{pmax - pmin} {}
38 , diff_{other.diff_} {}
42 if (
this == &other)
return *
this;
53 value_type
getMax()
const {
return min_ + diff_; }
60 void setMax(value_type
const pmax) { diff_ = pmax - min_; }
67 value_type
getMin()
const {
return min_; }
74 void setMin(value_type
const pmin) { min_ = pmin; }
83 template <
class TGenerator>
85 return min_ + dist_(g) * diff_;
89 distribution_type dist_{real_type(0.), real_type(1.)};
Import and extend the phys::units package.
`, since they are used everywhere as integral part of the framework.