mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 12:24:26 +02:00
Fix {normal, extreme_value} distributions to work with quantities
This commit is contained in:
@@ -289,7 +289,7 @@ struct extreme_value_distribution : public std::extreme_value_distribution<typen
|
||||
template<typename Generator>
|
||||
Q operator()(Generator& g)
|
||||
{
|
||||
return Q(base::operator()(g));
|
||||
return base::operator()(g) * Q::reference;
|
||||
}
|
||||
|
||||
[[nodiscard]] Q a() const { return base::a() * Q::reference; }
|
||||
@@ -313,7 +313,7 @@ struct normal_distribution : public std::normal_distribution<typename Q::rep> {
|
||||
template<typename Generator>
|
||||
Q operator()(Generator& g)
|
||||
{
|
||||
return Q(base::operator()(g));
|
||||
return base::operator()(g) * Q::reference;
|
||||
}
|
||||
|
||||
[[nodiscard]] Q mean() const { return base::mean() * Q::reference; }
|
||||
|
Reference in New Issue
Block a user