1#include "storm-config.h"
6TEST(SolutionBoundsTest, PrecisionNeedsBothSides) {
8 bounds.
lower = std::vector<double>{0.5};
13TEST(SolutionBoundsTest, PrecisionRejectsMismatchingSizes) {
15 bounds.
setExact(std::vector<double>{0.5});
19TEST(SolutionBoundsTest, AbsolutePrecisionComparesTheDistanceToTheValue) {
21 bounds.
lower = std::vector<double>{0.0, 1.0};
22 bounds.
upper = std::vector<double>{0.1, 1.05};
30TEST(SolutionBoundsTest, RelativePrecisionScalesWithTheValue) {
32 bounds.
lower = std::vector<double>{10.0};
33 bounds.
upper = std::vector<double>{10.1};
37 bounds.
lower = std::vector<double>{0.001};
38 bounds.
upper = std::vector<double>{0.101};
42TEST(SolutionBoundsTest, RelativePrecisionRejectsBoundsAroundZero) {
44 bounds.
lower = std::vector<double>{-0.001};
45 bounds.
upper = std::vector<double>{0.001};
49 bounds.
setExact(std::vector<double>{0.0});
TEST(SolutionBoundsTest, PrecisionNeedsBothSides)
#define STORM_SILENT_EXPECT_THROW(statement, expected_exception)
Sound lower and upper bounds on a solution vector.
std::optional< std::vector< ValueType > > lower
std::optional< std::vector< ValueType > > upper
bool isWithinPrecision(std::vector< ValueType > const &values, ValueType const &precision, bool relative) const
Returns true if both bounds are set and neither is further from its value than the given precision al...
void setExact(std::vector< ValueType > const &values)
Sets both bounds to the given values, i.e.