runner_doiact_stars.h 67.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*******************************************************************************
 * This file is part of SWIFT.
 * Copyright (c) 2016 Matthieu Schaller (matthieu.schaller@durham.ac.uk)
 *               2018 Loic Hausammann (loic.hausammann@epfl.ch)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 ******************************************************************************/

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
/* Before including this file, define FUNCTION, which is the
   name of the interaction function. This creates the interaction functions
   runner_dopair_FUNCTION, runner_dopair_FUNCTION_naive, runner_doself_FUNCTION,
   and runner_dosub_FUNCTION calling the pairwise interaction function
   runner_iact_FUNCTION. */


#define PASTE(x, y) x##_##y

#define _DOSELF_STARS(f) PASTE(runner_doself_stars, f)
#define DOSELF_STARS _DOSELF_STARS(FUNCTION)

#define _DO_NONSYM_PAIR_STARS(f) PASTE(runner_do_nonsym_pair_stars, f)
#define DO_NONSYM_PAIR_STARS _DO_NONSYM_PAIR_STARS(FUNCTION)

#define _DOPAIR_STARS(f) PASTE(runner_dopair_stars, f)
#define DOPAIR_STARS _DOPAIR_STARS(FUNCTION)

#define _DOPAIR_SUBSET_STARS(f) PASTE(runner_dopair_subset_stars, f)
#define DOPAIR_SUBSET_STARS _DOPAIR_SUBSET_STARS(FUNCTION)

#define _DOSELF_SUBSET_STARS(f) PASTE(runner_doself_subset_stars, f)
#define DOSELF_SUBSET_STARS _DOSELF_SUBSET_STARS(FUNCTION)

#define _DOSELF_SUBSET_BRANCH_STARS(f) PASTE(runner_doself_subset_branch_stars, f)
#define DOSELF_SUBSET_BRANCH_STARS _DOSELF_SUBSET_BRANCH_STARS(FUNCTION)

#define _DOPAIR_SUBSET_BRANCH_STARS(f) PASTE(runner_dopair_subset_branch_stars, f)
#define DOPAIR_SUBSET_BRANCH_STARS _DOPAIR_SUBSET_BRANCH_STARS(FUNCTION)

#define _DOSUB_SUBSET_STARS(f) PASTE(runner_dosub_subset_stars, f)
#define DOSUB_SUBSET_STARS _DOSUB_SUBSET_STARS(FUNCTION)

#define _DOSELF_BRANCH_STARS(f) PASTE(runner_doself_branch_stars, f)
#define DOSELF_BRANCH_STARS _DOSELF_BRANCH_STARS(FUNCTION)

#define _DOPAIR_BRANCH_STARS(f) PASTE(runner_dopair_branch_stars, f)
#define DOPAIR_BRANCH_STARS _DOPAIR_BRANCH_STARS(FUNCTION)

#define _DOSUB_PAIR_STARS(f) PASTE(runner_dosub_pair_stars, f)
#define DOSUB_PAIR_STARS _DOSUB_PAIR_STARS(FUNCTION)

#define _DOSUB_SELF_STARS(f) PASTE(runner_dosub_self_stars, f)
#define DOSUB_SELF_STARS _DOSUB_SELF_STARS(FUNCTION)

#define _IACT_STARS(f) PASTE(runner_iact_nonsym_stars, f)
#define IACT_STARS _IACT_STARS(FUNCTION)

69
70
71
72
73
74
75
76

/**
 * @brief Calculate the number density of #part around the #spart
 *
 * @param r runner task
 * @param c cell
 * @param timer 1 if the time is to be recorded.
 */
77
void DOSELF_STARS(struct runner *r, struct cell *c, int timer) {
78
79
80
81
  const struct engine *e = r->e;
  const struct cosmology *cosmo = e->cosmology;

  /* Anything to do here? */
Loic Hausammann's avatar
Loic Hausammann committed
82
  if (!cell_is_active_stars(c, e)) return;
Loic Hausammann's avatar
Loic Hausammann committed
83
  if (c->hydro.count == 0 && c->stars.count == 0) return;
84
85
86
87
88

  /* Cosmological terms */
  const float a = cosmo->a;
  const float H = cosmo->H;

89
  const int scount = c->stars.count;
90
  const int count = c->hydro.count;
91
  struct spart *restrict sparts = c->stars.parts;
92
  struct part *restrict parts = c->hydro.parts;
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

  /* Loop over the sparts in ci. */
  for (int sid = 0; sid < scount; sid++) {

    /* Get a hold of the ith spart in ci. */
    struct spart *restrict si = &sparts[sid];
    const float hi = si->h;
    const float hig2 = hi * hi * kernel_gamma2;
    const float six[3] = {(float)(si->x[0] - c->loc[0]),
                          (float)(si->x[1] - c->loc[1]),
                          (float)(si->x[2] - c->loc[2])};

    /* Loop over the parts in cj. */
    for (int pjd = 0; pjd < count; pjd++) {

      /* Get a pointer to the jth particle. */
      struct part *restrict pj = &parts[pjd];
      const float hj = pj->h;

      /* Compute the pairwise distance. */
      const float pjx[3] = {(float)(pj->x[0] - c->loc[0]),
                            (float)(pj->x[1] - c->loc[1]),
                            (float)(pj->x[2] - c->loc[2])};
      float dx[3] = {six[0] - pjx[0], six[1] - pjx[1], six[2] - pjx[2]};
      const float r2 = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2];

#ifdef SWIFT_DEBUG_CHECKS
      /* Check that particles have been drifted to the current time */
      if (pj->ti_drift != e->ti_current)
        error("Particle pj not drifted to current time");
#endif

Loic Hausammann's avatar
Loic Hausammann committed
125
      if (r2 > 0.f && r2 < hig2) {
126
        IACT_STARS(r2, dx, hi, hj, si, pj, a, H);
127
      }
128
129
130
131
132
133
    } /* loop over the parts in ci. */
  }   /* loop over the sparts in ci. */

}

/**
Loic Hausammann's avatar
Loic Hausammann committed
134
 * @brief Calculate the number density of cj #part around the ci #spart
135
136
 *
 * @param r runner task
Matthieu Schaller's avatar
Matthieu Schaller committed
137
138
 * @param ci The first #cell
 * @param cj The second #cell
139
 */
140
141
142
void DO_NONSYM_PAIR_STARS(
    struct runner *r, struct cell *restrict ci,
    struct cell *restrict cj) {
143
144
145
146
147

  const struct engine *e = r->e;
  const struct cosmology *cosmo = e->cosmology;

  /* Anything to do here? */
Loic Hausammann's avatar
Loic Hausammann committed
148
  if (!cell_is_active_stars(ci, e)) return;
149

150
  const int scount_i = ci->stars.count;
151
  const int count_j = cj->hydro.count;
152
  struct spart *restrict sparts_i = ci->stars.parts;
153
  struct part *restrict parts_j = cj->hydro.parts;
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

  /* Cosmological terms */
  const float a = cosmo->a;
  const float H = cosmo->H;

  /* Get the relative distance between the pairs, wrapping. */
  double shift[3] = {0.0, 0.0, 0.0};
  for (int k = 0; k < 3; k++) {
    if (cj->loc[k] - ci->loc[k] < -e->s->dim[k] / 2)
      shift[k] = e->s->dim[k];
    else if (cj->loc[k] - ci->loc[k] > e->s->dim[k] / 2)
      shift[k] = -e->s->dim[k];
  }

  /* Loop over the sparts in ci. */
  for (int sid = 0; sid < scount_i; sid++) {

    /* Get a hold of the ith spart in ci. */
    struct spart *restrict si = &sparts_i[sid];
    const float hi = si->h;
    const float hig2 = hi * hi * kernel_gamma2;
    const float six[3] = {(float)(si->x[0] - (cj->loc[0] + shift[0])),
                          (float)(si->x[1] - (cj->loc[1] + shift[1])),
                          (float)(si->x[2] - (cj->loc[2] + shift[2]))};

    /* Loop over the parts in cj. */
    for (int pjd = 0; pjd < count_j; pjd++) {

      /* Get a pointer to the jth particle. */
      struct part *restrict pj = &parts_j[pjd];
      const float hj = pj->h;

      /* Compute the pairwise distance. */
      const float pjx[3] = {(float)(pj->x[0] - cj->loc[0]),
                            (float)(pj->x[1] - cj->loc[1]),
                            (float)(pj->x[2] - cj->loc[2])};
      float dx[3] = {six[0] - pjx[0], six[1] - pjx[1], six[2] - pjx[2]};
      const float r2 = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2];

#ifdef SWIFT_DEBUG_CHECKS
      /* Check that particles have been drifted to the current time */
      if (pj->ti_drift != e->ti_current)
        error("Particle pj not drifted to current time");
#endif

      if (r2 < hig2)
200
        IACT_STARS(r2, dx, hi, hj, si, pj, a, H);
201
202
203
204
205

    } /* loop over the parts in cj. */
  }   /* loop over the parts in ci. */
}

206
207
void DOPAIR_STARS(struct runner *r, struct cell *restrict ci,
	    struct cell *restrict cj, int timer) {
208

Loic Hausammann's avatar
Loic Hausammann committed
209
  if (ci->stars.count != 0 && cj->hydro.count != 0)
210
    DO_NONSYM_PAIR_STARS(r, ci, cj);
Loic Hausammann's avatar
Loic Hausammann committed
211
  if (cj->stars.count != 0 && ci->hydro.count != 0)
212
    DO_NONSYM_PAIR_STARS(r, cj, ci);
213
214

}
Loic Hausammann's avatar
Loic Hausammann committed
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229

/**
 * @brief Compute the interactions between a cell pair, but only for the
 *      given indices in ci.
 *
 * Version using a brute-force algorithm.
 *
 * @param r The #runner.
 * @param ci The first #cell.
 * @param sparts_i The #part to interact with @c cj.
 * @param ind The list of indices of particles in @c ci to interact with.
 * @param scount The number of particles in @c ind.
 * @param cj The second #cell.
 * @param shift The shift vector to apply to the particles in ci.
 */
230
231
232
233
234
void DOPAIR_SUBSET_STARS(
    struct runner *r, struct cell *restrict ci,
    struct spart *restrict sparts_i, int *restrict ind,
    int scount, struct cell *restrict cj,
    const double *shift) {
Loic Hausammann's avatar
Loic Hausammann committed
235
236
237
238

  const struct engine *e = r->e;
  const struct cosmology *cosmo = e->cosmology;

239
240
  const int count_j = cj->hydro.count;
  struct part *restrict parts_j = cj->hydro.parts;
Loic Hausammann's avatar
Loic Hausammann committed
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

  /* Cosmological terms */
  const float a = cosmo->a;
  const float H = cosmo->H;

  /* Loop over the parts_i. */
  for (int pid = 0; pid < scount; pid++) {

    /* Get a hold of the ith part in ci. */
    struct spart *restrict spi = &sparts_i[ind[pid]];
    double spix[3];
    for (int k = 0; k < 3; k++) spix[k] = spi->x[k] - shift[k];
    const float hi = spi->h;
    const float hig2 = hi * hi * kernel_gamma2;

#ifdef SWIFT_DEBUG_CHECKS
    if (!spart_is_active(spi, e))
      error("Trying to correct smoothing length of inactive particle !");
#endif

    /* Loop over the parts in cj. */
    for (int pjd = 0; pjd < count_j; pjd++) {

      /* Get a pointer to the jth particle. */
      struct part *restrict pj = &parts_j[pjd];

      /* Compute the pairwise distance. */
      float r2 = 0.0f;
      float dx[3];
      for (int k = 0; k < 3; k++) {
        dx[k] = spix[k] - pj->x[k];
        r2 += dx[k] * dx[k];
      }

#ifdef SWIFT_DEBUG_CHECKS
      /* Check that particles have been drifted to the current time */
      if (pj->ti_drift != e->ti_current)
        error("Particle pj not drifted to current time");
#endif
      /* Hit or miss? */
      if (r2 < hig2) {
282
        IACT_STARS(r2, dx, hi, pj->h, spi, pj, a, H);
Loic Hausammann's avatar
Loic Hausammann committed
283
284
285
286
287
      }
    } /* loop over the parts in cj. */
  }   /* loop over the parts in ci. */

}
Loic Hausammann's avatar
Loic Hausammann committed
288
289
290
291
292
293
294
295
296
297
298

/**
 * @brief Compute the interactions between a cell pair, but only for the
 *      given indices in ci.
 *
 * @param r The #runner.
 * @param ci The first #cell.
 * @param sparts The #spart to interact.
 * @param ind The list of indices of particles in @c ci to interact with.
 * @param scount The number of particles in @c ind.
 */
299
300
301
void DOSELF_SUBSET_STARS(struct runner *r, struct cell *restrict ci,
		   struct spart *restrict sparts,
		   int *restrict ind, int scount) {
Loic Hausammann's avatar
Loic Hausammann committed
302
303
304
305
306
307
308
309

  const struct engine *e = r->e;
  const struct cosmology *cosmo = e->cosmology;

  /* Cosmological terms */
  const float a = cosmo->a;
  const float H = cosmo->H;

310
311
  const int count_i = ci->hydro.count;
  struct part *restrict parts_j = ci->hydro.parts;
Loic Hausammann's avatar
Loic Hausammann committed
312
313
314
315
316
317
318

  /* Loop over the parts in ci. */
  for (int spid = 0; spid < scount; spid++) {

    /* Get a hold of the ith part in ci. */
    struct spart *spi = &sparts[ind[spid]];
    const float spix[3] = {(float)(spi->x[0] - ci->loc[0]),
319
320
                           (float)(spi->x[1] - ci->loc[1]),
                           (float)(spi->x[2] - ci->loc[2])};
Loic Hausammann's avatar
Loic Hausammann committed
321
322
323
324
    const float hi = spi->h;
    const float hig2 = hi * hi * kernel_gamma2;

#ifdef SWIFT_DEBUG_CHECKS
325
326
    if (!spart_is_active(spi, e))
      error("Inactive particle in subset function!");
Loic Hausammann's avatar
Loic Hausammann committed
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
#endif

    /* Loop over the parts in cj. */
    for (int pjd = 0; pjd < count_i; pjd++) {

      /* Get a pointer to the jth particle. */
      struct part *restrict pj = &parts_j[pjd];
      const float hj = pj->h;

      /* Compute the pairwise distance. */
      const float pjx[3] = {(float)(pj->x[0] - ci->loc[0]),
                            (float)(pj->x[1] - ci->loc[1]),
                            (float)(pj->x[2] - ci->loc[2])};
      float dx[3] = {spix[0] - pjx[0], spix[1] - pjx[1], spix[2] - pjx[2]};
      const float r2 = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2];

#ifdef SWIFT_DEBUG_CHECKS
      /* Check that particles have been drifted to the current time */
      if (pj->ti_drift != e->ti_current)
        error("Particle pj not drifted to current time");
#endif

      /* Hit or miss? */
      if (r2 > 0.f && r2 < hig2) {
351
        IACT_STARS(r2, dx, hi, hj, spi, pj, a, H);
Loic Hausammann's avatar
Loic Hausammann committed
352
353
354
355
356
357
      }
    } /* loop over the parts in cj. */
  }   /* loop over the parts in ci. */

}

358
/**
359
360
361
* @brief Determine which version of DOSELF_SUBSET_STARS needs to be called
* depending on the optimisation level.
*
362
363
* @param r The #runner.
* @param ci The first #cell.
Matthieu Schaller's avatar
Matthieu Schaller committed
364
* @param sparts The #spart to interact.
365
366
367
* @param ind The list of indices of particles in @c ci to interact with.
* @param scount The number of particles in @c ind.
*/
368
369
370
void DOSELF_SUBSET_BRANCH_STARS(
    struct runner *r, struct cell *restrict ci,
    struct spart *restrict sparts, int *restrict ind, int scount) {
Loic Hausammann's avatar
Loic Hausammann committed
371

372
  DOSELF_SUBSET_STARS(r, ci, sparts, ind, scount);
Loic Hausammann's avatar
Loic Hausammann committed
373
374
}

375
/**
376
 * @brief Determine which version of DOPAIR_SUBSET_STARS needs to be called depending
Loic Hausammann's avatar
Loic Hausammann committed
377
 * on the
378
 * orientation of the cells or whether DOPAIR_SUBSET_STARS needs to be called at all.
Loic Hausammann's avatar
Loic Hausammann committed
379
380
381
382
383
384
385
386
 *
 * @param r The #runner.
 * @param ci The first #cell.
 * @param sparts_i The #spart to interact with @c cj.
 * @param ind The list of indices of particles in @c ci to interact with.
 * @param scount The number of particles in @c ind.
 * @param cj The second #cell.
 */
387
388
389
390
void DOPAIR_SUBSET_BRANCH_STARS(
    struct runner *r, struct cell *restrict ci,
    struct spart *restrict sparts_i, int *restrict ind,
    int scount, struct cell *restrict cj) {
Loic Hausammann's avatar
Loic Hausammann committed
391
392
393
394
395
396
397
398
399
400
401
402

  const struct engine *e = r->e;

  /* Get the relative distance between the pairs, wrapping. */
  double shift[3] = {0.0, 0.0, 0.0};
  for (int k = 0; k < 3; k++) {
    if (cj->loc[k] - ci->loc[k] < -e->s->dim[k] / 2)
      shift[k] = e->s->dim[k];
    else if (cj->loc[k] - ci->loc[k] > e->s->dim[k] / 2)
      shift[k] = -e->s->dim[k];
  }

403
  DOPAIR_SUBSET_STARS(r, ci, sparts_i, ind, scount, cj, shift);
Loic Hausammann's avatar
Loic Hausammann committed
404
405
}

406
407
408
409
void DOSUB_SUBSET_STARS(struct runner *r, struct cell *ci,
		  struct spart *sparts, int *ind,
		  int scount, struct cell *cj, int sid,
		  int gettimer) {
Loic Hausammann's avatar
Loic Hausammann committed
410
411
412
413
414

  const struct engine *e = r->e;
  struct space *s = e->s;

  /* Should we even bother? */
Loic Hausammann's avatar
Loic Hausammann committed
415
416
  if (!cell_is_active_stars(ci, e) &&
      (cj == NULL || !cell_is_active_stars(cj, e)))
Loic Hausammann's avatar
Loic Hausammann committed
417
418
419
420
421
422
423
    return;

  /* Find out in which sub-cell of ci the parts are. */
  struct cell *sub = NULL;
  if (ci->split) {
    for (int k = 0; k < 8; k++) {
      if (ci->progeny[k] != NULL) {
424
425
426
        if (&sparts[ind[0]] >= &ci->progeny[k]->stars.parts[0] &&
            &sparts[ind[0]] <
                &ci->progeny[k]->stars.parts[ci->progeny[k]->stars.count]) {
Loic Hausammann's avatar
Loic Hausammann committed
427
428
429
430
431
432
433
434
435
436
437
          sub = ci->progeny[k];
          break;
        }
      }
    }
  }

  /* Is this a single cell? */
  if (cj == NULL) {

    /* Recurse? */
438
    if (cell_can_recurse_in_self_stars_task(ci)) {
Loic Hausammann's avatar
Loic Hausammann committed
439
440

      /* Loop over all progeny. */
441
      DOSUB_SUBSET_STARS(r, sub, sparts, ind, scount, NULL, -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
442
443
      for (int j = 0; j < 8; j++)
        if (ci->progeny[j] != sub && ci->progeny[j] != NULL)
444
           DOSUB_SUBSET_STARS(r, sub, sparts, ind, scount,
445
                                            ci->progeny[j], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
446
447
448
449
450

    }

    /* Otherwise, compute self-interaction. */
    else
451
      DOSELF_SUBSET_BRANCH_STARS(r, ci, sparts, ind, scount);
Loic Hausammann's avatar
Loic Hausammann committed
452
453
454
455
456
457
  } /* self-interaction. */

  /* Otherwise, it's a pair interaction. */
  else {

    /* Recurse? */
458
459
    if (cell_can_recurse_in_pair_stars_task(ci) &&
        cell_can_recurse_in_pair_stars_task(cj)) {
Loic Hausammann's avatar
Loic Hausammann committed
460
461
462
463
464
465
466
467
468
469
470

      /* Get the type of pair if not specified explicitly. */
      double shift[3] = {0.0, 0.0, 0.0};
      sid = space_getsid(s, &ci, &cj, shift);

      /* Different types of flags. */
      switch (sid) {

        /* Regular sub-cell interactions of a single cell. */
        case 0: /* (  1 ,  1 ,  1 ) */
          if (ci->progeny[7] == sub && cj->progeny[0] != NULL)
471
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
472
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
473
          if (ci->progeny[7] != NULL && cj->progeny[0] == sub)
474
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
475
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
476
477
478
479
          break;

        case 1: /* (  1 ,  1 ,  0 ) */
          if (ci->progeny[6] == sub && cj->progeny[0] != NULL)
480
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
481
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
482
          if (ci->progeny[6] != NULL && cj->progeny[0] == sub)
483
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
484
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
485
          if (ci->progeny[6] == sub && cj->progeny[1] != NULL)
486
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
487
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
488
          if (ci->progeny[6] != NULL && cj->progeny[1] == sub)
489
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
490
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
491
          if (ci->progeny[7] == sub && cj->progeny[0] != NULL)
492
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
493
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
494
          if (ci->progeny[7] != NULL && cj->progeny[0] == sub)
495
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
496
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
497
          if (ci->progeny[7] == sub && cj->progeny[1] != NULL)
498
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
499
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
500
          if (ci->progeny[7] != NULL && cj->progeny[1] == sub)
501
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
502
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
503
504
505
506
          break;

        case 2: /* (  1 ,  1 , -1 ) */
          if (ci->progeny[6] == sub && cj->progeny[1] != NULL)
507
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
508
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
509
          if (ci->progeny[6] != NULL && cj->progeny[1] == sub)
510
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
511
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
512
513
514
515
          break;

        case 3: /* (  1 ,  0 ,  1 ) */
          if (ci->progeny[5] == sub && cj->progeny[0] != NULL)
516
            DOSUB_SUBSET_STARS(r, ci->progeny[5], sparts, ind,
517
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
518
          if (ci->progeny[5] != NULL && cj->progeny[0] == sub)
519
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
520
                                              scount, ci->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
521
          if (ci->progeny[5] == sub && cj->progeny[2] != NULL)
522
            DOSUB_SUBSET_STARS(r, ci->progeny[5], sparts, ind,
523
                                              scount, cj->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
524
          if (ci->progeny[5] != NULL && cj->progeny[2] == sub)
525
            DOSUB_SUBSET_STARS(r, cj->progeny[2], sparts, ind,
526
                                              scount, ci->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
527
          if (ci->progeny[7] == sub && cj->progeny[0] != NULL)
528
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
529
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
530
          if (ci->progeny[7] != NULL && cj->progeny[0] == sub)
531
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
532
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
533
          if (ci->progeny[7] == sub && cj->progeny[2] != NULL)
534
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
535
                                              scount, cj->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
536
          if (ci->progeny[7] != NULL && cj->progeny[2] == sub)
537
            DOSUB_SUBSET_STARS(r, cj->progeny[2], sparts, ind,
538
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
539
540
541
542
          break;

        case 4: /* (  1 ,  0 ,  0 ) */
          if (ci->progeny[4] == sub && cj->progeny[0] != NULL)
543
            DOSUB_SUBSET_STARS(r, ci->progeny[4], sparts, ind,
544
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
545
          if (ci->progeny[4] != NULL && cj->progeny[0] == sub)
546
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
547
                                              scount, ci->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
548
          if (ci->progeny[4] == sub && cj->progeny[1] != NULL)
549
            DOSUB_SUBSET_STARS(r, ci->progeny[4], sparts, ind,
550
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
551
          if (ci->progeny[4] != NULL && cj->progeny[1] == sub)
552
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
553
                                              scount, ci->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
554
          if (ci->progeny[4] == sub && cj->progeny[2] != NULL)
555
            DOSUB_SUBSET_STARS(r, ci->progeny[4], sparts, ind,
556
                                              scount, cj->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
557
          if (ci->progeny[4] != NULL && cj->progeny[2] == sub)
558
            DOSUB_SUBSET_STARS(r, cj->progeny[2], sparts, ind,
559
                                              scount, ci->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
560
          if (ci->progeny[4] == sub && cj->progeny[3] != NULL)
561
            DOSUB_SUBSET_STARS(r, ci->progeny[4], sparts, ind,
562
                                              scount, cj->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
563
          if (ci->progeny[4] != NULL && cj->progeny[3] == sub)
564
            DOSUB_SUBSET_STARS(r, cj->progeny[3], sparts, ind,
565
                                              scount, ci->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
566
          if (ci->progeny[5] == sub && cj->progeny[0] != NULL)
567
            DOSUB_SUBSET_STARS(r, ci->progeny[5], sparts, ind,
568
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
569
          if (ci->progeny[5] != NULL && cj->progeny[0] == sub)
570
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
571
                                              scount, ci->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
572
          if (ci->progeny[5] == sub && cj->progeny[1] != NULL)
573
            DOSUB_SUBSET_STARS(r, ci->progeny[5], sparts, ind,
574
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
575
          if (ci->progeny[5] != NULL && cj->progeny[1] == sub)
576
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
577
                                              scount, ci->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
578
          if (ci->progeny[5] == sub && cj->progeny[2] != NULL)
579
            DOSUB_SUBSET_STARS(r, ci->progeny[5], sparts, ind,
580
                                              scount, cj->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
581
          if (ci->progeny[5] != NULL && cj->progeny[2] == sub)
582
            DOSUB_SUBSET_STARS(r, cj->progeny[2], sparts, ind,
583
                                              scount, ci->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
584
          if (ci->progeny[5] == sub && cj->progeny[3] != NULL)
585
            DOSUB_SUBSET_STARS(r, ci->progeny[5], sparts, ind,
586
                                              scount, cj->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
587
          if (ci->progeny[5] != NULL && cj->progeny[3] == sub)
588
            DOSUB_SUBSET_STARS(r, cj->progeny[3], sparts, ind,
589
                                              scount, ci->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
590
          if (ci->progeny[6] == sub && cj->progeny[0] != NULL)
591
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
592
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
593
          if (ci->progeny[6] != NULL && cj->progeny[0] == sub)
594
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
595
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
596
          if (ci->progeny[6] == sub && cj->progeny[1] != NULL)
597
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
598
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
599
          if (ci->progeny[6] != NULL && cj->progeny[1] == sub)
600
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
601
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
602
          if (ci->progeny[6] == sub && cj->progeny[2] != NULL)
603
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
604
                                              scount, cj->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
605
          if (ci->progeny[6] != NULL && cj->progeny[2] == sub)
606
            DOSUB_SUBSET_STARS(r, cj->progeny[2], sparts, ind,
607
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
608
          if (ci->progeny[6] == sub && cj->progeny[3] != NULL)
609
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
610
                                              scount, cj->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
611
          if (ci->progeny[6] != NULL && cj->progeny[3] == sub)
612
            DOSUB_SUBSET_STARS(r, cj->progeny[3], sparts, ind,
613
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
614
          if (ci->progeny[7] == sub && cj->progeny[0] != NULL)
615
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
616
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
617
          if (ci->progeny[7] != NULL && cj->progeny[0] == sub)
618
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
619
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
620
          if (ci->progeny[7] == sub && cj->progeny[1] != NULL)
621
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
622
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
623
          if (ci->progeny[7] != NULL && cj->progeny[1] == sub)
624
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
625
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
626
          if (ci->progeny[7] == sub && cj->progeny[2] != NULL)
627
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
628
                                              scount, cj->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
629
          if (ci->progeny[7] != NULL && cj->progeny[2] == sub)
630
            DOSUB_SUBSET_STARS(r, cj->progeny[2], sparts, ind,
631
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
632
          if (ci->progeny[7] == sub && cj->progeny[3] != NULL)
633
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
634
                                              scount, cj->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
635
          if (ci->progeny[7] != NULL && cj->progeny[3] == sub)
636
            DOSUB_SUBSET_STARS(r, cj->progeny[3], sparts, ind,
637
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
638
639
640
641
          break;

        case 5: /* (  1 ,  0 , -1 ) */
          if (ci->progeny[4] == sub && cj->progeny[1] != NULL)
642
            DOSUB_SUBSET_STARS(r, ci->progeny[4], sparts, ind,
643
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
644
          if (ci->progeny[4] != NULL && cj->progeny[1] == sub)
645
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
646
                                              scount, ci->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
647
          if (ci->progeny[4] == sub && cj->progeny[3] != NULL)
648
            DOSUB_SUBSET_STARS(r, ci->progeny[4], sparts, ind,
649
                                              scount, cj->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
650
          if (ci->progeny[4] != NULL && cj->progeny[3] == sub)
651
            DOSUB_SUBSET_STARS(r, cj->progeny[3], sparts, ind,
652
                                              scount, ci->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
653
          if (ci->progeny[6] == sub && cj->progeny[1] != NULL)
654
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
655
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
656
          if (ci->progeny[6] != NULL && cj->progeny[1] == sub)
657
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
658
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
659
          if (ci->progeny[6] == sub && cj->progeny[3] != NULL)
660
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
661
                                              scount, cj->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
662
          if (ci->progeny[6] != NULL && cj->progeny[3] == sub)
663
            DOSUB_SUBSET_STARS(r, cj->progeny[3], sparts, ind,
664
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
665
666
667
668
          break;

        case 6: /* (  1 , -1 ,  1 ) */
          if (ci->progeny[5] == sub && cj->progeny[2] != NULL)
669
            DOSUB_SUBSET_STARS(r, ci->progeny[5], sparts, ind,
670
                                              scount, cj->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
671
          if (ci->progeny[5] != NULL && cj->progeny[2] == sub)
672
            DOSUB_SUBSET_STARS(r, cj->progeny[2], sparts, ind,
673
                                              scount, ci->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
674
675
676
677
          break;

        case 7: /* (  1 , -1 ,  0 ) */
          if (ci->progeny[4] == sub && cj->progeny[2] != NULL)
678
            DOSUB_SUBSET_STARS(r, ci->progeny[4], sparts, ind,
679
                                              scount, cj->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
680
          if (ci->progeny[4] != NULL && cj->progeny[2] == sub)
681
            DOSUB_SUBSET_STARS(r, cj->progeny[2], sparts, ind,
682
                                              scount, ci->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
683
          if (ci->progeny[4] == sub && cj->progeny[3] != NULL)
684
            DOSUB_SUBSET_STARS(r, ci->progeny[4], sparts, ind,
685
                                              scount, cj->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
686
          if (ci->progeny[4] != NULL && cj->progeny[3] == sub)
687
            DOSUB_SUBSET_STARS(r, cj->progeny[3], sparts, ind,
688
                                              scount, ci->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
689
          if (ci->progeny[5] == sub && cj->progeny[2] != NULL)
690
            DOSUB_SUBSET_STARS(r, ci->progeny[5], sparts, ind,
691
                                              scount, cj->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
692
          if (ci->progeny[5] != NULL && cj->progeny[2] == sub)
693
            DOSUB_SUBSET_STARS(r, cj->progeny[2], sparts, ind,
694
                                              scount, ci->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
695
          if (ci->progeny[5] == sub && cj->progeny[3] != NULL)
696
            DOSUB_SUBSET_STARS(r, ci->progeny[5], sparts, ind,
697
                                              scount, cj->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
698
          if (ci->progeny[5] != NULL && cj->progeny[3] == sub)
699
            DOSUB_SUBSET_STARS(r, cj->progeny[3], sparts, ind,
700
                                              scount, ci->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
701
702
703
704
          break;

        case 8: /* (  1 , -1 , -1 ) */
          if (ci->progeny[4] == sub && cj->progeny[3] != NULL)
705
            DOSUB_SUBSET_STARS(r, ci->progeny[4], sparts, ind,
706
                                              scount, cj->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
707
          if (ci->progeny[4] != NULL && cj->progeny[3] == sub)
708
            DOSUB_SUBSET_STARS(r, cj->progeny[3], sparts, ind,
709
                                              scount, ci->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
710
711
712
713
          break;

        case 9: /* (  0 ,  1 ,  1 ) */
          if (ci->progeny[3] == sub && cj->progeny[0] != NULL)
714
            DOSUB_SUBSET_STARS(r, ci->progeny[3], sparts, ind,
715
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
716
          if (ci->progeny[3] != NULL && cj->progeny[0] == sub)
717
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
718
                                              scount, ci->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
719
          if (ci->progeny[3] == sub && cj->progeny[4] != NULL)
720
            DOSUB_SUBSET_STARS(r, ci->progeny[3], sparts, ind,
721
                                              scount, cj->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
722
          if (ci->progeny[3] != NULL && cj->progeny[4] == sub)
723
            DOSUB_SUBSET_STARS(r, cj->progeny[4], sparts, ind,
724
                                              scount, ci->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
725
          if (ci->progeny[7] == sub && cj->progeny[0] != NULL)
726
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
727
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
728
          if (ci->progeny[7] != NULL && cj->progeny[0] == sub)
729
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
730
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
731
          if (ci->progeny[7] == sub && cj->progeny[4] != NULL)
732
            DOSUB_SUBSET_STARS(r, ci->progeny[7], sparts, ind,
733
                                              scount, cj->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
734
          if (ci->progeny[7] != NULL && cj->progeny[4] == sub)
735
            DOSUB_SUBSET_STARS(r, cj->progeny[4], sparts, ind,
736
                                              scount, ci->progeny[7], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
737
738
739
740
          break;

        case 10: /* (  0 ,  1 ,  0 ) */
          if (ci->progeny[2] == sub && cj->progeny[0] != NULL)
741
            DOSUB_SUBSET_STARS(r, ci->progeny[2], sparts, ind,
742
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
743
          if (ci->progeny[2] != NULL && cj->progeny[0] == sub)
744
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
745
                                              scount, ci->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
746
          if (ci->progeny[2] == sub && cj->progeny[1] != NULL)
747
            DOSUB_SUBSET_STARS(r, ci->progeny[2], sparts, ind,
748
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
749
          if (ci->progeny[2] != NULL && cj->progeny[1] == sub)
750
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
751
                                              scount, ci->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
752
          if (ci->progeny[2] == sub && cj->progeny[4] != NULL)
753
            DOSUB_SUBSET_STARS(r, ci->progeny[2], sparts, ind,
754
                                              scount, cj->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
755
          if (ci->progeny[2] != NULL && cj->progeny[4] == sub)
756
            DOSUB_SUBSET_STARS(r, cj->progeny[4], sparts, ind,
757
                                              scount, ci->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
758
          if (ci->progeny[2] == sub && cj->progeny[5] != NULL)
759
            DOSUB_SUBSET_STARS(r, ci->progeny[2], sparts, ind,
760
                                              scount, cj->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
761
          if (ci->progeny[2] != NULL && cj->progeny[5] == sub)
762
            DOSUB_SUBSET_STARS(r, cj->progeny[5], sparts, ind,
763
                                              scount, ci->progeny[2], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
764
          if (ci->progeny[3] == sub && cj->progeny[0] != NULL)
765
            DOSUB_SUBSET_STARS(r, ci->progeny[3], sparts, ind,
766
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
767
          if (ci->progeny[3] != NULL && cj->progeny[0] == sub)
768
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
769
                                              scount, ci->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
770
          if (ci->progeny[3] == sub && cj->progeny[1] != NULL)
771
            DOSUB_SUBSET_STARS(r, ci->progeny[3], sparts, ind,
772
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
773
          if (ci->progeny[3] != NULL && cj->progeny[1] == sub)
774
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
775
                                              scount, ci->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
776
          if (ci->progeny[3] == sub && cj->progeny[4] != NULL)
777
            DOSUB_SUBSET_STARS(r, ci->progeny[3], sparts, ind,
778
                                              scount, cj->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
779
          if (ci->progeny[3] != NULL && cj->progeny[4] == sub)
780
            DOSUB_SUBSET_STARS(r, cj->progeny[4], sparts, ind,
781
                                              scount, ci->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
782
          if (ci->progeny[3] == sub && cj->progeny[5] != NULL)
783
            DOSUB_SUBSET_STARS(r, ci->progeny[3], sparts, ind,
784
                                              scount, cj->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
785
          if (ci->progeny[3] != NULL && cj->progeny[5] == sub)
786
            DOSUB_SUBSET_STARS(r, cj->progeny[5], sparts, ind,
787
                                              scount, ci->progeny[3], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
788
          if (ci->progeny[6] == sub && cj->progeny[0] != NULL)
789
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
790
                                              scount, cj->progeny[0], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
791
          if (ci->progeny[6] != NULL && cj->progeny[0] == sub)
792
            DOSUB_SUBSET_STARS(r, cj->progeny[0], sparts, ind,
793
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
794
          if (ci->progeny[6] == sub && cj->progeny[1] != NULL)
795
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
796
                                              scount, cj->progeny[1], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
797
          if (ci->progeny[6] != NULL && cj->progeny[1] == sub)
798
            DOSUB_SUBSET_STARS(r, cj->progeny[1], sparts, ind,
799
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
800
          if (ci->progeny[6] == sub && cj->progeny[4] != NULL)
801
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
802
                                              scount, cj->progeny[4], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
803
          if (ci->progeny[6] != NULL && cj->progeny[4] == sub)
804
            DOSUB_SUBSET_STARS(r, cj->progeny[4], sparts, ind,
805
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
806
          if (ci->progeny[6] == sub && cj->progeny[5] != NULL)
807
            DOSUB_SUBSET_STARS(r, ci->progeny[6], sparts, ind,
808
                                              scount, cj->progeny[5], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
809
          if (ci->progeny[6] != NULL && cj->progeny[5] == sub)
810
            DOSUB_SUBSET_STARS(r, cj->progeny[5], sparts, ind,
811
                                              scount, ci->progeny[6], -1, 0);
Loic Hausammann's avatar
Loic Hausammann committed
812
          if (ci->progeny[7] == sub && cj->progeny[0] != NULL)