Blame view

Debug/src/constraints/fake_all_different.c 603 Bytes
0c8ce2b0   Pedro Roque   missing files
1
2
3
4
/*
 * fake_all_different.c
 *
 *  Created on: 21/01/2017
4d26a735   Pedro Roque   Increased recogni...
5
 *      Author: Pedro
0c8ce2b0   Pedro Roque   missing files
6
7
8
 */

#include "fake_all_different.h"
4d26a735   Pedro Roque   Increased recogni...
9
10

#include "int_ne.h"
0c8ce2b0   Pedro Roque   missing files
11
12
13
14
15
16
17

/*
 * Simulates the all-different constraint by using ne binary constraints
 * X_ids - array with the IDs of the variables that are constrained by this constraint
 * n_vs - number of ID variables in vs_id
 * reif_v_id - ID of the reification variable or -1 if none
 */
4d26a735   Pedro Roque   Increased recogni...
18
void c_fake_all_different(unsigned int *X_ids, unsigned int n_vs) {
0c8ce2b0   Pedro Roque   missing files
19
20
21
22
	unsigned int i, j;

	for (i = 0; i < n_vs; i++) {
		for (j = i + 1; j < n_vs; j++) {
4d26a735   Pedro Roque   Increased recogni...
23
			c_int_ne(X_ids[i], X_ids[j]);
0c8ce2b0   Pedro Roque   missing files
24
25
26
		}
	}
}