source: soft/giet_vm/applications/rosenfeld/src/ecc_examples.c @ 777

Last change on this file since 777 was 772, checked in by meunier, 8 years ago
  • Ajout de l'application rosenfeld
  • Changement du nom du flag O_CREATE en O_CREAT
File size: 53.1 KB
Line 
1/* ---------------------- */
2/* --- ecc_examples.c --- */
3/* ---------------------- */
4
5// fonction de test de Lionel Lacassagne
6// version 2014-2015
7
8#include <stdio.h>
9#include <stdlib.h>
10#include <math.h>
11
12#ifdef CLI
13#include "nrc_os_config.h"
14#include "nrc.h"
15#endif
16
17#include "palette.h"
18#include "bmpNR.h"
19#include "histogramNR.h"
20
21#include "ecc_common.h"
22#include "ecc_features.h"
23#include "ecc_generation.h"
24
25// --------------------------------------------------------------
26void init_forme1(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
27// --------------------------------------------------------------
28{
29    uint8 **X;
30    int i = 0;
31    int h = 8;
32    int w = 8;
33   
34    X = ui8matrix(    0, h-1, 0, w-1);
35    zero_ui8matrix(X, 0, h-1, 0, w-1);
36   
37    *X0 = X;
38    *i0 = 0; *i1 = h-1;
39    *j0 = 0; *j1 = w-1;
40   
41    //                                 012345678
42    set_ui8vector_str(X[i++], 0, w-1, "111.11.1"); // 0
43    set_ui8vector_str(X[i++], 0, w-1, "11.11.11"); // 1
44    set_ui8vector_str(X[i++], 0, w-1, "1.11.111"); // 2
45    set_ui8vector_str(X[i++], 0, w-1, "111.1111"); // 3
46    set_ui8vector_str(X[i++], 0, w-1, "...11111"); // 4
47    set_ui8vector_str(X[i++], 0, w-1, "11111111"); // 5
48    set_ui8vector_str(X[i++], 0, w-1, "11111111"); // 6
49    set_ui8vector_str(X[i++], 0, w-1, "11111111"); // 7
50   
51    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme1");
52    printf("");
53    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme1.txt");
54}
55// --------------------------------------------------------------
56void init_forme2(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
57// --------------------------------------------------------------
58{
59    uint8 **X;
60    int i =  0;
61    int h = 10;
62    int w = 17;
63   
64    X = ui8matrix(    0, h-1, 0, w-1);
65    zero_ui8matrix(X, 0, h-1, 0, w-1);
66   
67    *X0 = X;
68    *i0 = 0; *i1 = h-1;
69    *j0 = 0; *j1 = w-1;
70   
71    //                                 000000000011111111
72    //                                 012345678901234567
73    set_ui8vector_str(X[i++], 0, w-1, "................1"); // 0
74    set_ui8vector_str(X[i++], 0, w-1, "....1.......1...1"); // 1
75    set_ui8vector_str(X[i++], 0, w-1, "1...1.....1.1.1.1"); // 2
76    set_ui8vector_str(X[i++], 0, w-1, "1.1.1.1...1.11111"); // 3
77    set_ui8vector_str(X[i++], 0, w-1, "11111.1.1.1...1.."); // 4
78    set_ui8vector_str(X[i++], 0, w-1, "..1...11111...1.."); // 5
79    set_ui8vector_str(X[i++], 0, w-1, "..1.....1.....1.."); // 6
80    set_ui8vector_str(X[i++], 0, w-1, "..1111111111111.."); // 7
81    set_ui8vector_str(X[i++], 0, w-1, "........1........"); // 8
82    set_ui8vector_str(X[i++], 0, w-1, "........1........"); // 9
83   
84    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme2"); printf("");
85    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme2.txt");
86}
87// --------------------------------------------------------------
88void init_forme3(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
89// --------------------------------------------------------------
90{
91    uint8 **X;
92    int i =  0;
93    int h = 10;
94    int w = 17;
95   
96    X = ui8matrix(    0, h-1, 0, w-1);
97    zero_ui8matrix(X, 0, h-1, 0, w-1);
98   
99    *X0 = X;
100    *i0 = 0; *i1 = h-1;
101    *j0 = 0; *j1 = w-1;
102   
103    //                                 00000000001111111
104    //                                 01234567890123456
105    set_ui8vector_str(X[i++], 0, w-1, "................."); // 0
106    set_ui8vector_str(X[i++], 0, w-1, "....1.......1...1"); // 1
107    set_ui8vector_str(X[i++], 0, w-1, "1...1.....1.1.1.1"); // 2
108    set_ui8vector_str(X[i++], 0, w-1, "1.1.1.1...1.11111"); // 3
109    set_ui8vector_str(X[i++], 0, w-1, "11111.1.1.1...1.."); // 4
110    set_ui8vector_str(X[i++], 0, w-1, "..1...11111...1.."); // 5
111    set_ui8vector_str(X[i++], 0, w-1, "..1.....1.....1.."); // 6
112    set_ui8vector_str(X[i++], 0, w-1, "..1111111111111.."); // 7
113    set_ui8vector_str(X[i++], 0, w-1, "........1........"); // 8
114    set_ui8vector_str(X[i++], 0, w-1, "........1........"); // 9   
115   
116    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme3"); printf("");
117    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme3.txt");
118}
119// --------------------------------------------------------------
120void init_forme4(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
121// --------------------------------------------------------------
122{
123    uint8 **X;
124    int i =  0;
125    int h =  8;
126    int w = 10;
127   
128    X = ui8matrix(    0, h-1, 0, w-1);
129    zero_ui8matrix(X, 0, h-1, 0, w-1);
130   
131    *X0 = X;
132    *i0 = 0; *i1 = h-1;
133    *j0 = 0; *j1 = w-1;
134   
135    //                                  00000000001
136    //                                  01234567890
137    set_ui8vector_str(X[i++], 0, w-1, "1.1.1 1.1.1"); // 0
138    set_ui8vector_str(X[i++], 0, w-1, "111.111.111"); // 1
139    set_ui8vector_str(X[i++], 0, w-1, "..........."); // 2
140    set_ui8vector_str(X[i++], 0, w-1, "1.1.1 1.1.1"); // 3
141    set_ui8vector_str(X[i++], 0, w-1, "111.111.111"); // 4
142    set_ui8vector_str(X[i++], 0, w-1, "..........."); // 5
143    set_ui8vector_str(X[i++], 0, w-1, "1.1.1 1.1.1"); // 6
144    set_ui8vector_str(X[i++], 0, w-1, "111.111.111"); // 7
145   
146    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme4"); printf("");
147    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme4.txt");
148}
149// -----------------------------------------------------------------------
150void init_forme_backdoor1(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
151// -----------------------------------------------------------------------
152{
153    uint8 **X;
154    int i =  0;
155    int h =  5;
156    int w =  7;
157   
158    X = ui8matrix(    0, h-1, 0, w-1);
159    zero_ui8matrix(X, 0, h-1, 0, w-1);
160   
161    *X0 = X;
162    *i0 = 0; *i1 = h-1;
163    *j0 = 0; *j1 = w-1;
164   
165    //                                 00000000
166    //                                 01234567
167    set_ui8vector_str(X[i++], 0, w-1, "1.....1"); // 0
168    set_ui8vector_str(X[i++], 0, w-1, "1..1.11"); // 1
169    set_ui8vector_str(X[i++], 0, w-1, "1.1111."); // 2
170    set_ui8vector_str(X[i++], 0, w-1, "111...."); // 3
171    set_ui8vector_str(X[i++], 0, w-1, "......."); // 4
172   
173    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor1"); printf("");
174    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor1.txt");
175}
176// -----------------------------------------------------------------------
177void init_forme_backdoor2(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
178// -----------------------------------------------------------------------
179{
180    uint8 **X;
181    int i =  0;
182    int h =  5;
183    int w = 10;
184   
185    X = ui8matrix(    0, h-1, 0, w-1);
186    zero_ui8matrix(X, 0, h-1, 0, w-1);
187   
188    *X0 = X;
189    *i0 = 0; *i1 = h-1;
190    *j0 = 0; *j1 = w-1;
191
192    //                                 00000000001
193    //                                 01234567890
194    set_ui8vector_str(X[i++], 0, w-1, "1........1"); // 0
195    set_ui8vector_str(X[i++], 0, w-1, "1.....1.11"); // 1
196    set_ui8vector_str(X[i++], 0, w-1, "1..1.1111."); // 2
197    set_ui8vector_str(X[i++], 0, w-1, "1.1111...."); // 3
198    set_ui8vector_str(X[i++], 0, w-1, "111......."); // 4
199   
200    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor2"); printf("");
201    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor2.txt");
202}
203// -----------------------------------------------------------------------
204void init_forme_backdoor3(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
205// -----------------------------------------------------------------------
206{
207    uint8 **X;
208    int i =  0;
209    int h =  6;
210    int w = 13;
211   
212    X = ui8matrix(    0, h-1, 0, w-1);
213    zero_ui8matrix(X, 0, h-1, 0, w-1);
214   
215    *X0 = X;
216    *i0 = 0; *i1 = h-1;
217    *j0 = 0; *j1 = w-1;
218   
219    //                                 00000000001111
220    //                                 01234567890123
221    set_ui8vector_str(X[i++], 0, w-1, "1           1"); // 0
222    set_ui8vector_str(X[i++], 0, w-1, "1        1 11"); // 1
223    set_ui8vector_str(X[i++], 0, w-1, "1     1.1111."); // 2
224    set_ui8vector_str(X[i++], 0, w-1, "1  1 1111    "); // 3
225    set_ui8vector_str(X[i++], 0, w-1, "1 1111       "); // 4
226    set_ui8vector_str(X[i++], 0, w-1, "111          "); // 5
227   
228    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor3"); printf("");
229    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor3.txt");
230}
231// ------------------------------------------------------------------------
232void init_forme_backdoor1b(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
233// ------------------------------------------------------------------------
234{
235    // backdoor1b = 8C(backdoor1)
236
237    uint8 **X;
238    int i =  0;
239    int h =  4;
240    int w =  9;
241   
242    X = ui8matrix(    0, h-1, 0, w-1);
243    zero_ui8matrix(X, 0, h-1, 0, w-1);
244   
245    *X0 = X;
246    *i0 = 0; *i1 = h-1;
247    *j0 = 0; *j1 = w-1;
248   
249    //                                 0000000000
250    //                                 0123456789
251    set_ui8vector_str(X[i++], 0, w-1, "1.......1"); // 0
252    set_ui8vector_str(X[i++], 0, w-1, "1...1.111"); // 1
253    set_ui8vector_str(X[i++], 0, w-1, "1.11111.."); // 2
254    set_ui8vector_str(X[i++], 0, w-1, "111......"); // 3
255   
256    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor1b"); printf("");
257    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor1b.txt");
258}
259// ------------------------------------------------------------------------
260void init_forme_backdoor2b(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
261// ------------------------------------------------------------------------
262{
263    // backdoor2b = 8C(backdoor2)
264   
265    uint8 **X;
266    int i =  0;
267    int h =  5;
268    int w = 13;
269   
270    X = ui8matrix(    0, h-1, 0, w-1);
271    zero_ui8matrix(X, 0, h-1, 0, w-1);
272   
273    *X0 = X;
274    *i0 = 0; *i1 = h-1;
275    *j0 = 0; *j1 = w-1;
276   
277    //                                 00000000001111
278    //                                 01234567890123
279    set_ui8vector_str(X[i++], 0, w-1, "1...........1"); // 0
280    set_ui8vector_str(X[i++], 0, w-1, "1.......1.111"); // 1
281    set_ui8vector_str(X[i++], 0, w-1, "1...1.11111.."); // 2
282    set_ui8vector_str(X[i++], 0, w-1, "1 11111......"); // 3
283    set_ui8vector_str(X[i++], 0, w-1, "111.........."); // 4
284   
285    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor2b"); printf("");
286    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor2b.txt");
287}
288// ------------------------------------------------------------------------
289void init_forme_backdoor3b(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
290// ------------------------------------------------------------------------
291{
292    // backdoor3b = 8C(backdoor3)
293   
294    uint8 **X;
295    int i =  0;
296    int h =  6;
297    int w = 17;
298   
299    X = ui8matrix(    0, h-1, 0, w-1);
300    zero_ui8matrix(X, 0, h-1, 0, w-1);
301   
302    *X0 = X;
303    *i0 = 0; *i1 = h-1;
304    *j0 = 0; *j1 = w-1;
305   
306    //                                 000000000011111111
307    //                                 012345678901234567
308    set_ui8vector_str(X[i++], 0, w-1, "1...............1"); // 0
309    set_ui8vector_str(X[i++], 0, w-1, "1...........1.111"); // 1
310    set_ui8vector_str(X[i++], 0, w-1, "1.......1.11111.."); // 2
311    set_ui8vector_str(X[i++], 0, w-1, "1...1.11111......"); // 3
312    set_ui8vector_str(X[i++], 0, w-1, "1 11111.........."); // 4
313    set_ui8vector_str(X[i++], 0, w-1, "111.............."); // 5
314   
315    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor3b"); printf("");
316    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor3b.txt");
317}
318// ----------------------------------------------------------------------------
319void init_forme_LSL_backdoor1b(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
320// ----------------------------------------------------------------------------
321{
322    uint8 **X;
323    int i =  0;
324    int h =  5;
325    int w =  8;
326   
327    X = ui8matrix(    0, h-1, 0, w-1);
328    zero_ui8matrix(X, 0, h-1, 0, w-1);
329   
330    *X0 = X;
331    *i0 = 0; *i1 = h-1;
332    *j0 = 0; *j1 = w-1;
333   
334    //                                 000000000
335    //                                 012345678
336    set_ui8vector_str(X[i++], 0, w-1, "1      1"); // 0
337    set_ui8vector_str(X[i++], 0, w-1, "1    1 1"); // 1
338    set_ui8vector_str(X[i++], 0, w-1, "1  1 1 1"); // 2
339    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1 "); // 3
340    set_ui8vector_str(X[i++], 0, w-1, " 1      "); // 4
341
342   
343    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_LSL_backdoor1b"); printf("");
344    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_LSL_backdoor1b.txt");
345}
346// ----------------------------------------------------------------------------
347void init_forme_LSL_backdoor2b(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
348// ----------------------------------------------------------------------------
349{
350    uint8 **X;
351    int i =  0;
352    int h =  6;
353    int w = 10;
354   
355    X = ui8matrix(    0, h-1, 0, w-1);
356    zero_ui8matrix(X, 0, h-1, 0, w-1);
357   
358    *X0 = X;
359    *i0 = 0; *i1 = h-1;
360    *j0 = 0; *j1 = w-1;
361   
362    //                                 00000000001
363    //                                 01234567890
364    set_ui8vector_str(X[i++], 0, w-1, "1        1"); // 0
365    set_ui8vector_str(X[i++], 0, w-1, "1      1 1"); // 1
366    set_ui8vector_str(X[i++], 0, w-1, "1    1 1 1"); // 2
367    set_ui8vector_str(X[i++], 0, w-1, "1  1 1 1 1"); // 3
368    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1 1 "); // 4
369    set_ui8vector_str(X[i++], 0, w-1, " 1        "); // 5
370   
371    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_LSL_backdoor2b"); printf("");
372    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_LSL_backdoor2b.txt");
373}
374// ----------------------------------------------------------------------------
375void init_forme_LSL_backdoor3b(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
376// ----------------------------------------------------------------------------
377{
378    uint8 **X;
379    int i =  0;
380    int h =  6;
381    int w = 10;
382   
383    X = ui8matrix(    0, h-1, 0, w-1);
384    zero_ui8matrix(X, 0, h-1, 0, w-1);
385   
386    *X0 = X;
387    *i0 = 0; *i1 = h-1;
388    *j0 = 0; *j1 = w-1;
389   
390    //                                 00000000001
391    //                                 01234567890
392    set_ui8vector_str(X[i++], 0, w-1, "1       1"); // 0
393    set_ui8vector_str(X[i++], 0, w-1, "1     1 1"); // 1
394    set_ui8vector_str(X[i++], 0, w-1, "1   1 1 1"); // 2
395    set_ui8vector_str(X[i++], 0, w-1, "1  1 1 1 "); // 3
396    set_ui8vector_str(X[i++], 0, w-1, "1 1      "); // 4
397    set_ui8vector_str(X[i++], 0, w-1, " 1       "); // 5
398   
399    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_LSL_backdoor3b"); printf("");
400    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_LSL_backdoor3b.txt");
401}
402// -----------------------------------------------------------------------
403void init_forme_backdoor7(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
404// -----------------------------------------------------------------------
405{   
406    uint8 **X;
407    int i =  0;
408    int h =  6;
409    int w = 10;
410   
411    X = ui8matrix(    0, h-1, 0, w-1);
412    zero_ui8matrix(X, 0, h-1, 0, w-1);
413   
414    *X0 = X;
415    *i0 = 0; *i1 = h-1;
416    *j0 = 0; *j1 = w-1;
417   
418    //                                 00000000001
419    //                                 01234567890
420    set_ui8vector_str(X[i++], 0, w-1, ".........1"); // 0
421    set_ui8vector_str(X[i++], 0, w-1, ".......1.1"); // 1
422    set_ui8vector_str(X[i++], 0, w-1, ".....1.1.1"); // 2
423    set_ui8vector_str(X[i++], 0, w-1, "1..1.1.1.1"); // 3
424    set_ui8vector_str(X[i++], 0, w-1, "1.11111111"); // 4
425    set_ui8vector_str(X[i++], 0, w-1, "111......."); // 5
426   
427    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor7"); printf("");
428    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor8.txt");
429}
430// -----------------------------------------------------------------------
431void init_forme_backdoor8(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
432// -----------------------------------------------------------------------
433{
434    uint8 **X;
435    int i =  0;
436    int h =  7;
437    int w = 10;
438   
439    X = ui8matrix(    0, h-1, 0, w-1);
440    zero_ui8matrix(X, 0, h-1, 0, w-1);
441   
442    *X0 = X;
443    *i0 = 0; *i1 = h-1;
444    *j0 = 0; *j1 = w-1;
445   
446    //                                 00000000001
447    //                                 01234567890
448    set_ui8vector_str(X[i++], 0, w-1, ".........1"); // 0
449    set_ui8vector_str(X[i++], 0, w-1, ".......1.1"); // 1
450    set_ui8vector_str(X[i++], 0, w-1, "1....1.1.1"); // 2
451    set_ui8vector_str(X[i++], 0, w-1, "1..1.1.1.1"); // 3
452    set_ui8vector_str(X[i++], 0, w-1, "1.11111111"); // 4
453    set_ui8vector_str(X[i++], 0, w-1, "1.1......."); // 5
454    set_ui8vector_str(X[i++], 0, w-1, "111......."); // 6
455   
456    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor8"); printf("");
457    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor8.txt");
458}
459// -----------------------------------------------------------------------
460void init_forme_backdoor9(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
461// -----------------------------------------------------------------------
462{
463    uint8 **X;
464    int i =  0;
465    int h =  7;
466    int w = 10;
467   
468    X = ui8matrix(    0, h-1, 0, w-1);
469    zero_ui8matrix(X, 0, h-1, 0, w-1);
470   
471    *X0 = X;
472    *i0 = 0; *i1 = h-1;
473    *j0 = 0; *j1 = w-1;
474   
475    //                                 00000000001
476    //                                 01234567890
477    set_ui8vector_str(X[i++], 0, w-1, ".........1"); // 0
478    set_ui8vector_str(X[i++], 0, w-1, ".......1.1"); // 1
479    set_ui8vector_str(X[i++], 0, w-1, ".....1.1.1"); // 2
480    set_ui8vector_str(X[i++], 0, w-1, "1..1.1.1.1"); // 3
481    set_ui8vector_str(X[i++], 0, w-1, "1.11111111"); // 4
482    set_ui8vector_str(X[i++], 0, w-1, "1.1......."); // 5
483    set_ui8vector_str(X[i++], 0, w-1, "1.1......."); // 6
484    set_ui8vector_str(X[i++], 0, w-1, "111......."); // 7
485   
486    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor9"); printf("");
487    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor9.txt");
488}
489// ------------------------------------------------------------------------
490void init_forme_backdoor10(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
491// ------------------------------------------------------------------------
492{
493    uint8 **X;
494    int i =  0;
495    int h =  9;
496    int w = 11;
497   
498    X = ui8matrix(    0, h-1, 0, w-1);
499    zero_ui8matrix(X, 0, h-1, 0, w-1);
500   
501    *X0 = X;
502    *i0 = 0; *i1 = h-1;
503    *j0 = 0; *j1 = w-1;
504   
505    //                                 000000000011
506    //                                 012345678901
507    set_ui8vector_str(X[i++], 0, w-1, "1         1"); // 0
508    set_ui8vector_str(X[i++], 0, w-1, "1       1 1"); // 1
509    set_ui8vector_str(X[i++], 0, w-1, "1     1 1 1"); // 2
510    set_ui8vector_str(X[i++], 0, w-1, "1   1 1 1 1"); // 3
511    set_ui8vector_str(X[i++], 0, w-1, "1 1.1 1 1 1"); // 4
512    set_ui8vector_str(X[i++], 0, w-1, "1 111 1 1 1"); // 5
513    set_ui8vector_str(X[i++], 0, w-1, "111 111 1 1"); // 6
514    set_ui8vector_str(X[i++], 0, w-1, "      111 1"); // 7
515    set_ui8vector_str(X[i++], 0, w-1, "        111"); // 8
516   
517    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor10"); printf("");
518    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor10.txt");
519}
520// ------------------------------------------------------------------------
521void init_forme_backdoor11(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
522// ------------------------------------------------------------------------
523{
524    uint8 **X;
525    int i =  0;
526    int h =  9;
527    int w = 11;
528   
529    X = ui8matrix(    0, h-1, 0, w-1);
530    zero_ui8matrix(X, 0, h-1, 0, w-1);
531   
532    *X0 = X;
533    *i0 = 0; *i1 = h-1;
534    *j0 = 0; *j1 = w-1;
535   
536    //                                 000000000011
537    //                                 012345678901
538    set_ui8vector_str(X[i++], 0, w-1, "1         1"); // 0
539    set_ui8vector_str(X[i++], 0, w-1, "1       1 1"); // 1
540    set_ui8vector_str(X[i++], 0, w-1, "1     1 1 1"); // 2
541    set_ui8vector_str(X[i++], 0, w-1, "1   1 1 1 1"); // 3
542    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1 1 1"); // 4
543    set_ui8vector_str(X[i++], 0, w-1, "1 111 1 1 1"); // 5
544    set_ui8vector_str(X[i++], 0, w-1, "1 1 111 1 1"); // 6
545    set_ui8vector_str(X[i++], 0, w-1, "111   111 1"); // 7
546    set_ui8vector_str(X[i++], 0, w-1, "        111"); // 8
547   
548    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor11"); printf("");
549    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor11.txt");
550}
551// ------------------------------------------------------------------------
552void init_forme_backdoor12(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
553// ------------------------------------------------------------------------
554{
555    uint8 **X;
556    int i =  0;
557    int h =  9;
558    int w = 11;
559   
560    X = ui8matrix(    0, h-1, 0, w-1);
561    zero_ui8matrix(X, 0, h-1, 0, w-1);
562   
563    *X0 = X;
564    *i0 = 0; *i1 = h-1;
565    *j0 = 0; *j1 = w-1;
566   
567    //                                 000000000011
568    //                                 012345678901
569    set_ui8vector_str(X[i++], 0, w-1, "1         1"); // 0
570    set_ui8vector_str(X[i++], 0, w-1, "1       1 1"); // 1
571    set_ui8vector_str(X[i++], 0, w-1, "1     1 1 1"); // 2
572    set_ui8vector_str(X[i++], 0, w-1, "1   1 1 1 1"); // 3
573    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1 1 1"); // 4
574    set_ui8vector_str(X[i++], 0, w-1, "1 111 1 1 1"); // 5
575    set_ui8vector_str(X[i++], 0, w-1, "1 1 111 1 1"); // 6
576    set_ui8vector_str(X[i++], 0, w-1, "1 1   111 1"); // 7
577    set_ui8vector_str(X[i++], 0, w-1, "111     111"); // 8
578   
579    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor12"); printf("");
580    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor12.txt");
581}
582// ------------------------------------------------------------------------
583void init_forme_backdoor13(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
584// ------------------------------------------------------------------------
585{
586    uint8 **X;
587    int i =  0;
588    int h = 11;
589    int w = 13;
590   
591    X = ui8matrix(    0, h-1, 0, w-1);
592    zero_ui8matrix(X, 0, h-1, 0, w-1);
593   
594    *X0 = X;
595    *i0 = 0; *i1 = h-1;
596    *j0 = 0; *j1 = w-1;
597   
598    //                                 00000000001123
599    //                                 01234567890123
600    set_ui8vector_str(X[i++], 0, w-1, "1           1"); //  0
601    set_ui8vector_str(X[i++], 0, w-1, "1         1 1"); //  1
602    set_ui8vector_str(X[i++], 0, w-1, "1       1 1 1"); //  2
603    set_ui8vector_str(X[i++], 0, w-1, "1     1 1 1 1"); //  3
604    set_ui8vector_str(X[i++], 0, w-1, "1   1 1 1 1 1"); //  4
605    set_ui8vector_str(X[i++], 0, w-1, "1 1.1 1 1 1 1"); //  5
606    set_ui8vector_str(X[i++], 0, w-1, "1 111 1 1 1 1"); //  6
607    set_ui8vector_str(X[i++], 0, w-1, "111 111 1 1 1"); //  7
608    set_ui8vector_str(X[i++], 0, w-1, "      111 1 1"); //  8
609    set_ui8vector_str(X[i++], 0, w-1, "        111 1"); //  9
610    set_ui8vector_str(X[i++], 0, w-1, "          111"); // 10
611   
612    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor13"); printf("");
613    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor13.txt");
614}
615// -------------------------------------------------------------------------
616void init_selkow_backdoor41(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
617// -------------------------------------------------------------------------
618{
619    // plus petite forme qui fait planter Selkow1
620    // avec un graphe de profondeur 4
621   
622    uint8 **X;
623    int i =  0;
624    int h =  4;
625    int w =  6;
626   
627    X = ui8matrix(    0, h-1, 0, w-1);
628    zero_ui8matrix(X, 0, h-1, 0, w-1);
629   
630    *X0 = X;
631    *i0 = 0; *i1 = h-1;
632    *j0 = 0; *j1 = w-1;
633   
634    //                                 0000000
635    //                                 0123456
636    set_ui8vector_str(X[i++], 0, w-1, "1....1"); // 0
637    set_ui8vector_str(X[i++], 0, w-1, "1..1.1"); // 1
638    set_ui8vector_str(X[i++], 0, w-1, "1.1111"); // 2
639    set_ui8vector_str(X[i++], 0, w-1, "111..."); // 3
640   
641    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_selkow_backdoor41"); printf("");
642    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_selkow_backdoor41.txt");
643}
644// -------------------------------------------------------------------------
645void init_selkow_backdoor42(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
646// -------------------------------------------------------------------------
647{
648    // plus petite forme qui fait planter Selkow2
649   
650    uint8 **X;
651    int i =  0;
652    int h =  5;
653    int w =  8;
654   
655    X = ui8matrix(    0, h-1, 0, w-1);
656    zero_ui8matrix(X, 0, h-1, 0, w-1);
657   
658    *X0 = X;
659    *i0 = 0; *i1 = h-1;
660    *j0 = 0; *j1 = w-1;
661   
662    //                                 000000000
663    //                                 012345678
664    set_ui8vector_str(X[i++], 0, w-1, "1......1"); // 0
665    set_ui8vector_str(X[i++], 0, w-1, "1... 1.1"); // 1
666    set_ui8vector_str(X[i++], 0, w-1, "1..1.1.1"); // 2
667    set_ui8vector_str(X[i++], 0, w-1, "1.111111"); // 3
668    set_ui8vector_str(X[i++], 0, w-1, "111....."); // 4
669   
670    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_selkow_backdoor42"); printf("");
671    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_selkow_backdoor42.txt");
672}
673// -------------------------------------------------------------------------
674void init_selkow_backdoor43(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
675// -------------------------------------------------------------------------
676{
677    // plus petite forme qui fait planter Selkow3
678   
679    uint8 **X;
680    int i =  0;
681    int h =  6;
682    int w = 10;
683   
684    X = ui8matrix(    0, h-1, 0, w-1);
685    zero_ui8matrix(X, 0, h-1, 0, w-1);
686   
687    *X0 = X;
688    *i0 = 0; *i1 = h-1;
689    *j0 = 0; *j1 = w-1;
690   
691    //                                 00000000001
692    //                                 01234567890
693    set_ui8vector_str(X[i++], 0, w-1, "1........1"); // 0
694    set_ui8vector_str(X[i++], 0, w-1, "1......1.1"); // 1
695    set_ui8vector_str(X[i++], 0, w-1, "1... 1.1.1"); // 2
696    set_ui8vector_str(X[i++], 0, w-1, "1..1.1.1.1"); // 3
697    set_ui8vector_str(X[i++], 0, w-1, "1.11111111"); // 4
698    set_ui8vector_str(X[i++], 0, w-1, "111......."); // 5
699   
700    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_selkow_backdoor43"); printf("");
701    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_selkow_backdoor43.txt");
702}
703// -----------------------------------------------------------------------------
704void init_forme_backdoor_rampe4(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
705// -----------------------------------------------------------------------------
706{
707    uint8 **X;
708    int i =  0;
709    int h =  5;
710    int w =  9;
711   
712    X = ui8matrix(    0, h-1, 0, w-1);
713    zero_ui8matrix(X, 0, h-1, 0, w-1);
714   
715    *X0 = X;
716    *i0 = 0; *i1 = h-1;
717    *j0 = 0; *j1 = w-1;
718   
719    //                                 0000000000
720    //                                 0123456789
721    set_ui8vector_str(X[i++], 0, w-1, ".......1"); // 0
722    set_ui8vector_str(X[i++], 0, w-1, ".... 1.1"); // 1
723    set_ui8vector_str(X[i++], 0, w-1, "1..1.1.1"); // 2
724    set_ui8vector_str(X[i++], 0, w-1, "1.111111"); // 3
725    set_ui8vector_str(X[i++], 0, w-1, "111....."); // 4
726   
727    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor_ramp4"); printf("");
728    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor_ramp4.txt");
729}
730// -----------------------------------------------------------------------------
731void init_forme_backdoor_rampe5(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
732// -----------------------------------------------------------------------------
733{
734    // backdoor6 = 8C(backdoor3)
735   
736    uint8 **X;
737    int i =  0;
738    int h =  6;
739    int w = 10;
740   
741    X = ui8matrix(    0, h-1, 0, w-1);
742    zero_ui8matrix(X, 0, h-1, 0, w-1);
743   
744    *X0 = X;
745    *i0 = 0; *i1 = h-1;
746    *j0 = 0; *j1 = w-1;
747   
748    //                                 00000000001
749    //                                 01234567890
750    set_ui8vector_str(X[i++], 0, w-1, ".........1"); // 0
751    set_ui8vector_str(X[i++], 0, w-1, ".......1.1"); // 1
752    set_ui8vector_str(X[i++], 0, w-1, ".....1.1.1"); // 2
753    set_ui8vector_str(X[i++], 0, w-1, "1..1.1.1.1"); // 3
754    set_ui8vector_str(X[i++], 0, w-1, "1.11111111"); // 4
755    set_ui8vector_str(X[i++], 0, w-1, "111......."); // 5
756   
757    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_backdoor_ramp6"); printf("");
758    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_backdoor_ramp6.txt");
759}
760
761// --------------------------------------------------------------
762void init_formeM(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
763// --------------------------------------------------------------
764{
765    uint8 **X;
766    int i =  0;
767    int h =  8;
768    int w = 10;
769   
770    X = ui8matrix(    0, h-1, 0, w-1);
771    zero_ui8matrix(X, 0, h-1, 0, w-1);
772   
773    *X0 = X;
774    *i0 = 0; *i1 = h-1;
775    *j0 = 0; *j1 = w-1;
776   
777    //                                 0000000000
778    //                                 0123456789
779    set_ui8vector_str(X[i++], 0, w-1, "........."); // 0
780    set_ui8vector_str(X[i++], 0, w-1, ".11...11."); // 1
781    set_ui8vector_str(X[i++], 0, w-1, ".111.111."); // 2
782    set_ui8vector_str(X[i++], 0, w-1, ".111.111."); // 3
783    set_ui8vector_str(X[i++], 0, w-1, "11.111.11"); // 4
784    set_ui8vector_str(X[i++], 0, w-1, "11.111.11"); // 5
785    set_ui8vector_str(X[i++], 0, w-1, "11..1..11"); // 6
786    set_ui8vector_str(X[i++], 0, w-1, "11.....11"); // 7
787   
788    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_M"); printf("");
789    write_ui8matrix_positive  (X, 0, h-1, 0, w-1, 4, "forme_M.txt");
790}
791// --------------------------------------------------------------
792void init_formeU(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
793// --------------------------------------------------------------
794{   
795    uint8 **X;
796    int i =  0;
797    int h =  5;
798    int w = 12;
799   
800    X = ui8matrix(0, h-1, 0, w-1);
801    zero_ui8matrix(X, 0, h-1, 0, w-1);
802   
803    *X0 = X;
804    *i0 = 0; *i1 = h-1;
805    *j0 = 0; *j1 = w-1;
806   
807    //                                 0000000000111
808    //                                 0123456789012
809    set_ui8vector_str(X[i++], 0, w-1, "1111....1111"); // 0
810    set_ui8vector_str(X[i++], 0, w-1, "...1... 1..."); // 1
811    set_ui8vector_str(X[i++], 0, w-1, "...1....1..."); // 2
812    set_ui8vector_str(X[i++], 0, w-1, "...111111..."); // 3
813    set_ui8vector_str(X[i++], 0, w-1, "............"); // 4
814   
815    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "formeU"); printf("");
816    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "formeU.txt");
817}
818// ---------------------------------------------------------------------
819void init_forme_Bailey1(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
820// ---------------------------------------------------------------------
821{   
822    uint8 **X;
823    int i = 0;
824    int h = 2;
825    int w = 5;
826   
827    X = ui8matrix(0, h-1, 0, w-1);
828    zero_ui8matrix(X, 0, h-1, 0, w-1);
829   
830    *X0 = X;
831    *i0 = 0; *i1 = h-1;
832    *j0 = 0; *j1 = w-1;
833   
834    //                                 0000000000111
835    //                                 0123456789012
836    set_ui8vector_str(X[i++], 0, w-1, "1.1.1"); // 0
837    set_ui8vector_str(X[i++], 0, w-1, "11111"); // 1
838   
839    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey1"); printf("");
840    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey1.txt");
841}
842// ---------------------------------------------------------------------
843void init_forme_Bailey2(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
844// ---------------------------------------------------------------------
845{   
846    uint8 **X;
847    int i = 0;
848    int h = 5;
849    int w = 7;
850   
851    X = ui8matrix(0, h-1, 0, w-1);
852    zero_ui8matrix(X, 0, h-1, 0, w-1);
853   
854    *X0 = X;
855    *i0 = 0; *i1 = h-1;
856    *j0 = 0; *j1 = w-1;
857   
858    //                                 0000000000111
859    //                                 0123456789012
860    set_ui8vector_str(X[i++], 0, w-1, "......1"); // 0
861    set_ui8vector_str(X[i++], 0, w-1, "....1.1"); // 1
862    set_ui8vector_str(X[i++], 0, w-1, "..1.1.1"); // 2
863    set_ui8vector_str(X[i++], 0, w-1, "1.1.1.1"); // 3
864    set_ui8vector_str(X[i++], 0, w-1, "1111111"); // 4
865   
866    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey2"); printf("");
867    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey2.txt");
868}
869// ---------------------------------------------------------------------
870void init_forme_Bailey3(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
871// ---------------------------------------------------------------------
872{   
873    uint8 **X;
874    int i = 0;
875    int h = 7;
876    int w = 7;
877   
878    X = ui8matrix(0, h-1, 0, w-1);
879    zero_ui8matrix(X, 0, h-1, 0, w-1);
880   
881    *X0 = X;
882    *i0 = 0; *i1 = h-1;
883    *j0 = 0; *j1 = w-1;
884   
885    //                                 0000000000111
886    //                                 0123456789012
887    set_ui8vector_str(X[i++], 0, w-1, "1       1"); // 0
888    set_ui8vector_str(X[i++], 0, w-1, "1     1 1"); // 1
889    set_ui8vector_str(X[i++], 0, w-1, "1   1 1 1"); // 2
890    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1 1"); // 3
891    set_ui8vector_str(X[i++], 0, w-1, "1 1111111"); // 4
892    set_ui8vector_str(X[i++], 0, w-1, "1  1     "); // 5
893    set_ui8vector_str(X[i++], 0, w-1, "1111     "); // 6
894   
895    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey3"); printf("");
896    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey3.txt");
897}
898// ---------------------------------------------------------------------
899void init_forme_Bailey4(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
900// ---------------------------------------------------------------------
901{   
902    uint8 **X;
903    int i = 0;
904    int h = 8;
905    int w = 9;
906   
907    X = ui8matrix(0, h-1, 0, w-1);
908    zero_ui8matrix(X, 0, h-1, 0, w-1);
909   
910    *X0 = X;
911    *i0 = 0; *i1 = h-1;
912    *j0 = 0; *j1 = w-1;
913   
914    //                                 0000000000111
915    //                                 0123456789012
916    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1 1"); // 0
917    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 111"); // 1
918    set_ui8vector_str(X[i++], 0, w-1, "1 1 1  1 "); // 2
919    set_ui8vector_str(X[i++], 0, w-1, "1 1 1111 "); // 3
920    set_ui8vector_str(X[i++], 0, w-1, "1 1  1   "); // 4
921    set_ui8vector_str(X[i++], 0, w-1, "1 1111   "); // 5
922    set_ui8vector_str(X[i++], 0, w-1, "1  1     "); // 6
923    set_ui8vector_str(X[i++], 0, w-1, "1111     "); // 7
924   
925    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey4"); printf("");
926    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey4.txt");
927}
928// ---------------------------------------------------------------------
929void init_forme_Bailey5(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
930// ---------------------------------------------------------------------
931{   
932    uint8 **X;
933    int i =  0;
934    int h =  8;
935    int w = 17;
936   
937    X = ui8matrix(0, h-1, 0, w-1);
938    zero_ui8matrix(X, 0, h-1, 0, w-1);
939   
940    *X0 = X;
941    *i0 = 0; *i1 = h-1;
942    *j0 = 0; *j1 = w-1;
943   
944    //                                 0000000000111
945    //                                 012345678901234567
946    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1   1 1 1 1"); // 0
947    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 11111 1 1 1"); // 1
948    set_ui8vector_str(X[i++], 0, w-1, "1 1 1  1 1  1 1 1"); // 2
949    set_ui8vector_str(X[i++], 0, w-1, "1 1 1111 1111 1 1"); // 3
950    set_ui8vector_str(X[i++], 0, w-1, "1 1  1     1  1 1"); // 4
951    set_ui8vector_str(X[i++], 0, w-1, "1 1111     1111 1"); // 5
952    set_ui8vector_str(X[i++], 0, w-1, "1  1         1  1"); // 6
953    set_ui8vector_str(X[i++], 0, w-1, "1111         1111"); // 7
954   
955    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey5"); printf("");
956    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey5.txt");
957}
958// ---------------------------------------------------------------------
959void init_forme_Bailey6(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
960// ---------------------------------------------------------------------
961{
962    // a priori plus difficile que Bailey7
963    uint8 **X;
964    int i =  0;
965    int h = 11;
966    int w = 17;
967   
968    X = ui8matrix(0, h-1, 0, w-1);
969    zero_ui8matrix(X, 0, h-1, 0, w-1);
970   
971    *X0 = X;
972    *i0 = 0; *i1 = h-1;
973    *j0 = 0; *j1 = w-1;
974   
975    //                                 000000000011111111
976    //                                 012345678901234567
977    set_ui8vector_str(X[i++], 0, w-1, "1               1"); // 0
978    set_ui8vector_str(X[i++], 0, w-1, "1 1           1 1"); // 1
979    set_ui8vector_str(X[i++], 0, w-1, "1 1 1       1 1 1"); // 2
980    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1   1 1 1 1"); // 3
981    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 11111 1 1 1"); // 4
982    set_ui8vector_str(X[i++], 0, w-1, "1 1 1  1 1  1 1 1"); // 5
983    set_ui8vector_str(X[i++], 0, w-1, "1 1 1111 1111 1 1"); // 6
984    set_ui8vector_str(X[i++], 0, w-1, "1 1  1     1  1 1"); // 7
985    set_ui8vector_str(X[i++], 0, w-1, "1 1111     1111 1"); // 8
986    set_ui8vector_str(X[i++], 0, w-1, "1  1         1  1"); // 9
987    set_ui8vector_str(X[i++], 0, w-1, "1111         1111"); // 10
988   
989    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey6"); printf("");
990    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey6.txt");
991}
992// ---------------------------------------------------------------------
993void init_forme_Bailey6b(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
994// ---------------------------------------------------------------------
995{
996    // a priori plus difficile que Bailey7
997    uint8 **X;
998    int i =  0;
999    int h =  8;
1000    int w = 17;
1001   
1002    X = ui8matrix(0, h-1, 0, w-1);
1003    zero_ui8matrix(X, 0, h-1, 0, w-1);
1004   
1005    *X0 = X;
1006    *i0 = 0; *i1 = h-1;
1007    *j0 = 0; *j1 = w-1;
1008   
1009    //                                 000000000011111111
1010    //                                 012345678901234567
1011    set_ui8vector_str(X[i++], 0, w-1, "1               1"); // 0
1012    set_ui8vector_str(X[i++], 0, w-1, "1 1           1 1"); // 1
1013    set_ui8vector_str(X[i++], 0, w-1, "1 1 1       1 1 1"); // 2
1014    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1   1 1 1 1"); // 3
1015    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 11111 1 1 1"); // 4
1016    set_ui8vector_str(X[i++], 0, w-1, "1 1 111   111 1 1"); // 5
1017    set_ui8vector_str(X[i++], 0, w-1, "1 111       111 1"); // 6
1018    set_ui8vector_str(X[i++], 0, w-1, "111           111"); // 7
1019   
1020    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey6"); printf("");
1021    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey6.txt");
1022}
1023// ---------------------------------------------------------------------
1024void init_forme_Bailey7(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1025// ---------------------------------------------------------------------
1026{
1027    // a priori plus facile que Bailey6
1028    uint8 **X;
1029    int i =  0;
1030    int h =  8;
1031    int w = 17;
1032   
1033    X = ui8matrix(0, h-1, 0, w-1);
1034    zero_ui8matrix(X, 0, h-1, 0, w-1);
1035   
1036    *X0 = X;
1037    *i0 = 0; *i1 = h-1;
1038    *j0 = 0; *j1 = w-1;
1039   
1040    //                                 000000000011111111
1041    //                                 012345678901234567
1042    set_ui8vector_str(X[i++], 0, w-1, "      1   1      "); // 0
1043    set_ui8vector_str(X[i++], 0, w-1, "    1 11111 1    "); // 1
1044    set_ui8vector_str(X[i++], 0, w-1, "  1 1  1 1  1 1  "); // 2
1045    set_ui8vector_str(X[i++], 0, w-1, "1 1 1111 1111 1 1"); // 3
1046    set_ui8vector_str(X[i++], 0, w-1, "1 1  1     1  1 1"); // 4
1047    set_ui8vector_str(X[i++], 0, w-1, "1 1111     1111 1"); // 5
1048    set_ui8vector_str(X[i++], 0, w-1, "1  1         1  1"); // 6
1049    set_ui8vector_str(X[i++], 0, w-1, "1111         1111"); // 7
1050   
1051    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey7"); printf("");
1052    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey7.txt");
1053}
1054// ---------------------------------------------------------------------
1055void init_forme_Bailey8(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1056// ---------------------------------------------------------------------
1057{
1058    uint8 **X;
1059    int i =  0;
1060    int h =  3;
1061    int w = 19;
1062   
1063    X = ui8matrix(0, h-1, 0, w-1);
1064    zero_ui8matrix(X, 0, h-1, 0, w-1);
1065   
1066    *X0 = X;
1067    *i0 = 0; *i1 = h-1;
1068    *j0 = 0; *j1 = w-1;
1069   
1070    //                                 00000000001111111111
1071    //                                 01234567890123456789
1072    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1 1 1 1 1 1 1"); // 0
1073    set_ui8vector_str(X[i++], 0, w-1, "111 111 111 111 111"); // 1
1074    set_ui8vector_str(X[i++], 0, w-1, "  111 111 111 111  "); // 2
1075   
1076    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey8"); printf("");
1077    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey8.txt");
1078}
1079// ---------------------------------------------------------------------
1080void init_forme_Bailey9(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1081// ---------------------------------------------------------------------
1082{
1083    uint8 **X;
1084    int i =  0;
1085    int h =  4;
1086    int w = 24;
1087   
1088    X = ui8matrix(0, h-1, 0, w-1);
1089    zero_ui8matrix(X, 0, h-1, 0, w-1);
1090   
1091    *X0 = X;
1092    *i0 = 0; *i1 = h-1;
1093    *j0 = 0; *j1 = w-1;
1094   
1095    //                                 000000000011111111112222
1096    //                                 012345678901234567890123
1097    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1 1 1 1 1 1 1 1 1"); // 0
1098    set_ui8vector_str(X[i++], 0, w-1, "111 111 111 111 111 111"); // 1
1099    set_ui8vector_str(X[i++], 0, w-1, "  111 111     111 111  "); // 2
1100    set_ui8vector_str(X[i++], 0, w-1, "        1111111        "); // 3
1101   
1102    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey9"); printf("");
1103    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey9.txt");
1104}
1105// -----------------------------------------------------------------------
1106void init_forme_Bailey10a(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1107// -----------------------------------------------------------------------
1108{
1109    uint8 **X;
1110    int i =  0;
1111    int h =  5;
1112    int w =  7;
1113   
1114    X = ui8matrix(0, h-1, 0, w-1);
1115    zero_ui8matrix(X, 0, h-1, 0, w-1);
1116   
1117    *X0 = X;
1118    *i0 = 0; *i1 = h-1;
1119    *j0 = 0; *j1 = w-1;
1120   
1121    //                                 00000000
1122    //                                 01234567
1123    set_ui8vector_str(X[i++], 0, w-1, "1     1"); // 0
1124    set_ui8vector_str(X[i++], 0, w-1, "1   1 1"); // 1
1125    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1"); // 2
1126    set_ui8vector_str(X[i++], 0, w-1, "1 111 1"); // 3
1127    set_ui8vector_str(X[i++], 0, w-1, "111 111"); // 4
1128   
1129    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey10a"); printf("");
1130    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey10a.txt");
1131}
1132// -----------------------------------------------------------------------
1133void init_forme_Bailey10b(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1134// -----------------------------------------------------------------------
1135{
1136    // 10b = skrink(10a)
1137   
1138    uint8 **X;
1139    int i =  0;
1140    int h =  4;
1141    int w =  7;
1142   
1143    X = ui8matrix(0, h-1, 0, w-1);
1144    zero_ui8matrix(X, 0, h-1, 0, w-1);
1145   
1146    *X0 = X;
1147    *i0 = 0; *i1 = h-1;
1148    *j0 = 0; *j1 = w-1;
1149   
1150    //                                 00000000
1151    //                                 01234567
1152    set_ui8vector_str(X[i++], 0, w-1, "1     1"); // 1
1153    set_ui8vector_str(X[i++], 0, w-1, "1   1 1"); // 2
1154    set_ui8vector_str(X[i++], 0, w-1, "1 111 1"); // 3
1155    set_ui8vector_str(X[i++], 0, w-1, "111 111"); // 4
1156   
1157    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey10b"); printf("");
1158    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey10b.txt");
1159}
1160// -----------------------------------------------------------------------
1161void init_forme_Bailey10c(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1162// -----------------------------------------------------------------------
1163{
1164    // 10c = skrink(10b)
1165   
1166    uint8 **X;
1167    int i =  0;
1168    int h =  4;
1169    int w =  7;
1170   
1171    X = ui8matrix(0, h-1, 0, w-1);
1172    zero_ui8matrix(X, 0, h-1, 0, w-1);
1173   
1174    *X0 = X;
1175    *i0 = 0; *i1 = h-1;
1176    *j0 = 0; *j1 = w-1;
1177   
1178    //                                 00000000
1179    //                                 01234567
1180    set_ui8vector_str(X[i++], 0, w-1, "1     1"); // 0
1181    set_ui8vector_str(X[i++], 0, w-1, "1 111 1"); // 1
1182    set_ui8vector_str(X[i++], 0, w-1, "111 111"); // 2
1183   
1184   
1185    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey10c"); printf("");
1186    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey10c.txt");
1187}
1188// ------------------------------------------------------------------------
1189void init_forme_Bailey4_v1(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1190// ------------------------------------------------------------------------
1191{   
1192    uint8 **X;
1193    int i =  0;
1194    int h =  4;
1195    int w = 11;
1196   
1197    X = ui8matrix(0, h-1, 0, w-1);
1198    zero_ui8matrix(X, 0, h-1, 0, w-1);
1199   
1200    *X0 = X;
1201    *i0 = 0; *i1 = h-1;
1202    *j0 = 0; *j1 = w-1;
1203   
1204    //                                 0000000000111
1205    //                                 0123456789012
1206    set_ui8vector_str(X[i++], 0, w-1, "  111111111"); // 0
1207    set_ui8vector_str(X[i++], 0, w-1, "  1   1   1"); // 1
1208    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1 1 1"); // 2
1209    set_ui8vector_str(X[i++], 0, w-1, "111 111 111"); // 3
1210   
1211    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey4"); printf("");
1212    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey4.txt");
1213}
1214// ---------------------------------------------------------------------
1215void init_forme_Bailey5_(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1216// ---------------------------------------------------------------------
1217{   
1218    uint8 **X;
1219    int i =  0;
1220    int h =  4;
1221    int w =  7;
1222   
1223    X = ui8matrix(0, h-1, 0, w-1);
1224    zero_ui8matrix(X, 0, h-1, 0, w-1);
1225   
1226    *X0 = X;
1227    *i0 = 0; *i1 = h-1;
1228    *j0 = 0; *j1 = w-1;
1229   
1230    //                                 0000000000111
1231    //                                 0123456789012
1232    set_ui8vector_str(X[i++], 0, w-1, "1      "); // 0
1233    set_ui8vector_str(X[i++], 0, w-1, "1     1"); // 1
1234    set_ui8vector_str(X[i++], 0, w-1, "1 111 1"); // 2
1235    set_ui8vector_str(X[i++], 0, w-1, "111 111"); // 3
1236   
1237    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey5"); printf("");
1238    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey5.txt");
1239}
1240// ---------------------------------------------------------------------
1241void init_forme_Bailey6_(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1242// ---------------------------------------------------------------------
1243{   
1244    uint8 **X;
1245    int i =  0;
1246    int h =  4;
1247    int w =  7;
1248   
1249    X = ui8matrix(0, h-1, 0, w-1);
1250    zero_ui8matrix(X, 0, h-1, 0, w-1);
1251   
1252    *X0 = X;
1253    *i0 = 0; *i1 = h-1;
1254    *j0 = 0; *j1 = w-1;
1255   
1256    //                                 0000000000111
1257    //                                 0123456789012
1258    set_ui8vector_str(X[i++], 0, w-1, "      1"); // 0
1259    set_ui8vector_str(X[i++], 0, w-1, "1     1"); // 1
1260    set_ui8vector_str(X[i++], 0, w-1, "1 111 1"); // 2
1261    set_ui8vector_str(X[i++], 0, w-1, "111 111"); // 3
1262   
1263    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey6"); printf("");
1264    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey6.txt");
1265}
1266// ---------------------------------------------------------------------
1267void init_forme_Bailey7_(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1268// ---------------------------------------------------------------------
1269{   
1270    uint8 **X;
1271    int i =  0;
1272    int h =  4;
1273    int w =  7;
1274   
1275    X = ui8matrix(0, h-1, 0, w-1);
1276    zero_ui8matrix(X, 0, h-1, 0, w-1);
1277   
1278    *X0 = X;
1279    *i0 = 0; *i1 = h-1;
1280    *j0 = 0; *j1 = w-1;
1281   
1282    //                                 0000000000111
1283    //                                 0123456789012
1284    set_ui8vector_str(X[i++], 0, w-1, "1      "); // 0
1285    set_ui8vector_str(X[i++], 0, w-1, "1 111  "); // 1
1286    set_ui8vector_str(X[i++], 0, w-1, "1 1 1 1"); // 2
1287    set_ui8vector_str(X[i++], 0, w-1, "111 111"); // 3
1288   
1289    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey7"); printf("");
1290    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey7.txt");
1291}
1292// -----------------------------------------------------------------------
1293void init_forme_Bailey_10(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1294// -----------------------------------------------------------------------
1295{ 
1296    // 8-connexe
1297    uint8 **X;
1298    int i =  0;
1299    int h =  4;
1300    int w = 17;
1301   
1302    X = ui8matrix(0, h-1, 0, w-1);
1303    zero_ui8matrix(X, 0, h-1, 0, w-1);
1304   
1305    *X0 = X;
1306    *i0 = 0; *i1 = h-1;
1307    *j0 = 0; *j1 = w-1;
1308   
1309    //                                 000000000011111111
1310    //                                 012345678901234567
1311    set_ui8vector_str(X[i++], 0, w-1, ".111.111.111.111."); // 0
1312    set_ui8vector_str(X[i++], 0, w-1, "1...1...1...1...1"); // 1
1313    set_ui8vector_str(X[i++], 0, w-1, "1.11..11..11..11."); // 2
1314   
1315    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_Bailey2"); printf("");
1316    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_Bailey2.txt");
1317}
1318// --------------------------------------------------------------------
1319void init_forme_ipvs_1(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1320// --------------------------------------------------------------------
1321{ 
1322    // 8-connexe
1323    uint8 **X;
1324    int i =  0;
1325    int h =  3;
1326    int w =  8;
1327   
1328    X = ui8matrix(0, h-1, 0, w-1);
1329    zero_ui8matrix(X, 0, h-1, 0, w-1);
1330   
1331    *X0 = X;
1332    *i0 = 0; *i1 = h-1;
1333    *j0 = 0; *j1 = w-1;
1334   
1335    //                                 000000000
1336    //                                 012345678
1337    set_ui8vector_str(X[i++], 0, w-1, "1      1"); // 0
1338    set_ui8vector_str(X[i++], 0, w-1, "1 11111 "); // 1
1339    set_ui8vector_str(X[i++], 0, w-1, " 1  1   "); // 2
1340   
1341    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_ipvs_1"); printf("");
1342    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_ipvs_1.txt");
1343}
1344// --------------------------------------------------------------------
1345void init_forme_ipvs_2(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1346// --------------------------------------------------------------------
1347{ 
1348    // 8-connexe
1349    uint8 **X;
1350    int i =  0;
1351    int h =  4;
1352    int w =  8;
1353   
1354    X = ui8matrix(0, h-1, 0, w-1);
1355    zero_ui8matrix(X, 0, h-1, 0, w-1);
1356   
1357    *X0 = X;
1358    *i0 = 0; *i1 = h-1;
1359    *j0 = 0; *j1 = w-1;
1360   
1361    //                                 000000000
1362    //                                 012345678
1363    set_ui8vector_str(X[i++], 0, w-1, "1 111111"); // 0
1364    set_ui8vector_str(X[i++], 0, w-1, "1 1    1"); // 1
1365    set_ui8vector_str(X[i++], 0, w-1, "1 1  111"); // 2
1366    set_ui8vector_str(X[i++], 0, w-1, " 1  1   "); // 3
1367   
1368    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_ipvs_2"); printf("");
1369    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_ipvs_2.txt");
1370}
1371// ---------------------------------------------------------------------
1372void init_forme_boulon1(uint8 ***X0, int *i0, int *i1, int *j0, int *j1)
1373// ---------------------------------------------------------------------
1374{ 
1375    uint8 **X;
1376    int i =   0;
1377    int h =  28;
1378    int w =  30;
1379   
1380    X = ui8matrix(0, h-1, 0, w-1);
1381    zero_ui8matrix(X, 0, h-1, 0, w-1);
1382   
1383    *X0 = X;
1384    *i0 = 0; *i1 = h-1;
1385    *j0 = 0; *j1 = w-1;
1386   
1387    //                                 0000000001111111111122222222223
1388    //                                 0123456789012345678901234567890
1389    set_ui8vector_str(X[i++], 0, w-1, "                         111  "); // 00
1390    set_ui8vector_str(X[i++], 0, w-1, "                        11111 "); // 01
1391    set_ui8vector_str(X[i++], 0, w-1, "                      1111111 "); // 02
1392    set_ui8vector_str(X[i++], 0, w-1, "                     11111111 "); // 03
1393    set_ui8vector_str(X[i++], 0, w-1, "                    1111111111"); // 04
1394    set_ui8vector_str(X[i++], 0, w-1, "                   11111111111"); // 05
1395    set_ui8vector_str(X[i++], 0, w-1, "                 1111111111111"); // 06
1396    set_ui8vector_str(X[i++], 0, w-1, "               11111111111111 "); // 07
1397    set_ui8vector_str(X[i++], 0, w-1, "              11111111111111  "); // 08
1398    set_ui8vector_str(X[i++], 0, w-1, "             11111111111111   "); // 09
1399    set_ui8vector_str(X[i++], 0, w-1, "     11    11111111111111     "); // 10
1400    set_ui8vector_str(X[i++], 0, w-1, "    111   11111111111111      "); // 11
1401    set_ui8vector_str(X[i++], 0, w-1, "   11111111111111111111       "); // 12
1402    set_ui8vector_str(X[i++], 0, w-1, " 11111111111111111111         "); // 13
1403    set_ui8vector_str(X[i++], 0, w-1, "1111111111111111111           "); // 14
1404    set_ui8vector_str(X[i++], 0, w-1, " 11111111111111111            "); // 15
1405    set_ui8vector_str(X[i++], 0, w-1, " 1111111111111111             "); // 16
1406    set_ui8vector_str(X[i++], 0, w-1, " 111111111111111              "); // 17
1407    set_ui8vector_str(X[i++], 0, w-1, "  111111111111                "); // 18
1408    set_ui8vector_str(X[i++], 0, w-1, "  1111111111                  "); // 29
1409    set_ui8vector_str(X[i++], 0, w-1, "  1111111111                  "); // 20
1410    set_ui8vector_str(X[i++], 0, w-1, "   111111111                  "); // 21
1411    set_ui8vector_str(X[i++], 0, w-1, "   111111111                  "); // 22
1412    set_ui8vector_str(X[i++], 0, w-1, "    11111111                  "); // 23
1413    set_ui8vector_str(X[i++], 0, w-1, "    1111111                   "); // 24
1414    set_ui8vector_str(X[i++], 0, w-1, "     11111                    "); // 25
1415    set_ui8vector_str(X[i++], 0, w-1, "     111                      "); // 26
1416    set_ui8vector_str(X[i++], 0, w-1, "                              "); // 27
1417   
1418    display_ui8matrix_positive(X, 0, h-1, 0, w-1, 4, "forme_boulon1"); printf("");
1419    write_ui8matrix_positive(  X, 0, h-1, 0, w-1, 4, "forme_boulon1.txt");
1420}
Note: See TracBrowser for help on using the repository browser.