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

Method post

gecode/int/bool/clause.hpp:105–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104 template<class VX, class VY>
105 inline ExecStatus
106 ClauseTrue<VX,VY>::post(Home home, ViewArray<VX>& x, ViewArray<VY>& y) {
107 for (int i=x.size(); i--; )
108 if (x[i].one())
109 return ES_OK;
110 else if (x[i].zero())
111 x.move_lst(i);
112 if (x.size() == 0)
113 return NaryOrTrue<VY>::post(home,y);
114 for (int i=y.size(); i--; )
115 if (y[i].one())
116 return ES_OK;
117 else if (y[i].zero())
118 y.move_lst(i);
119 if (y.size() == 0)
120 return NaryOrTrue<VX>::post(home,x);
121 if ((x.size() == 1) && (y.size() == 1)) {
122 return BinOrTrue<VX,VY>::post(home,x[0],y[0]);
123 } else if (!shared(x,y)) {
124 (void) new (home) ClauseTrue(home,x,y);
125 }
126 return ES_OK;
127 }
128
129 template<class VX, class VY>
130 forceinline size_t

Callers

nothing calls this directly

Calls 7

postFunction · 0.50
sharedFunction · 0.50
sizeMethod · 0.45
oneMethod · 0.45
zeroMethod · 0.45
move_lstMethod · 0.45
one_noneMethod · 0.45

Tested by

no test coverage detected