Record (and forget) the values of any assigned views in \a x in the right position in \a last_val.
| 83 | public: |
| 84 | /// Record (and forget) the values of any assigned views in \a x in the right position in \a last_val. |
| 85 | static void record_assigned(FlatZincSpace& home, IdxViewArray<View>& x) { |
| 86 | int n = x.size(); |
| 87 | for (int i = n; i--; ) { |
| 88 | if (x[i].view.assigned()) { |
| 89 | SetLastVal::set_last_val(home, x[i].idx, x[i].view); |
| 90 | x[i] = x[--n]; |
| 91 | } |
| 92 | } |
| 93 | x.size(n); |
| 94 | } |
| 95 | |
| 96 | /// Copy propagator during cloning |
| 97 | virtual Actor* copy(Space& home){ return new (home) LastVal(home,*this); } |