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

Method solution

test/float/transcendental.cpp:304–308  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

302 : Test("Transcendental::Pow::N::"+str(_base)+"::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false), base(_base) {}
303 /// %Test whether \a x is solution
304 virtual MaybeType solution(const Assignment& x) const {
305 if ((x[0].max() <= 0.0) || (base <= 0.0))
306 return MT_FALSE;
307 return eq(exp(x[0] * log(base)), x[0]);
308 }
309 /// Post constraint on \a x
310 virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
311 Gecode::pow(home, base, x[0], x[0]);

Callers

nothing calls this directly

Calls 3

expFunction · 0.50
logFunction · 0.50
maxMethod · 0.45

Tested by

no test coverage detected