Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CSP* creer_CSP(int nbVar, int nbVal){
- printf("Création d'un CSP vide \n");
- CSP *csp = malloc(sizeof(CSP));
- csp->nbVal = nbVal;
- csp->nbVar = nbVar;
- csp->DaPi = 0;
- csp->domaines = malloc(nbVar*sizeof(int));
- for(int i=0 ;i<nbVar; i++){
- csp->domaines[i] = malloc(nbVal*sizeof(int));
- }
- csp->contraintes = malloc(nbVar*sizeof(Matrice));
- for(int i=0 ;i<nbVar; i++){
- csp->contraintes[i] = malloc(nbVar*sizeof(Matrice));
- }
- for(int i=0 ;i<nbVar; i++){
- for(int j=0;i<nbVar;j++{
- csp->contraintes[i][j] = creer_matrice(nbVal);
- }
- }
- printf("Fin de la création du CSP \n");
- return csp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement