Vertical Scaling/Sr: Remove A Few Asserts

These were meant for consistency checking, but would occasionally
fail due to round-off error when doing arithmetic on values
converted from 'float' to 'double'.  The actual scaling procedure
does not rely on those relations as long as we ensure that 'fmax' is
the maximum function value, so add a measure of robustness here.

Note that this is at best a work-around for a deeper problem and
that a more refined solution would probably be needed here.
This commit is contained in:
Bård Skaflestad
2018-11-13 00:41:50 +01:00
parent 8603935aad
commit be160a5c63

View File

@@ -504,14 +504,12 @@ vertScale(const FunctionValues& f,
const SaturationPoints& sp,
std::vector<double> val) const
{
assert ((sp.size() == val.size()) && "Internal Error in Vertical Scaling");
assert (! (f.max.val < f.disp.val) && "Internal Error in Table Extraction");
assert (! (f.max.sat < f.disp.sat) && "Internal Error in Table Extraction");
assert ((sp.size() == val.size()) && "Internal Error in Vertical Scaling");
auto ret = std::move(val);
const auto fdisp = f.disp.val;
const auto fmax = f.max .val;
const auto fmax = std::max(f.disp.val, f.max.val);
const auto sepfv = fmax > fdisp;
for (auto n = sp.size(), i = 0*n; i < n; ++i) {