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

Method normalize

gecode/int/linear/bool-int.hpp:57–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56 template<class VX>
57 forceinline void
58 LinBoolInt<VX>::normalize(void) {
59 if (n_as != n_hs) {
60 // Remove views for which no more subscriptions exist
61 int n_x = x.size();
62 for (int i=n_hs; i--; )
63 if (!x[i].none()) {
64 x[i]=x[--n_hs]; x[n_hs]=x[--n_x];
65 }
66 x.size(n_x);
67 }
68 assert(n_as == n_hs);
69 // Remove assigned yet unsubscribed views
70 {
71 int n_x = x.size();
72 for (int i=n_x-1; i>=n_hs; i--)
73 if (x[i].one()) {
74 c--; x[i]=x[--n_x];
75 } else if (x[i].zero()) {
76 x[i]=x[--n_x];
77 }
78 x.size(n_x);
79 }
80 }
81
82 template<class VX>
83 forceinline

Callers 1

bool-int.hppFile · 0.45

Calls 4

sizeMethod · 0.45
noneMethod · 0.45
oneMethod · 0.45
zeroMethod · 0.45

Tested by

no test coverage detected