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

Method CartesianHeart

examples/cartesian-heart.cpp:71–79  ·  view source on GitHub ↗

Actual model

Source from the content-addressed store, hash-verified

69public:
70 /// Actual model
71 CartesianHeart(const Options& opt)
72 : Script(opt), f(*this,2,-20,20), step(opt.step()) {
73 int q = 2;
74 FloatNum p = 0.5;
75 // Post equation
76 rel(*this, sqr(f[0]) + 2*sqr(f[1]-p*nroot(abs(f[0]),q)) == 1);
77 branch(*this, f[0], FLOAT_VAL_SPLIT_MIN());
78 branch(*this, f[1], FLOAT_VAL_SPLIT_MIN());
79 }
80 /// Constructor for cloning \a p
81 CartesianHeart(CartesianHeart& p)
82 : Script(p), step(p.step) {

Callers

nothing calls this directly

Calls 8

FLOAT_VAL_SPLIT_MINFunction · 0.85
relFunction · 0.50
sqrFunction · 0.50
nrootFunction · 0.50
absFunction · 0.50
branchFunction · 0.50
stepMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected