File: Ordering_IntOrderTest_Impl.c

package info (click to toggle)
babel 0.10.2-1
  • links: PTS
  • area: contrib
  • in suites: sarge
  • size: 43,932 kB
  • ctags: 29,707
  • sloc: java: 74,695; ansic: 73,142; cpp: 40,649; sh: 18,411; f90: 10,062; fortran: 6,727; python: 6,406; makefile: 3,866; xml: 118; perl: 48
file content (659 lines) | stat: -rw-r--r-- 19,128 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
/*
 * File:          Ordering_IntOrderTest_Impl.c
 * Symbol:        Ordering.IntOrderTest-v0.1
 * Symbol Type:   class
 * Babel Version: 0.10.2
 * Description:   Server-side implementation for Ordering.IntOrderTest
 * 
 * WARNING: Automatically generated; only changes within splicers preserved
 * 
 * babel-version = 0.10.2
 */

/*
 * DEVELOPERS ARE EXPECTED TO PROVIDE IMPLEMENTATIONS
 * FOR THE FOLLOWING METHODS BETWEEN SPLICER PAIRS.
 */

/*
 * Symbol "Ordering.IntOrderTest" (version 0.1)
 * 
 * This class provides methods to verify that the array ordering
 * capabilities work for arrays of int.
 */

#include "Ordering_IntOrderTest_Impl.h"

#line 27 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
/* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest._includes) */
#include <stdlib.h>

static int32_t
iFunc(const int32_t *ind, const int32_t dim)
{
  int32_t res = 0;
  int32_t i;
  for(i = 0; i < dim ; ++i) {
    res += (i+1)*ind[i];
  }
  return res;
}

static int
incIndex(int32_t ind[], const struct sidl_int__array* A, const int32_t dimen)
{
  int32_t i = 0;
  while (i < dimen) {
    if (++(ind[i]) > sidlUpper(A, i)) {
      ind[i] = sidlLower(A, i);
      ++i;
    }
    else {
      return TRUE;
    }
  }
  /* we're all done */
  return FALSE;
}

static sidl_bool
isIMatrix(const struct sidl_int__array* A)
{
  if (A) {
    const int32_t dimen = sidl_int__array_dimen(A);
    int32_t i;
    int32_t *cindex = malloc(sizeof(int32_t)*dimen);
    for(i = 0; i < dimen; ++i){
      cindex[i] = sidlLower(A, i);
      if (sidlLower(A,i) > sidlUpper(A,i)) {
        free(cindex);
        return TRUE;
      }
    }
    do {
      if (iFunc(cindex, dimen) != sidl_int__array_get(A, cindex)) {
        free(cindex);
        return FALSE;
      }
    } while (incIndex(cindex, A, dimen));
    free(cindex);
    return TRUE;
  }
  return FALSE;
}

static void
fillIMatrix(struct sidl_int__array* A)
{
  if (A) {
    const int32_t dimen = sidl_int__array_dimen(A);
    int32_t i;
    int32_t *cindex = malloc(sizeof(int32_t)*dimen);
    for(i = 0; i < dimen; ++i){
      cindex[i] = sidlLower(A, i);
      if (sidlLower(A,i) > sidlUpper(A,i)){
        free(cindex);
        return;
      }
    }
    do {
      sidl_int__array_set(A, cindex, iFunc(cindex, dimen));
    } while (incIndex(cindex, A, dimen));
    free(cindex);
  }
}
/* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest._includes) */
#line 106 "Ordering_IntOrderTest_Impl.c"

/*
 * Static class initializer called exactly once before any user-defined method is dispatched
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest__load"

void
impl_Ordering_IntOrderTest__load(
  void)
{
#line 117 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest._load) */
  /* Insert the implementation of the static class initializer method here... */
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest._load) */
#line 123 "Ordering_IntOrderTest_Impl.c"
}
/*
 * Class constructor called when the class is created.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest__ctor"

void
impl_Ordering_IntOrderTest__ctor(
  /* in */ Ordering_IntOrderTest self)
{
#line 132 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest._ctor) */
  /* Insert the implementation of the constructor method here... */
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest._ctor) */
#line 140 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Class destructor called when the class is deleted.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest__dtor"

void
impl_Ordering_IntOrderTest__dtor(
  /* in */ Ordering_IntOrderTest self)
{
#line 148 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest._dtor) */
  /* Insert the implementation of the destructor method here... */
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest._dtor) */
#line 158 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Create a column-major matrix satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_makeColumnIMatrix"

struct sidl_int__array*
impl_Ordering_IntOrderTest_makeColumnIMatrix(
  /* in */ int32_t size,
  /* in */ sidl_bool useCreateCol)
{
#line 165 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.makeColumnIMatrix) */
  struct sidl_int__array *res;
  if (useCreateCol) {
    res = sidl_int__array_create2dCol(size, size);
  }
  else {
    res = sidl_int__array_create2dRow(size, size);
  }
  fillIMatrix(res);
  return res;
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.makeColumnIMatrix) */
#line 185 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Create a row-major matrix satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_makeRowIMatrix"

struct sidl_int__array*
impl_Ordering_IntOrderTest_makeRowIMatrix(
  /* in */ int32_t size,
  /* in */ sidl_bool useCreateRow)
{
#line 190 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.makeRowIMatrix) */
  struct sidl_int__array *res;
  if (useCreateRow) {
    res = sidl_int__array_create2dRow(size, size);
  }
  else {
    res = sidl_int__array_create2dCol(size, size);
  }
  fillIMatrix(res);
  return res;
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.makeRowIMatrix) */
#line 212 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Create a 4-D matrix satisfying condition I.  Each dimension has
 * size elements numbers 0 through size-1.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_makeIMatrix"

struct sidl_int__array*
impl_Ordering_IntOrderTest_makeIMatrix(
  /* in */ int32_t size,
  /* in */ sidl_bool useCreateColumn)
{
#line 216 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.makeIMatrix) */
  struct sidl_int__array *res;
  static const int lower[4] = { 0, 0, 0, 0};
  int upper[4];
  upper[0] = upper[1] = upper[2] = upper[3] = size - 1;
  if (useCreateColumn) {
    res = sidl_int__array_createCol(4, lower, upper);
  }
  else {
    res = sidl_int__array_createRow(4, lower, upper);
  }
  fillIMatrix(res);
  return res;
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.makeIMatrix) */
#line 243 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Create a column-major matrix satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_createColumnIMatrix"

void
impl_Ordering_IntOrderTest_createColumnIMatrix(
  /* in */ int32_t size,
  /* in */ sidl_bool useCreateCol,
  /* out */ struct sidl_int__array** res)
{
#line 245 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.createColumnIMatrix) */
  if (useCreateCol) {
    *res = Ordering_IntOrderTest_makeColumnIMatrix(size, TRUE);
  }
  else{
    *res = Ordering_IntOrderTest_makeRowIMatrix(size, TRUE);
  }
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.createColumnIMatrix) */
#line 268 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Create a row-major matrix satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_createRowIMatrix"

void
impl_Ordering_IntOrderTest_createRowIMatrix(
  /* in */ int32_t size,
  /* in */ sidl_bool useCreateRow,
  /* out */ struct sidl_int__array** res)
{
#line 268 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.createRowIMatrix) */
  if (useCreateRow) {
    *res = Ordering_IntOrderTest_makeRowIMatrix(size, TRUE);
  }
  else{
    *res = Ordering_IntOrderTest_makeColumnIMatrix(size, TRUE);
  }
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.createRowIMatrix) */
#line 293 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Make sure an array is column-major.  No changes to the dimension or
 * values in a are made.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_ensureColumn"

void
impl_Ordering_IntOrderTest_ensureColumn(
  /* inout */ struct sidl_int__array** a)
{
#line 290 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.ensureColumn) */
  /* no action required */
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.ensureColumn) */
#line 312 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Make sure an array is row-major.  No changes to the dimension or
 * values in a are made.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_ensureRow"

void
impl_Ordering_IntOrderTest_ensureRow(
  /* inout */ struct sidl_int__array** a)
{
#line 307 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.ensureRow) */
  /* no action required */
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.ensureRow) */
#line 331 "Ordering_IntOrderTest_Impl.c"
}

/*
 *  Return <code>true</code> iff the implementation sees
 *  an incoming array satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isIMatrixOne"

sidl_bool
impl_Ordering_IntOrderTest_isIMatrixOne(
  /* in */ struct sidl_int__array* A)
{
#line 324 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isIMatrixOne) */
  return isIMatrix(A);
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isIMatrixOne) */
#line 350 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Return <code>true</code> iff the implementation sees
 * an incoming column-major array satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isColumnIMatrixOne"

sidl_bool
impl_Ordering_IntOrderTest_isColumnIMatrixOne(
  /* in */ struct sidl_int__array* A)
{
#line 341 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isColumnIMatrixOne) */
  return sidl_int__array_isColumnOrder(A) && isIMatrix(A);
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isColumnIMatrixOne) */
#line 369 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Return <code>true</code> iff the implementation sees
 * an incoming row-major array satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isRowIMatrixOne"

sidl_bool
impl_Ordering_IntOrderTest_isRowIMatrixOne(
  /* in */ struct sidl_int__array* A)
{
#line 358 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isRowIMatrixOne) */
  return sidl_int__array_isRowOrder(A) && isIMatrix(A);
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isRowIMatrixOne) */
#line 388 "Ordering_IntOrderTest_Impl.c"
}

/*
 *  Return <code>true</code> iff the implementation sees
 *  an incoming array satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isIMatrixTwo"

sidl_bool
impl_Ordering_IntOrderTest_isIMatrixTwo(
  /* in */ struct sidl_int__array* A)
{
#line 375 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isIMatrixTwo) */
  return isIMatrix(A);
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isIMatrixTwo) */
#line 407 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Return <code>true</code> iff the implementation sees
 * an incoming column-major array satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isColumnIMatrixTwo"

sidl_bool
impl_Ordering_IntOrderTest_isColumnIMatrixTwo(
  /* in */ struct sidl_int__array* A)
{
#line 392 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isColumnIMatrixTwo) */
  return sidl_int__array_isColumnOrder(A) && isIMatrix(A);
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isColumnIMatrixTwo) */
#line 426 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Return <code>true</code> iff the implementation sees
 * an incoming row-major array satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isRowIMatrixTwo"

sidl_bool
impl_Ordering_IntOrderTest_isRowIMatrixTwo(
  /* in */ struct sidl_int__array* A)
{
#line 409 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isRowIMatrixTwo) */
  return sidl_int__array_isRowOrder(A) && isIMatrix(A);
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isRowIMatrixTwo) */
#line 445 "Ordering_IntOrderTest_Impl.c"
}

/*
 *  Return <code>true</code> iff the implementation sees
 *  an incoming array satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isIMatrixFour"

sidl_bool
impl_Ordering_IntOrderTest_isIMatrixFour(
  /* in */ struct sidl_int__array* A)
{
#line 426 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isIMatrixFour) */
  return isIMatrix(A);
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isIMatrixFour) */
#line 464 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Return <code>true</code> iff the implementation sees
 * an incoming column-major array satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isColumnIMatrixFour"

sidl_bool
impl_Ordering_IntOrderTest_isColumnIMatrixFour(
  /* in */ struct sidl_int__array* A)
{
#line 443 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isColumnIMatrixFour) */
  return sidl_int__array_isColumnOrder(A) && isIMatrix(A);
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isColumnIMatrixFour) */
#line 483 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Return <code>true</code> iff the implementation sees
 * an incoming row-major array satisfying condition I.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isRowIMatrixFour"

sidl_bool
impl_Ordering_IntOrderTest_isRowIMatrixFour(
  /* in */ struct sidl_int__array* A)
{
#line 460 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isRowIMatrixFour) */
  return sidl_int__array_isRowOrder(A) && isIMatrix(A);
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isRowIMatrixFour) */
#line 502 "Ordering_IntOrderTest_Impl.c"
}

/*
 * Return <code>true</code> iff the implementation of slice
 * and smart copy is correct.
 */

#undef __FUNC__
#define __FUNC__ "impl_Ordering_IntOrderTest_isSliceWorking"

sidl_bool
impl_Ordering_IntOrderTest_isSliceWorking(
  /* in */ sidl_bool useCreateCol)
{
#line 477 "../../../../babel/regression/ordering/libC/Ordering_IntOrderTest_Impl.c"
  /* DO-NOT-DELETE splicer.begin(Ordering.IntOrderTest.isSliceWorking) */
  sidl_bool res = TRUE;
  const int32_t maxDim = 16;
  const int32_t halfDim = maxDim >> 1;
  struct sidl_int__array *A=NULL, *B=NULL;
  int32_t ind[2];
  int32_t stride[2] = {2, 2};
  int32_t numElem[2];
  int32_t newIndex[2];
  numElem[0] = numElem[1] = halfDim;
  if (useCreateCol) {
    A = Ordering_IntOrderTest_makeColumnIMatrix(maxDim,FALSE);
  }
  else {
    A = Ordering_IntOrderTest_makeRowIMatrix(maxDim,FALSE);
  }
  B = sidl_int__array_slice(A, 2, numElem, NULL, stride, NULL);
  if (!(B && sidl_int__array_dimen(B) == 2)) {
    res = FALSE;
    goto cleanup;
  }
  for(ind[1] = newIndex[1] = 0; newIndex[1] < halfDim; 
      ++newIndex[1], ind[1] += 2) {
    for(ind[0] = newIndex[0] = 0; newIndex[0] < halfDim;
        ++newIndex[0], ind[0] += 2) {
      if ((sidlArrayElem2(B, newIndex[0], newIndex[1]) != iFunc(ind,2)) ||
          (sidlArrayAddr2(B, newIndex[0], newIndex[1]) !=
           sidlArrayAddr2(A, ind[0], ind[1]))) {
        res = FALSE;
        goto cleanup;
      }
    }
  }

  sidl_int__array_deleteRef(B);
  ind[0] = ind[1] = 1;
  newIndex[0] = newIndex[1] = 0;
  B = sidl_int__array_slice(A, 2, numElem, ind, stride, newIndex);
  if (!(B && sidl_int__array_dimen(B) == 2)) {
    res = FALSE;
    goto cleanup;
  }
  for(newIndex[1] = 0; newIndex[1] < halfDim; 
      ++newIndex[1], ind[1] += 2) {
    for(ind[0] = 1, newIndex[0] = 0; newIndex[0] < halfDim;
        ++newIndex[0], ind[0] += 2) {
      if ((sidlArrayElem2(B, newIndex[0], newIndex[1]) != iFunc(ind,2)) ||
          (sidlArrayAddr2(B, newIndex[0], newIndex[1]) !=
           sidlArrayAddr2(A, ind[0], ind[1]))) {
        res = FALSE;
        goto cleanup;
      }
    }
  }

  sidl_int__array_deleteRef(B);
  ind[0] = ind[1] = 1;
  newIndex[1] = newIndex[0] = 1;
  B = sidl_int__array_slice(A, 2, numElem, ind, stride, newIndex);
  if (!(B && sidl_int__array_dimen(B) == 2)) {
    res = FALSE;
    goto cleanup;
  }
  for(newIndex[1] = 1; newIndex[1] <= halfDim; 
      ++newIndex[1], ind[1] += 2) {
    for(ind[0] = 1, newIndex[0] = 1; newIndex[0] <= halfDim;
        ++newIndex[0], ind[0] += 2) {
      if ((sidlArrayElem2(B, newIndex[0], newIndex[1]) != iFunc(ind,2)) ||
          (sidlArrayAddr2(B, newIndex[0], newIndex[1]) != 
           sidlArrayAddr2(A, ind[0], ind[1]))){
        res = FALSE;
        goto cleanup;
      }
    }
  }

  sidl_int__array_deleteRef(B);
  B = NULL;
  numElem[0] = 0;
  numElem[1] = maxDim;
  B = sidl_int__array_slice(A, 1, numElem, NULL, NULL, NULL);
  if (!(B && sidl_int__array_dimen(B) == 1)) {
    res = FALSE;
    goto cleanup;
  }
  ind[0] = newIndex[0] = 0;
  for(ind[1] = newIndex[1] = 0; newIndex[1] < maxDim; 
      ++newIndex[1], ++ind[1]) {
    if (sidlArrayAddr1(B, newIndex[1]) != 
        sidlArrayAddr2(A, ind[0], ind[1])) {
      res = FALSE;
      goto cleanup;
    }
  }
  
  sidl_int__array_deleteRef(B);
  B = NULL;
  numElem[0] = maxDim;
  numElem[1] = 0;
  ind[0] = 0;
  ind[1] = 8;
  newIndex[0] = newIndex[1] = 0;
  B = sidl_int__array_slice(A, 1, numElem, ind, NULL, newIndex);
  if (!(B && (sidl_int__array_dimen(B) == 1))) {
    res = FALSE;
    goto cleanup;
  }
  for(ind[0] = newIndex[0] = 0; newIndex[0] < maxDim; 
      ++newIndex[0], ++ind[0]) {
    if (sidlArrayAddr1(B, newIndex[0]) != 
        sidlArrayAddr2(A, ind[0], ind[1])) {
      res = FALSE;
      goto cleanup;
    }
  }
  
  sidl_int__array_deleteRef(B);
  B = NULL;
  numElem[0] = maxDim;
  numElem[1] = 0;
  ind[0] = 0;
  ind[1] = 0;
  B = sidl_int__array_slice(A, 1, numElem, ind, NULL, NULL);
  if (!(B && (sidl_int__array_dimen(B) == 1))) {
    res = FALSE;
    goto cleanup;
  }
  if (!(Ordering_IntOrderTest_isIMatrixOne(B) &&
        Ordering_IntOrderTest_isColumnIMatrixOne(B) &&
        Ordering_IntOrderTest_isRowIMatrixOne(B))) {
    res = FALSE;
    goto cleanup;
  }
        
  
 cleanup:
  if (B) sidl_int__array_deleteRef(B);
  if (A) sidl_int__array_deleteRef(A);
  return res;
  /* DO-NOT-DELETE splicer.end(Ordering.IntOrderTest.isSliceWorking) */
#line 658 "Ordering_IntOrderTest_Impl.c"
}