Add a multiplier to the matrix (#5298)

* add a multiplier to the matrix

* add rounding

* remove scale_factor restrictions

* clamp for overflow error

* update check to match error message

* enforce clamping on < 0 and increase test coverage

* add an invalid scale_factor value to node tests

* increase test coverage

* changelog
This commit is contained in:
Kajari Ghosh
2018-12-10 13:41:44 -05:00
committed by GitHub
parent c4238c4ed6
commit 2e17f3010a
11 changed files with 197 additions and 14 deletions
+9 -1
View File
@@ -79,6 +79,8 @@ struct TableParameters : public BaseParameters
AnnotationsType annotations = AnnotationsType::Duration;
double scale_factor = 1;
TableParameters() = default;
template <typename... Args>
TableParameters(std::vector<std::size_t> sources_,
@@ -105,10 +107,13 @@ struct TableParameters : public BaseParameters
const AnnotationsType annotations_,
double fallback_speed_,
FallbackCoordinateType fallback_coordinate_type_,
double scale_factor_,
Args... args_)
: BaseParameters{std::forward<Args>(args_)...}, sources{std::move(sources_)},
destinations{std::move(destinations_)}, fallback_speed{fallback_speed_},
fallback_coordinate_type{fallback_coordinate_type_}, annotations{annotations_}
fallback_coordinate_type{fallback_coordinate_type_}, annotations{annotations_},
scale_factor{scale_factor_}
{
}
@@ -135,6 +140,9 @@ struct TableParameters : public BaseParameters
if (fallback_speed < 0)
return false;
if (scale_factor <= 0)
return false;
return true;
}
};