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

Method post

gecode/float/arithmetic/abs.hpp:46–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45 template<class A, class B>
46 ExecStatus
47 Abs<A,B>::post(Home home, A x0, B x1) {
48 GECODE_ME_CHECK(x1.eq(home,abs(x0.val())));
49 if (x0.min() >= 0)
50 GECODE_ME_CHECK(x0.eq(home,FloatVal(x1.min(), x1.max())));
51 else if (x0.max() <= 0)
52 GECODE_ME_CHECK(x0.eq(home,FloatVal(-x1.max(), -x1.min())));
53 else
54 GECODE_ME_CHECK(x0.eq(home,FloatVal(-x1.max(), x1.max())));
55 (void) new (home) Abs<A,B>(home,x0,x1);
56 return ES_OK;
57 }
58
59 template<class A, class B>
60 forceinline

Callers

nothing calls this directly

Calls 6

FloatValClass · 0.85
absFunction · 0.50
eqMethod · 0.45
valMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected