Code coverage tests

This page documents the degree to which the PARI/GP source code is tested by our public test suite, distributed with the source distribution in directory src/test/. This is measured by the gcov utility; we then process gcov output using the lcov frond-end.

We test a few variants depending on Configure flags on the pari.math.u-bordeaux.fr machine (x86_64 architecture), and agregate them in the final report:

The target is to exceed 90% coverage for all mathematical modules (given that branches depending on DEBUGLEVEL or DEBUGMEM are not covered). This script is run to produce the results below.

LCOV - code coverage report
Current view: top level - modules - groupid.c (source / functions) Hit Total Coverage
Test: PARI/GP v2.16.2 lcov report (development 29451-c474da952c) Lines: 189 221 85.5 %
Date: 2024-07-16 09:03:37 Functions: 7 8 87.5 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Copyright (C) 2003  The PARI group.
       2             : 
       3             : This file is part of the PARI/GP package.
       4             : 
       5             : PARI/GP is free software; you can redistribute it and/or modify it under the
       6             : terms of the GNU General Public License as published by the Free Software
       7             : Foundation; either version 2 of the License, or (at your option) any later
       8             : version. It is distributed in the hope that it will be useful, but WITHOUT
       9             : ANY WARRANTY WHATSOEVER.
      10             : 
      11             : Check the License for details. You should have received a copy of it, along
      12             : with the package; see the file 'COPYING'. If not, write to the Free Software
      13             : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
      14             : 
      15             : #include "pari.h"
      16             : #include "paripriv.h"
      17             : 
      18             : static long
      19        1974 : groupelts_sumorders(GEN S)
      20             : {
      21        1974 :   long i, s = 0;
      22       44030 :   for(i=1; i < lg(S); i++) s += perm_orderu(gel(S,i));
      23        1974 :   return s;
      24             : }
      25             : 
      26             : static long
      27         700 : vecgroup_sumorders(GEN L)
      28             : {
      29         700 :   long i, s = 0;
      30       32501 :   for (i=1; i<lg(L); i++)
      31             :   {
      32       31801 :     GEN G = gel(L,i);
      33       31801 :     s += (lg(G)==3 && typ(gel(G,1))==t_VEC) ? group_order(G): lg(G)-1;
      34             :   }
      35         700 :   return s;
      36             : }
      37             : 
      38             : static int
      39          14 : indexgroupsubgroup(GEN L, long order, const long *good, const long *bad)
      40             : {
      41             :   long i;
      42         826 :   for(i=1; i<lg(L); i++)
      43             :   {
      44         812 :     GEN G=gel(L,i);
      45             :     long idx;
      46             :     const long *p;
      47         812 :     if (group_order(G)!=order) continue;
      48         210 :     idx = group_ident(G,NULL);
      49         420 :     for(p=good; *p; p++)
      50         210 :       if (*p==idx) return 1;
      51         210 :     for(p=bad; *p; p++)
      52           0 :       if (*p==idx) return 0;
      53             :   }
      54          14 :   return 0;
      55             : }
      56             : 
      57             : static int
      58         133 : indexgroupcentre(GEN G, GEN Z, const long *good, const long *bad)
      59             : {
      60             :   long i;
      61         357 :   for(i=1;i<lg(Z);i++)
      62             :   {
      63         357 :     GEN z=gel(Z,i);
      64         357 :     if (perm_orderu(z)==2)
      65             :     {
      66         182 :       pari_sp btop=avma;
      67         182 :       GEN H = cyclicgroup(z,2);
      68         182 :       GEN C = group_quotient(G,H);
      69         182 :       GEN Q = quotient_group(C,G);
      70             :       const long *p;
      71         182 :       long idx=group_ident(Q,NULL);
      72         182 :       set_avma(btop);
      73         413 :       for(p=good;*p;p++)
      74         252 :         if (*p==idx) return 1;
      75         259 :       for(p=bad;*p;p++)
      76         210 :         if (*p==idx) return 0;
      77             :     }
      78             :   }
      79           0 :   return 0;
      80             : }
      81             : 
      82             : static GEN
      83          91 : vecgroup_idxlist(GEN L, long order)
      84             : {
      85          91 :   pari_sp av = avma;
      86          91 :   long i, j, l = lg(L);
      87          91 :   GEN V = cgetg(l, t_VECSMALL);
      88        8001 :   for (i = j = 1; i < l; i++)
      89        7910 :     if (group_order(gel(L,i)) == order) V[j++] = group_ident(gel(L,i),NULL);
      90          91 :   setlg(V, j); return gerepileuptoleaf(av, vecsmall_uniq(V));
      91             : }
      92             : 
      93             : /* Group identification code.
      94             :  * The group data are taken from GAP 4 and the SMALL GROUPS LIBRARY by  Hans
      95             :  * Ulrich Besche, Bettina Eick and Eamonn O'Brien.
      96             :  */
      97             : 
      98             : static long
      99        1274 : group_ident_i(GEN G, GEN S)
     100             : {
     101        1274 :   long n = S? lg(S)-1: group_order(G);
     102             :   long s;
     103             :   GEN F,p,e;
     104        1274 :   if (n==1) return 1;
     105        1274 :   if (!S) S = group_elts(G,group_domain(G));
     106        1274 :   s = groupelts_sumorders(S);/*This is used as a hash value*/
     107        1274 :   F = factoru(n);
     108        1274 :   p = gel(F,1);
     109        1274 :   e = gel(F,2);
     110        1274 :   switch(lg(p)-1)
     111             :   {
     112         980 :   case 1:/*prime power*/
     113         980 :     switch (e[1])
     114             :     {
     115          98 :     case 1: /* p */
     116          98 :       return 1;
     117          35 :     case 2: /* p^2 */
     118          35 :       return (s == 1 - p[1] + n*p[1])? 2: 1; /* pxp || p^2 */
     119         231 :     case 3: /* p^3 */
     120             :       {
     121         231 :         GEN H = group_abelianSNF(G, S);
     122         231 :         if (H) /*G is abelian*/
     123             :         {
     124         161 :           long l = lg(H)-1;
     125         161 :           return (l==3)?5: l; /*pxpxp || p^3 or p^2xp*/
     126             :         } /*G is not abelian*/
     127          70 :         if (p[1] == 2)
     128          63 :           return (s == 19)? 3: 4; /*D8 || Q8*/
     129             :         else
     130             :         {
     131           7 :           long q = p[1]*p[1];
     132           7 :           q *= q;
     133           7 :           return (s == q - p[1] + 1)?3 :4; /* pxp:p || p^2:p */
     134             :         }
     135             :       }
     136             :     }
     137         616 :     break;
     138         273 :   case 2:
     139         273 :     switch(e[1]+e[2])
     140             :     {
     141          49 :     case 2: /*pq*/
     142          49 :       return (p[2]%p[1]!=1)?1:1+group_isabelian(G); /*pq || pq or p:q*/
     143          77 :     case 3:
     144          77 :       if (p[1]==2 && e[1]==2) /* 4p */
     145             :       {
     146          63 :         long q = p[2], q2 = q*q, pmq2 = (q%4 == 1 || q==3);
     147          63 :         if (s==3+5*q+3*q2) return 1; /* 2p.2 */
     148          63 :         if (s==11-11*q+11*q2) return 2; /* 4p */
     149          63 :         if (s==3+q+3*q2) return 3+pmq2; /* D4p */
     150          63 :         if (s==7-7*q+7*q2) return 4+pmq2; /* 2px2 */
     151          63 :         return 3; /*A4 or p:4 */
     152             :       }
     153          14 :       else if (p[1]==2 && e[1]==1) /*2p^2*/
     154             :       {
     155           7 :         long q = p[2], q2 = q*q, q3 = q*q2, q4 = q*q3;
     156           7 :         if (s==1-q+3*q2-q3+q4) return 1; /* p^2:2 */
     157           7 :         if (s==3-3*q+3*q2-3*q3+3*q4) return 2; /* 2p^2 */
     158           7 :         if (s==1+q-2*q2+3*q3) return 3; /* D2pxp */
     159           7 :         if (s==1-q+2*q2+q3) return 4; /* p:2+p:2 */
     160           7 :         return 5;   /* 2pxp */
     161             :       }
     162           7 :       else if (p[1]==3 && e[1]==2) /*9p, p>3*/
     163             :       {
     164           7 :         long q= p[2], q2 = q*q, p3 = (q%3 == 1), p9 = (q%9 == 1);
     165           7 :         if (s==7+47*q+7*q2) return 1; /* 3p.3 */
     166           7 :         if (s==61-61*q+61*q2) return 1+p3; /* 9p */
     167           7 :         if (s==1+59*q+q2) return 3; /* p:9 */
     168           7 :         if (s==7+11*q+7*q2) return 3+p9; /* p:3x3 */
     169           7 :         return 2+2*p3+p9; /* 3^2xp */
     170             :       }
     171           0 :       break;
     172             :     }
     173             :   case 3:
     174         168 :     switch(e[1]+e[2]+e[3])
     175             :     {
     176          14 :     case 3: /*pqr*/
     177          14 :       if (p[1]==2)  /*2qr*/
     178             :       {
     179          14 :         long q = p[2],q2 = q*q, qc = 1-q+q2, qd = 1+q+q2;
     180          14 :         long r = p[3],r2 = r*r, rc = 1-r+r2, rd = 1+r+r2;
     181          14 :         long pmq = (r%q==1)? 2: 0;
     182          14 :         if (pmq && s==3*r*(q2-q)+rd) return 1; /* r:2q */
     183          14 :         if (pmq && s==3*(r2+(q2-q-1)*r+1)) return 2; /* r:qx2 */
     184           7 :         if (s==qd*rc) return 1+pmq; /* D2qxr */
     185           7 :         if (s==rd*qc) return 2+pmq; /* D2rxq */
     186           7 :         if (s==3*qc*rc) return 4+pmq; /* 2qr */
     187           0 :         return 3+pmq; /* q:2+r:2 */
     188             :       }
     189           0 :       break;
     190             :     }
     191             :   }
     192             :   {
     193         770 :     const long tab[]={
     194             :     24, 173, 301, 99, 125, 113, 101, 97, 85, 161, 133, 189, 67, 87, 73, 105, -1,
     195             :     36, 255, 671, 265, 219, 427, 243, 147, 275, 115, 127, 121, 159, 111, 175,
     196             :        -1,
     197             :     40, 391, 903, 263, 311, 291, 271, 227, 207, 483, 399, 567, 163, 187, 315,
     198             :        -1,
     199             :     56, 697, 1849, 585, 557, 529, 413, 385, 989, 817, 1161, 351, 357, 645, -1,
     200             :     60, 945, 721, 561, 1617, 211, 497, 337, 373, 651, 581, 693, 501, 1029, -1,
     201             :     75, 3647, 271, 847, -1,
     202             :     84, 647, 935, 1935, 1295, 1071, 3311, 451, 699, 595, 1333, 469, 1099, 1419,
     203             :         987, 2107, -1,
     204             :     88, 1573, 4773, 1397, 1353, 1309, 953, 909, 2553, 2109, 2997, 865, 1665, -1,
     205             :     90, 1659, 1891, 1371, 3843, 775, 1407, 735, 903, 615, 1575, -1,
     206             :     104, 2143, 6751, 991, 1935, 1883, 1831, 1307, 1255, 3611, 2983, 4239, 731,
     207             :          1203, 2355, -1,
     208             :     105, 1785, 6321, -1,
     209             :     126, 1533, 2037, 3397, 3477, 2749, 7869, 777, 937, 721, 1281, 1425, 2881,
     210             :          1369, 1849, 1201, 3225, -1,
     211             :     132, 4995, 2947, 2595, 8547, 1663, 3441, 2639, 3663, 2463, 5439, -1,
     212             :     136, 3547, 11739, 1499, 3275, 3207, 3139, 2183, 2115, 6279, 5187, 7371,
     213             :          987, 1159, 2047, 4095, -1,
     214             :     140, 4429, 3885, 2989, 9933, 3053, 1613, 1697, 3297, 3569, 2849, 6321, -1,
     215             :       -1};
     216             :       long i;
     217             :       const long *t;
     218       11312 :       for(t=tab;*t!=-1;t++)
     219             :       {
     220       10612 :         if (t[0]==n)
     221             :         {
     222         721 :           for(i=1; t[i] != -1; i++)
     223         721 :             if (t[i]==s) return i;
     224           0 :           return -1;
     225             :         }
     226      145586 :         while (*t>=0) t++;
     227             :       }
     228             :   }
     229             :   {
     230         700 :     const long tab[]={
     231             :       16, 1710031, 550075, 70099, 70075, 870059, 110059, 30079, 30071, 30063,
     232             : 470131, 70155, 70107, 110115, 310307, -1,
     233             :       32, 6830063, 150323, 1830171, /*230171*/0, 230227, 30283, 30251, 30203,
     234             : /*70267*/0, 70219, 110227, /*230171*/0, /*70187*/0, /*70187*/0, 110155,
     235             : 3430123, 430123, 30191, 30175, 30159, 1110387, 150563, 150387, 230323, 230411,
     236             : 230299, 70619, 70467, 70355, /*70379*/0, /*70379*/0, /*70267*/0, 70291, 70555,
     237             : 70331, 1750291, 230291, 430275, 70411, 70363, 70315, 110331, 30371, 30323,
     238             : 950819, 150995, 150643, 230691, 30747, 30635, 632451, -1,
     239             :       48, 430156, 11970124, 10219, 430324, 110324, 30396, 30444, 30348, 230300,
     240             : 110300, 230396, /*70396*/0, /*70396*/0, 70540, 30412, 30364, 30380, 30332,
     241             : 70492, 3850300, 490396, 490300, 6090236, 770236, 210316, 210284, 210252, 30299,
     242             : 30371, 30363, 110299, 70311, 110271, 70588, 230732, 70876, 110636, 30868,
     243             : 30628, 30596, 30644, 150684, 70828, 3290524, 490620, 490428, 770460, 30627,
     244             : 70571, 10643, 151740, 2171228, -1,
     245             :       54, 10256, 16410120, 70292, 610232, 10373, 10292, 10616, 70517, 5610228,
     246             : 210309, 210228, 250448, 70616, 11696, 2370552, -1,
     247             :       /*64*/
     248             :       72, 110307, 26230195, 210272, 30523, 110631, 30739, 70575, 30683,
     249             : 14030351, 1830403, 1830299, 770346, 110586, 10750330, 10620, 210420, 71223,
     250             : 9150663, 30426, 30858, 30978, 30954, 31074, 30762, 210452, 210538, 770634,
     251             : 210730, 490626, 210722, 31018, 111234, 31450, 71106, 31322, 5750594, 750682,
     252             : 750506, 10346, 10826, 10490, 70620, 11124, 10716, 30786, 31746, 210636, 491202,
     253             : 72402, 3751122, -1,
     254             :       80, 430250, 35910186, 110282, 430530, 110530, 30650, 30730, 30570,
     255             : 230482, 110482, 230642, /*70642*/0, /*70642*/0, 70882, 30666, 30586, 30618,
     256             : 30538, 70786, 11550450, 1470594, 1470450, 18270354, 2310354, 630474, 630426,
     257             : 630378, 110562, 30562, 110722, 30722, 70546, 30546, 30946, 70962, 231202,
     258             : 71442, 111042, 31426, 31026, 30978, 31058, 151106, 71346, 9870786, 1470930,
     259             : 1470642, 2310690, 10467, 71266, 152866, 6511842, -1,
     260             :       81,49210121, 6730319, 250427, 250319, 16450238, 610238, 70454, 70346,
     261             : 70400, 70319, 5650670, 250994, 250670, 610589, 2412452, -1,
     262             :       /*96*/
     263             :       100, 30393, 57310217, 10481, 30693, 36470341, 630408, 30968, 13310392,
     264             : 210416, 10576, 11256, 10856, 11096, 630648, 31768, 8470616, -1,
     265             :       108, 30552, 60170280, 610359, 30984, 38290440, 210660, 1830540, 30849,
     266             : 30660, 31308, 211137, 20570532, 770721, 770532, 70769, 11636, 11813, 610647,
     267             : 70647, 250674, 70674, 70890, 211092, 1830852, 31389, 31092, 32388, 211965,
     268             : 13090836, 491133, 490836, 751080, 211416, 33576, 8691288, 70904, 11048, 71720,
     269             : 13688, 12344, 251538, 751608, 212280, 36600, 5532024,-1,
     270             :       112, 430344, 73530248, 430736, 110736, 30904, 31016, 30792, 230664,
     271             : 110664, 230888, 0/*70888*/, 0/*70888*/, 71224, 30920, 30808, 30856, 30744,
     272             : 71080, 23650600, 3010792, 3010600, 37410472, 4730472, 1290632, 1290568,
     273             : 1290504, 71336, 231672, 72008, 111448, 31984, 31424, 31360, 31472, 151528,
     274             : 71864, 20211048, 3011240, 3010856, 4730920, 30643, 153992, 13332456,-1,
     275             :       120, 2310456, 770488, 110648, 63210360, 30763, 210552, 30712, 31256,
     276             : 31240, 31336, 31400, 31496, 31480, 31096, 630498, 210808, 770968, 211128,
     277             : 490904, 211064, 630744, 2310888, 631032, 1470840, 630984, 31128, 111368, 31608,
     278             : 71224, 31464, 33810648, 4410744, 4410552, 11211, 31263, 11416, 210858, 11290,
     279             : 11090, 211032, 31352, 32600, 630738, 491864, 1471704, 72664, 22051224, -1,
     280             :       135, 114870240, 39270456, 1470618, 1470456, 16591104 , -1,
     281             :       -1};
     282             :     long i;
     283             :     const long *t;
     284         700 :     GEN Z = groupelts_center(S), L = galoissubgroups(G);
     285         700 :     long scenter = groupelts_sumorders(Z), svecgroup = vecgroup_sumorders(L);
     286         700 :     long u = svecgroup+10000*scenter; /*This is used as a hash value*/
     287             : 
     288        2268 :     for(t=tab; *t!=-1; t++)
     289             :     {
     290        2191 :       if (t[0]==n)
     291             :       {
     292       12894 :         for(i=1; t[i] != -1; i++)
     293       12971 :           if (t[i]==u) return i;
     294         105 :         switch(n)
     295             :         {
     296          98 :         case 32:
     297             :           switch(u)
     298             :           {
     299          42 :           case 230171:
     300             :             {
     301          42 :               const long good[]={2,0}, bad[]={4,5,0};
     302          42 :               return indexgroupcentre(G,Z,good,bad)? 4: 12;
     303             :             }
     304           7 :           case 70267:
     305           7 :             if (s==135) return 9;
     306           7 :             return 32;
     307          35 :           case 70187:
     308             :             {
     309          35 :               const long good[]={8,0}, bad[]={7,9,0};
     310          35 :               return indexgroupcentre(G,Z,good,bad)? 13: 14;
     311             :             }
     312          14 :           case 70379:
     313             :             {
     314          14 :               const long good[]={4,0},bad[]={0};
     315          14 :               return indexgroupsubgroup(L,8,good,bad)? 31: 30;
     316             :             }
     317             :           }
     318           0 :           break;
     319           7 :         case 48: case 80:
     320             :           {
     321           7 :             const long good[]={5,8,0},bad[]={6,7,0};
     322           7 :             return indexgroupcentre(G,Z,good,bad)? 12: 13;
     323             :           }
     324           0 :         case 112:
     325             :           {
     326           0 :             const long good[]={7,4,0},bad[]={5,6,0};
     327           0 :             return indexgroupcentre(G,Z,good,bad)? 11: 12;
     328             :           }
     329             :         }
     330           0 :         return -1;
     331             :       }
     332       47530 :       while (*t!=-1) t++;
     333             :     }
     334             :     {
     335          77 :       const long tab[]={ 64, 1270001, /*4270003*/0, /*4270003*/0, 8190072,
     336             :  6430073, 6670445, 5550446, 8190278, 7070279, 6350071, 5230072, 8110154,
     337             :  /*5870155*/0, /*5870155*/0, /*4270042*/0, /*4270042*/0, 7710246, 7390277,
     338             :  6750037, 8032377, 8670266, 6750397, 11390022, 7710267, 7070277, /*3630046*/0,
     339             :  /*3630046*/0, 3630057, 4830196, 4830207, 4671808, 9070697, 6670700, 8750094,
     340             :  6990091, 6350111, 5870115, 6671599, 5711601, 5551702, 5871512, 6351709,
     341             :  5391711, /*3630046*/0, 3630047, 4111467, /*4430156*/0, /*4430156*/0, 3790166,
     342             :  /*2510026*/0, /*2510026*/0, 4470028, 4150300, 3830030, 13470021, 20350065,
     343             :  10910041, 16514365, /*12190433*/0, 34110271, /*16514475*/0, 15230465,
     344             :  /*10910433*/0, 9630041, 13470233, /*16514475*/0, 20834696, /*10910433*/0,
     345             :  13954343, /*12190433*/0, 19553542, 13474377, 25790466, 15870467, 18914476,
     346             :  14110477, /*14590443*/0, 13310443, 11550043, /*14590443*/0, 10270043, 8990002,
     347             :  8990546, 8990646, 8993647, 8356896, 13310905, 13310915, 12039018, 16990866,
     348             :  12670888, 15071116, 11551217, 12038218, 16031739, 12512740, 12353138, 12993048,
     349             :  15391849, 11872850, 12993551, 12353851, 8991446, 8991447, 8354830, 9951566,
     350             :  9951666, 8674709, 9317039, 8031897, 8030187, 7713641, 7714641, 7074743,
     351             :  9236585, 9236415, 9236586, 10990821, 9879066, 8751833, 9873399, 8751766,
     352             :  10990754, 8593054, 8593087, 6830446, 6833546, 17472434, 13953445, 14432313,
     353             :  16352544, 12833555, 13313423, 15635143, 13234877, 13874853, 12755287, 17870919,
     354             :  14190949, 13075209, 11955310, 10835253, 9715354, 11312124, 10193135, 11074927,
     355             :  12197529, 9957664, 11074970, 12196539, 9956674, 9958907, 10439497, 9479551,
     356             :  9554015, 8433958, 9553915, 8434058, 8918081, 7798421, 10110856, 10110756,
     357             :  9476648, 8991757, 8991857, 8356682, 10994275, 8750435, 8590474, 9230510,
     358             :  10355254, 8115355, 13556790, 15790679, 11310691, 12275539, 14035061, 11795172,
     359             :  8750465, 7474472, 8750475, 8114920, 6110196, 6111806, 5951808, 10191819,
     360             :  9238364, 8271841, 8590736, 9390959, 8432079, 25470255, 41792701, 25470275,
     361             :  20355344, 27233751, 18593673, 19717567, 23394762, 17312707, 19717633, 46115277,
     362             :  31557088, 22917189, 24677288, 24039835, 24676366, 16032362, 17793529, 17153269,
     363             :  38432486, 21153763, 23393635, 16037076, 27710971, 27074338, 20995174, 23396204,
     364             :  20193482, 17157790, 19550231, 14751475, 17153832, 19070249, 16038080, 33391110,
     365             :  25875097, 22197835, 22195018, 21070221, 24590112, 18999456, 15952565, 18356361,
     366             :  17237769, 18359003, 15951169, 14832955, 16110295, 18350268, 21392354, 22030301,
     367             :  18353365, 15955257, 13550032, 18430405, 18434015, 17150260, 17154128, 27234036,
     368             :  23710639, 20194057, 21157900, 24198470, 20679613, 21158141, 22435065, 21318520,
     369             :  20197076, 67390501, 83715011, 51070497, 54590283, 58915129, 50275230, 52035340,
     370             :  263870051, -1,
     371             :       -1};
     372             :       long i;
     373             :       const long *t;
     374          77 :       GEN V=vecgroup_idxlist(L,32);
     375          77 :       long idxlist=vecsmall_pack(V,10,9967);
     376          77 :       long w=10000*svecgroup+idxlist; /*This is used as a hash value*/
     377          84 :       for(t=tab; *t!=-1; t++)
     378             :       {
     379          77 :         if (t[0]==n)
     380             :         {
     381       18760 :           for(i=1; t[i] != -1; i++)
     382       18760 :             if (t[i]==w) return i;
     383          70 :           switch(n)
     384             :           {
     385          70 :           case 64:
     386             :             switch(w)
     387             :             {
     388           7 :             case 4270003:
     389           7 :               return (scenter==439)? 2: 3;
     390           7 :             case 5870155:
     391             :               {
     392           7 :                 const long good[]={8,9,0},bad[]={7,0};
     393           7 :                 return indexgroupcentre(G,Z,good,bad)? 13: 14;
     394             :               }
     395           7 :             case 4270042:
     396             :               {
     397           7 :                 const long good[]={13,0},bad[]={14,0};
     398           7 :                 return indexgroupcentre(G,Z,good,bad)? 15: 16;
     399             :               }
     400           7 :             case 4430156:
     401             :               {
     402           7 :                 const long good[]={18,20,0},bad[]={19,0};
     403           7 :                 return indexgroupcentre(G,Z,good,bad)? 47: 48;
     404             :               }
     405           7 :             case 2510026:
     406           7 :               return scenter==1367? 50: 51;
     407           7 :             case 12190433:
     408           7 :               return scenter==47? 59: 70;
     409           7 :             case 16514475:
     410             :               {
     411           7 :                 const long good[]={22,24,28,0},bad[]={23,25,27,30,0};
     412           7 :                 return indexgroupcentre(G,Z,good,bad)? 61: 66;
     413             :               }
     414           7 :             case 10910433:
     415             :               {
     416           7 :                 const long good[]={23,31,0},bad[]={25,26,29,30,33,0};
     417           7 :                 return indexgroupcentre(G,Z,good,bad)? 63: 68;
     418             :               }
     419           7 :             case 14590443:
     420             :               {
     421           7 :                 const long good[]={28,33,0},bad[]={30,34,0};
     422           7 :                 return indexgroupcentre(G,Z,good,bad)? 77: 80;
     423             :               }
     424           7 :             case 3630046:
     425             :               {
     426           7 :                 const long good[]={3,0},bad[]={12,16,0};
     427           7 :                 if (scenter==695) return 26;
     428           7 :                 return indexgroupcentre(G,Z,good,bad)? 27: 44;
     429             :               }
     430             :             }
     431           0 :             break;
     432             :           }
     433           0 :           return -1;
     434             :         }
     435        1883 :         while (*t!=-1) t++;
     436             :       }
     437             :     }
     438             :     {
     439           7 :       const long tab[]={ 96, 316010002, 252010002, 707020000, 676160124,
     440             :     676170124, 87180027, 988190278, 892200028, 876030110, 876040110, 876120110,
     441             :     215111237, 503062153, 972141052, 972131052, 455091156, 167101154, 620160033,
     442             :     620170033, 908031033, 908121033, 908041033, 199101564, 7130153, 7140153,
     443             :     812150123, 247051165, 487091566, 812151024, 391071276, 103081274, 247111377,
     444             :     988180195, 892190205, 924190197, 828200207, 103050134, 679020464, 295091075,
     445             :     199070145, 391060235, 103101076, 7080146, 135111157, 295020044, 684030223,
     446             :     684040223, 908050274, 135060255, 7070285, 812080286, 71092475, 876102476,
     447             :     908112287, 684120223, 748130243, 748140243, 620150254, 492160043, 492170043,
     448             :     764180045, 700190477, 636200047, 963110003, 779050031, 935100032, 799110033,
     449             :     819210003, 791260032, 246270050, 723330003, 987340003, 651360031, 623380033,
     450             :     647263930, 839351534, 455321350, 178211335, 791244031, 322256848, 189340236,
     451             :     130316409, 599331360, 743244548, 935295937, 551333907, 189222029, 274255883,
     452             :     525275609, 82306043, 610289391, 82315641, 82307025, 647262487, 839353950,
     453             :     0/*455322385*/, 0/*455322385*/, 178233588, 791245051, 322256982, 130307015,
     454             :     658286619, 983297004, 983297037, 599333858, 631365165, 631376165, 535386399,
     455             :     66408676, 354390966, 871428265, 775411064, 631376407, 535386309, 114430028,
     456             :     823441008, 314398920, 74437993, 831420054, 42405827, 90439425, 799440830,
     457             :     847426805, 767410275, 815440314, 863429143, 487360134, 487371044, 66211564,
     458             :     66231664, 871295713, 66231764, 679242567, 125228724, 210253894, 18306803,
     459             :     546288536, 162390938, 919437378, 871401018, 162255761, 967304398, 967313318,
     460             :     413274329, 498283470, 498288163, 29345108, 967401139, 727449579, 679411219,
     461             :     775352619, 583261276, 919295225, 66312839, 423381047, 2437470, 759424560,
     462             :     711448550, 770222372, 109272382, 551210244, 258222592, 551230264, 295242430,
     463             :     647254411, 199262266, 482272602, 871283751, 423293752, 519303751, 519312662,
     464             :     71320222, 167332232, 226340245, 327352266, 167360274, 167372584, 103382587,
     465             :     647392595, 455406162, 263412616, 327428742, 487438955, 295440098, 358290331,
     466             :     622253358, 886280358, 322410312, 754400322, 394443122, 282440313, 354423123,
     467             :     522430323, 726220349, 990273529, 470450359, 742460359, 522470032, 198470031,
     468             :     282480353, 290490033, 274500353, 414470000, 614490000, 605473864, 664459790,
     469             :     723464091, 893482714, 675465704, 845486215, 184493728, 653478045, 941489155,
     470             :     605501588, 925482982, 264492577, 589502601, 312450472, 371466994, 285450492,
     471             :     989464902, 578470486, 770489139, 994490497, 546500507, 604460529, 65270050,
     472             :     684510049, 468510050, 134510562, 831510052, -1
     473             :         -1};
     474             :       long i;
     475             :       const long *t;
     476           7 :       GEN V=vecgroup_idxlist(L,48);
     477           7 :       long idx48=vecsmall_pack(V,10,9967);
     478           7 :       long idx32=vecgroup_idxlist(L,32)[1];
     479           7 :       long w=1000000*(svecgroup%997)+10000*idx32+idx48;
     480             :       /*This is used as a hash value*/
     481           7 :       for(t=tab; *t!=-1; t++)
     482             :       {
     483           7 :         if (t[0]==n)
     484             :         {
     485        1127 :           for(i=1; t[i] != -1; i++)
     486        1127 :             if (t[i]==w) return i;
     487           0 :           switch(n)
     488             :           {
     489           0 :           case 96:
     490             :             switch(w)
     491             :             {
     492           0 :             case 455322385:
     493             :               {
     494           0 :                 const long good[]={37,40,0},bad[]={34,41,0};
     495           0 :                 return indexgroupcentre(G,Z,good,bad)? 96: 97;
     496             :               }
     497             :             }
     498           0 :             break;
     499             :           }
     500           0 :           return -1;
     501             :         }
     502           0 :         while (*t!=-1) t++;
     503             :       }
     504             :     }
     505             :   }
     506           0 :   return 0;
     507             : }
     508             : 
     509             : long
     510        1274 : group_ident(GEN G, GEN S)
     511             : {
     512        1274 :   pari_sp av = avma;
     513        1274 :   long idx = group_ident_i(G, S);
     514        1274 :   if (idx < 0) pari_err_TYPE("group_ident [not a group]", G);
     515        1274 :   if (!idx) pari_err_IMPL("galoisidentify for groups of order > 127");
     516        1274 :   return gc_long(av, idx);
     517             : }
     518             : 
     519             : long
     520           0 : group_ident_trans(GEN G, GEN S)
     521             : {
     522           0 :   const long tab[]={
     523             :         4, 1, 2, -1,
     524             :         6, 2, 1, -1,
     525             :         8, 1, 2, 4, 5, 3, -1,
     526             :         9, 1, 2, -1,
     527             :         10, 2, 1, -1,
     528             :         12, 5, 1, 4, 3, 2, -1,
     529             :         14, 2, 1, -1,
     530             :         15, 1, -1,
     531             :         16, 1, 4, 10, 8, 5, 6, 13, 12, 14, 2, 9, 7, 11, 3, -1,
     532             :         18, 5, 1, 3, 4, 2, -1,
     533             :         20, 2, 1, 5, 4, 3, -1,
     534             :         21, 2, 1, -1,
     535             :         22, 2, 1, -1,
     536             :         24, 8, 1, 7, 5, 12, 13, 6, 14, 2, 15, 4, 10, 9, 11, 3, -1,
     537             :         25, 1, 2, -1,
     538             :         26, 2, 1, -1,
     539             :         27, 1, 2, 3, 5, 4, -1,
     540             :         28, 3, 1, 4, 2, -1,
     541             :         30, 2, 4, 3, 1, -1,
     542             :         -1};
     543           0 :   long n = group_order(G), s;
     544             :   const long *t;
     545           0 :   if (n == 1) return 1;
     546             :   /* N.B. known up to 32 (Cannon-Holt) */
     547           0 :   if (n > 30) pari_err_IMPL("group_ident_trans [n > 30]");
     548           0 :   if (uisprime(n)) return 1;
     549           0 :   s = group_ident(G,S);
     550           0 :   for(t=tab;*t>=0;t++)
     551             :   {
     552           0 :     if (t[0]==n) return t[s];
     553           0 :     while (*t>=0) t++;
     554             :   }
     555             :   return 0; /*LCOV_EXCL_LINE*/
     556             : }

Generated by: LCOV version 1.16