MCPcopy Create free account
hub / github.com/Gecode/gecode / estimate

Function estimate

gecode/float/linear/post.cpp:44–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42namespace Gecode { namespace Float { namespace Linear {
43
44 void
45 estimate(Term* t, int n, FloatVal c, FloatNum& l, FloatNum &u) {
46 FloatVal est = c;
47 for (int i=n; i--; )
48 est += t[i].a * t[i].x.domain();
49 FloatNum min = est.min();
50 FloatNum max = est.max();
51 if (min < Limits::min)
52 min = Limits::min;
53 if (min > Limits::max)
54 min = Limits::max;
55 l = min;
56 if (max < Limits::min)
57 max = Limits::min;
58 if (max > Limits::max)
59 max = Limits::max;
60 u = max;
61 }
62
63 forceinline bool
64 overflow(Term* t, int n, FloatVal c) {

Callers 2

extendFunction · 0.70
linearFunction · 0.50

Calls 3

domainMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected