all_different.h 1.48 KB
/*
 * all_different.h
 *
 *  Created on: 27/08/2014
 *      Author: Pedro
 */

#ifndef SRC_CONSTRAINTS_ALL_DIFFERENT_H_
#define SRC_CONSTRAINTS_ALL_DIFFERENT_H_

#include <stdbool.h>
#include <sys/types.h>

#include "../config.h"
#include "../constraints.h"
#include "../kernels/cl_aux_functions.h"
#include "../kernels/cl_constraints.h"
#include "../kernels/cl_ttl.h"

unsigned int c_all_different(unsigned int *X_ids, unsigned int n_vs);
unsigned int c_all_different_reif(unsigned int *X_ids, unsigned int n_vs, int reif_v_id);
bool all_different_check(constr *c, bool explored);

#if CS_ALL_DIFFERENT
void all_different_prop( CL_INTS_MEM int *vs_per_c_idx, CL_MEMORY VARS_PROP *vs_prop_, unsigned int prop_v_id,
		CL_CS_MEM cl_constr *current_cs, CL_MEMORY unsigned short *vs_id_to_prop_, bool *prop_ok TTL_CTR);
#if CS_R_ALL_DIFFERENT == 1
void all_different_reif( CL_INTS_MEM int *vs_per_c_idx, CL_MEMORY VARS_PROP *vs_prop_, unsigned int prop_v_id, CL_CS_MEM cl_constr *current_cs,
		CL_MEMORY unsigned short *vs_id_to_prop_ TTL_CTR);
void all_different_prop_opposite(CL_INTS_MEM int *vs_per_c_idx, CL_MEMORY VARS_PROP *vs_prop_, unsigned int prop_v_id, CL_CS_MEM cl_constr *current_cs,
		bool *prop_ok TTL_CTR);
#endif
void all_different_propagate( CL_INTS_MEM int *vs_per_c_idx, CL_MEMORY VARS_PROP *vs_prop_, unsigned int prop_v_id, CL_CS_MEM cl_constr *current_cs,
		CL_MEMORY unsigned short *vs_id_to_prop_, bool *prop_ok PROPAGATED_FUNC TTL_CTR);
#endif

#endif /* SRC_CONSTRAINTS_ALL_DIFFERENT_H_ */