Blame view

src/variables.h 2.26 KB
94b2b13d   Pedro Roque   PHACT source
1
2
3
4
/*
 * variables.h
 *
 *  Created on: 21/08/2014
4d26a735   Pedro Roque   Increased recogni...
5
 *      Author: pedro
94b2b13d   Pedro Roque   PHACT source
6
7
8
9
10
11
12
 */

#ifndef SRC_VARIABLES_H_
#define SRC_VARIABLES_H_

#include "constraints.h"

4d26a735   Pedro Roque   Increased recogni...
13
14
15
16
17
extern var* VS;		// Vector with all the CSP variables
extern var* VS_LOCK;		// Vector with temporary CSP variables when optimizing
extern var* VS_LOCK_BEST;	// Vector with the current best solution when optimizing
extern var* VS_AUX;		// Vector with all the CSP variables for increasing size and sorting
extern var* VS_AUX2;		// Vector with all the CSP variables for sorting
94b2b13d   Pedro Roque   PHACT source
18
19

unsigned int v_new_val(unsigned int val);
4d26a735   Pedro Roque   Increased recogni...
20
unsigned int v_new_vals(unsigned int* vals, unsigned int n_vals, bool to_label);
94b2b13d   Pedro Roque   PHACT source
21
unsigned int v_new_range(unsigned int min, unsigned int max, bool to_label);
4d26a735   Pedro Roque   Increased recogni...
22
23
bool v_contains_val(var* v, unsigned int val);
void vs_copy(var* v_dest, var* v_src, unsigned int n_vs);
94b2b13d   Pedro Roque   PHACT source
24
25
26
void vs_clear();
bool v_intersect_v(var *v1, var *v2);
bool v_union_v(var *v1, var *v2);
4d26a735   Pedro Roque   Increased recogni...
27
bool v_del_val(var* v, int val);
94b2b13d   Pedro Roque   PHACT source
28
29
30
31
32
33
34
bool v_del_singl_val(var *v_to_chg, var *singl_v);
bool v_del_lt(var *v, int val);
bool v_del_le(var *v, int val);
bool v_del_gt(var *v, int val);
bool v_del_ge(var *v, int val);
bool v_del_all_except_val(var *v, int val);

4d26a735   Pedro Roque   Increased recogni...
35
36
void vs_copy_host_to_dev(void** dev_bs, var* host_vs, unsigned int n_bs);
void vs_copy_dev_to_host(var* host_vs, void** dev_bs, unsigned int n_bs);
94b2b13d   Pedro Roque   PHACT source
37

4d26a735   Pedro Roque   Increased recogni...
38
39
40
41
42
int vs_cnt_vs_to_label(var* vs, unsigned int n_vs);
void v_add_constr(var* v, constr* cs);
void v_rem_constr(var* v, constr* cs);;
unsigned int vs_cnt_cs(var* vs, unsigned int n_vs);
void vs_sort_label_first();
94b2b13d   Pedro Roque   PHACT source
43
44
45
void vs_sort_label_more_vals_first();
void vs_sort_label_less_vals_first();
void vs_sort_constr(var* vs, unsigned int n_vs);
4d26a735   Pedro Roque   Increased recogni...
46

94b2b13d   Pedro Roque   PHACT source
47
48
49
50
51
int v_get_value(unsigned int v_id);
int v_get_min(unsigned int v_id);
int v_get_max(unsigned int v_id);
void v_print_single_val(unsigned int v_id, unsigned int offset);
void vs_print_single_val(unsigned int* vs_id, unsigned int n_vs_id, unsigned int offset);
4d26a735   Pedro Roque   Increased recogni...
52
53
54
55
void vs_print_vals(unsigned int* vs_id, unsigned int n_vs_id, unsigned int offset);
void vs_print_min(unsigned int* vs_id, unsigned int n_vs_id, unsigned int offset);
void vs_print_max(unsigned int* vs_id, unsigned int n_vs_id, unsigned int offset);
void v_print_cost(unsigned int offset);
94b2b13d   Pedro Roque   PHACT source
56
void vs_print_domain(unsigned int* vs_id, unsigned int n_vs_id);
4d26a735   Pedro Roque   Increased recogni...
57

94b2b13d   Pedro Roque   PHACT source
58
#endif /* SRC_VARIABLES_H_ */