Changeset 738395 in git


Ignore:
Timestamp:
Apr 10, 2024, 3:00:43 PM (6 weeks ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
466c063f95840de930831a8c461736654a00b926
Parents:
77d0bf735657ddd72e8000512e173a937c1e18bf
Message:
HAVE_RINGS is default (p2)
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/ringgb.h

    r77d0bf r738395  
    99// #include "kernel/mod2.h"
    1010
    11 #ifdef HAVE_RINGS
    1211#include "kernel/polys.h"
    1312
     
    2019
    2120#endif
    22 #endif
  • libpolys/coeffs/bigintmat.cc

    r77d0bf r738395  
    1717#include <cmath>
    1818
    19 #ifdef HAVE_RINGS
    2019///create Z/nA of type n_Zn
    2120static coeffs numbercoeffs(number n, coeffs c) // TODO: FIXME: replace with n_CoeffRingQuot1
     
    3130  return nc;
    3231}
    33 #endif
    3432
    3533//#define BIMATELEM(M,I,J) (M)[ (M).index(I,J) ]
     
    17591757      }
    17601758
    1761       #ifdef HAVE_RINGS
    17621759      // normalize by units:
    17631760      if (!n_IsZero(view(i, j), basecoeffs()))
     
    17701767        n_Delete(&u, basecoeffs());
    17711768      }
    1772       #endif
    17731769      // Zum Schluss mache alle EintrÀge rechts vom Diagonalelement betragsmÀßig kleiner als dieses
    17741770      for (int l=j+1; l<=col; l++)
     
    18211817}
    18221818
    1823 #ifdef HAVE_RINGS
    18241819//OK: a HNF of (this | p*I)
    18251820//so the result will always have FULL rank!!!!
     
    18511846  return C;
    18521847}
    1853 #endif
    1854 
    18551848
    18561849//exactly divide matrix by b
     
    21012094}
    21022095
    2103 #ifdef HAVE_RINGS
    21042096static number solveAx_dixon(bigintmat *A, bigintmat *B, bigintmat *x, bigintmat *kern) {
    21052097  coeffs R = A->basecoeffs();
     
    22892281  return NULL;
    22902282}
    2291 #endif
    22922283
    22932284//TODO: re-write using reduce_mod_howell
     
    24432434  switch (getCoeffType(R))
    24442435  {
    2445   #ifdef HAVE_RINGS
    24462436    case n_Z:
    24472437      return solveAx_dixon(A, b, x, NULL);
     
    24502440    case n_Z2m:
    24512441      return solveAx_howell(A, b, x, NULL);
    2452   #endif
    24532442    case n_Zp:
    24542443    case n_Q:
     
    25902579}
    25912580
    2592 #ifdef HAVE_RINGS
    25932581//a "q-base" for the kernel of a.
    25942582//Should be re-done to use Howell rather than smith.
     
    26372625  return c->cols();
    26382626}
    2639 #endif
    26402627
    26412628bool nCoeffs_are_equal(coeffs r, coeffs s)
  • libpolys/coeffs/bigintmat.h

    r77d0bf r738395  
    300300    void howell(); ///<dito, but Howell form (only different for zero-divsors)
    301301    void swapMatrix(bigintmat * a);
    302     #ifdef HAVE_RINGS
    303302    bigintmat * modhnf(number p, coeffs c); ///< computes HNF(this | p*I)
    304     #endif
    305303    bigintmat * modgauss(number p, coeffs c);
    306304    void skaldiv(number b); ///< Macht Ganzzahldivision aller MatrixeintrÀge mit b
  • libpolys/coeffs/coeffs.h

    r77d0bf r738395  
    523523{ assume(r != NULL); assume(r->cfQuot1 != NULL); return r->cfQuot1(c, r); }
    524524
    525 #ifdef HAVE_RINGS
    526525static FORCE_INLINE int n_DivComp(number a, number b, const coeffs r)
    527526{ assume(r != NULL); assume(r->cfDivComp!=NULL); return r->cfDivComp (a,b,r); }
     
    536535static FORCE_INLINE number n_GetUnit(number n, const coeffs r)
    537536{ assume(r != NULL); assume(r->cfGetUnit!=NULL); return r->cfGetUnit(n,r); }
    538 
    539 #endif
    540537
    541538/// a number representing i in the given coeff field/ring r
     
    725722
    726723// Tests:
    727 #ifdef HAVE_RINGS
    728724static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
    729725{ assume(r != NULL); return (getCoeffType(r)==n_Z2m); }
     
    734730static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
    735731{ assume(r != NULL); return (r->is_field==0); }
    736 #else
    737 #define nCoeff_is_Ring_2toM(A) 0
    738 #define nCoeff_is_Ring_PtoM(A) 0
    739 #define nCoeff_is_Ring(A)      0
    740 #endif
    741732
    742733/// returns TRUE, if r is a field or r has no zero divisors (i.e is a domain)
     
    757748static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
    758749{ assume(r != NULL);
    759 #ifdef HAVE_RINGS
    760750  if( nCoeff_is_Ring(r) )
    761751  {
    762752    assume(r->cfDivBy!=NULL); return r->cfDivBy(a,b,r);
    763753  }
    764 #endif
    765754  return !n_IsZero(b, r);
    766755}
  • libpolys/coeffs/ffields.cc

    r77d0bf r738395  
    898898  //r->cfSize  = ndSize;
    899899  r->cfInt  = nfInt;
    900   #ifdef HAVE_RINGS
    901900  //r->cfDivComp = NULL; // only for ring stuff
    902901  //r->cfIsUnit = NULL; // only for ring stuff
     
    904903  //r->cfExtGcd = NULL; // only for ring stuff
    905904  // r->cfDivBy = NULL; // only for ring stuff
    906   #endif
    907905  r->cfInpNeg   = nfNeg;
    908906  r->cfInvers= nfInvers;
  • libpolys/coeffs/generics.cc

    r77d0bf r738395  
    486486  r->cfSize  = gSize;
    487487  r->cfInt  = gInt;
    488   #ifdef HAVE_RINGS
    489488  r->cfDivComp = gDivComp;
    490489  r->cfIsUnit = gIsUnit;
     
    492491  r->cfExtGcd = gExtGcd;
    493492   r->cfDivBy = gDivBy;
    494   #endif
    495493  r->cfInpNeg   = gInpNeg;
    496494  r->cfInvers= gInvers;
  • libpolys/coeffs/gnumpc.cc

    r77d0bf r738395  
    623623  r->cfSize  = nlSize;
    624624  r->cfInt  = nlInt;
    625 #ifdef HAVE_RINGS
    626625  r->cfDivComp = NULL; // only for ring stuff
    627626  r->cfIsUnit = NULL; // only for ring stuff
    628627  r->cfGetUnit = NULL; // only for ring stuff
    629628  r->cfExtGcd = NULL; // only for ring stuff
    630 #endif
    631629  r->cfInpNeg   = nlNeg;
    632630  r->cfInvers= nlInvers;
     
    638636  r->cfNormalize=nlNormalize;
    639637  r->cfGreater = nlGreater;
    640 #ifdef HAVE_RINGS
    641638  r->cfDivBy = NULL; // only for ring stuff
    642 #endif
    643639  r->cfEqual = nlEqual;
    644640  r->cfIsZero = nlIsZero;
  • libpolys/coeffs/longrat.cc

    r77d0bf r738395  
    200200
    201201
    202 #ifdef HAVE_RINGS
    203202/*2
    204203* convert from a GMP integer
     
    232231  return z;
    233232}
    234 #endif
    235 
    236233
    237234#ifdef LDEBUG
     
    11181115    rr = nInitChar(n_Zp,(void*)ch);
    11191116  }
    1120   #ifdef HAVE_RINGS
    11211117  else
    11221118  {
     
    11291125    mpz_clear(dummy);
    11301126  }
    1131   #endif
    11321127  return(rr);
    11331128}
     
    16131608}
    16141609
    1615 #ifdef HAVE_RINGS
    16161610/*2
    16171611* convert number i (from Q) to GMP and warn if denom != 1
     
    16331627  mpz_set(n, i->z);
    16341628}
    1635 #endif
    16361629
    16371630/*2
     
    25092502    return nlMapC; /* C -> Q */
    25102503  }
    2511 #ifdef HAVE_RINGS
    25122504  if (src->rep==n_rep_gmp) // nCoeff_is_Z(src) || nCoeff_is_Ring_PtoM(src) || nCoeff_is_Zn(src))
    25132505  {
     
    25222514    return nlMapMachineInt;
    25232515  }
    2524 #endif
    25252516  return NULL;
    25262517}
  • libpolys/coeffs/modulop.cc

    r77d0bf r738395  
    367367  r->cfInt  = npInt;
    368368  r->cfInitMPZ = npInitMPZ;
    369   #ifdef HAVE_RINGS
    370369  //r->cfDivComp = NULL; // only for ring stuff
    371370  //r->cfIsUnit = NULL; // only for ring stuff
     
    373372  //r->cfExtGcd = NULL; // only for ring stuff
    374373  // r->cfDivBy = NULL; // only for ring stuff
    375   #endif
    376374  r->cfInpNeg   = npNeg;
    377375  r->cfInvers= npInvers;
     
    569567}
    570568
    571 #ifdef HAVE_RINGS
    572569/*2
    573570* convert from a GMP integer
     
    596593  return (number) i;
    597594}
    598 #endif
    599595
    600596static number npMapCanonicalForm (number a, const coeffs /*src*/, const coeffs dst)
     
    607603static nMapFunc npSetMap(const coeffs src, const coeffs)
    608604{
    609 #ifdef HAVE_RINGS
    610605  if ((src->rep==n_rep_int) && nCoeff_is_Ring_2toM(src))
    611606  {
     
    620615    return npMapZ;
    621616  }
    622 #endif
    623617  if (src->rep==n_rep_gap_rat)  /* Q, Z */
    624618  {
  • libpolys/coeffs/numbers.cc

    r77d0bf r738395  
    2828#include "coeffs/flintcf_Qrat.h"
    2929
    30 #ifdef HAVE_RINGS
    3130#include "coeffs/rmodulo2m.h"
    3231#include "coeffs/rmodulon.h"
    3332#include "coeffs/rintegers.h"
    34 #endif
    3533
    3634#ifdef HAVE_POLYEXTENSIONS
     
    224222  number &curr = numberCollectionEnumerator.Current();
    225223
    226 #ifdef HAVE_RINGS
    227224  /// TODO: move to a separate implementation
    228225  if (nCoeff_is_Ring(r))
     
    251248    return;
    252249  }
    253 #endif
    254250
    255251  assume(!nCoeff_is_Ring(r));
     
    305301number nd_Copy(number a, const coeffs r) { return r->cfCopy(a, r); }
    306302
    307 #ifdef HAVE_RINGS
    308303static BOOLEAN ndDivBy(number, number, const coeffs) { return TRUE; } // assume a,b !=0
    309304static int ndDivComp(number, number, const coeffs) { return 2; }
    310305static number  ndExtGcd (number, number, number *, number *, const coeffs r) { return r->cfInit(1,r); }
    311 #endif
    312306
    313307CanonicalForm ndConvSingNFactoryN( number, BOOLEAN /*setChar*/, const coeffs)
     
    392386 ngcInitChar,  /* n_long_C */
    393387 nnInitChar,   /* n_nTupel */
    394  #ifdef HAVE_RINGS
    395388 nrzInitChar,  /* n_Z */
    396389 nrnInitChar,  /* n_Zn */
    397390 nrnInitChar,  /* n_Znm */
    398391 nr2mInitChar, /* n_Z2m */
    399  #else
    400  NULL,         /* n_Z */
    401  NULL,         /* n_Zn */
    402  NULL,         /* n_Znm */
    403  NULL,         /* n_Z2m */
    404  #endif
    405392 flintQrat_InitChar, /* n_FlintQrat */
    406393 NULL,         /* n_CF */
     
    474461
    475462    n->cfEucNorm = ndEucNorm;
    476 #ifdef HAVE_RINGS
    477463    n->cfDivComp = ndDivComp;
    478464    n->cfDivBy = ndDivBy;
     
    480466    n->cfXExtGcd = ndXExtGcd;
    481467    //n->cfGetUnit = ndGetUnit_Ring;// set afterwards
    482 #endif
    483468
    484469    // report error, if not redefined
     
    515500      else             n->cfIsUnit=ndIsUnit_Ring;
    516501    }
    517     #ifdef HAVE_RINGS
    518502    if (n->cfGetUnit==NULL)
    519503    {
     
    525509      n->cfInvers=ndInvers_Ring;
    526510    }
    527     #endif
    528 
    529511
    530512    if(n->cfMult==NULL)  PrintS("cfMult missing\n");
  • libpolys/coeffs/rintegers.cc

    r77d0bf r738395  
    88#include "misc/auxiliary.h"
    99
    10 #ifdef HAVE_RINGS
    1110#include "factory/factory.h"
    1211
     
    4140#error set SI_INTEGER_VARIANT
    4241#endif
    43 #endif
  • libpolys/coeffs/rintegers.h

    r77d0bf r738395  
    99#include "misc/auxiliary.h"
    1010
    11 #ifdef HAVE_RINGS
    1211#include "coeffs/coeffs.h"
    1312
     
    3534
    3635#endif
    37 
    38 #endif
  • libpolys/coeffs/rintegers2.cc

    r77d0bf r738395  
    77
    88
    9 #ifdef HAVE_RINGS
    109#if SI_INTEGER_VARIANT == 2
    1110
     
    719718}
    720719#endif
    721 #endif
  • libpolys/coeffs/rintegers3.cc

    r77d0bf r738395  
    55* ABSTRACT: numbers (integers)
    66*/
    7 #ifdef HAVE_RINGS
    87#if SI_INTEGER_VARIANT == 3
    98#define POW_2_28 (1L<<60)
     
    12131212  r->cfSize  = nrzSize;
    12141213  r->cfInt  = nrzInt;
    1215   //#ifdef HAVE_RINGS
    12161214  r->cfDivComp = nrzDivComp; // only for ring stuff
    12171215  r->cfIsUnit = nrzIsUnit; // only for ring stuff
     
    12231221  r->cfQuotRem = nrzQuotRem;
    12241222  r->cfDivBy = nrzDivBy; // only for ring stuff
    1225   //#endif
    12261223  r->cfInpNeg   = nrzNeg;
    12271224  r->cfInvers= nrzInvers;
     
    12621259}
    12631260#endif
    1264 #endif
  • libpolys/coeffs/rmodulo2m.cc

    r77d0bf r738395  
    2020
    2121#include <string.h>
    22 
    23 #ifdef HAVE_RINGS
    2422
    2523#ifdef LDEBUG
     
    856854  return FALSE;
    857855}
    858 
    859 #endif
    860 /* #ifdef HAVE_RINGS */
  • libpolys/coeffs/rmodulo2m.h

    r77d0bf r738395  
    1414struct snumber; typedef struct snumber *   number;
    1515
    16 #ifdef HAVE_RINGS
    17 
    1816BOOLEAN nr2mInitChar    (coeffs r, void*);
    1917number  nr2mMapZp       (number from, const coeffs /*src*/, const coeffs dst);
     
    2119
    2220#endif
    23 #endif
  • libpolys/coeffs/rmodulon.cc

    r77d0bf r738395  
    2323
    2424#include <string.h>
    25 
    26 #ifdef HAVE_RINGS
    2725
    2826void nrnWrite (number a, const coeffs);
     
    10701068  return FALSE;
    10711069}
    1072 
    1073 #endif
    1074 /* #ifdef HAVE_RINGS */
  • libpolys/coeffs/rmodulon.h

    r77d0bf r738395  
    1313struct snumber; typedef struct snumber *   number;
    1414
    15 #ifdef HAVE_RINGS
    1615#include "coeffs/rintegers.h"
    1716
     
    2423
    2524#endif
    26 
    27 #endif
  • libpolys/coeffs/test.cc

    r77d0bf r738395  
    219219
    220220
    221 #ifdef HAVE_RINGS
    222221//  TODO(Frank, Segmentation fault! (if used wihout omalloc???). Please_ investigate!);
    223222  type =  n_Z2m;
    224223  if( Test(type, (void*) 4) )
    225224    c ++;
    226 #endif
    227225
    228226  type =  n_Zp;
     
    230228    c ++;
    231229
    232 #ifdef HAVE_RINGS
    233230//  TODO(Frank, memmory corruption_ if used wihout omalloc??? Please_ investigate!);
    234231
     
    237234    c ++;
    238235
    239 #endif
    240 
    241 
    242236  type =  n_Q;
    243237  if( Test(type) )
     
    248242    c ++;
    249243
    250 #ifdef HAVE_RINGS
    251244  type = n_Z;
    252245  if( Test(type) )
    253246    c ++;
    254 #endif
     247
    255248   type = n_GF;
    256249
     
    281274   delete param;
    282275
    283 
    284 
    285 
    286 #ifdef HAVE_RINGS
    287276  type = n_Zn;
    288277
     
    295284    c ++;
    296285
    297 #endif
    298 
    299286  type = n_long_C;
    300287  if( Test(type) )
     
    305292    c ++;
    306293
    307 #ifdef HAVE_RINGS
    308294  type = n_Z2m;
    309295  if( Test(type, (void*) 2) )
    310296    c ++;
    311 #endif
    312297
    313298  // polynomial rings needed for: n_algExt, n_transExt !
  • libpolys/polys/pDebug.cc

    r77d0bf r738395  
    153153  }
    154154  while (i);
    155 #ifdef HAVE_RINGS
    156155  return n_DivBy(pGetCoeff(b), pGetCoeff(a), r->cf);
    157 #else
    158   return TRUE;
    159 #endif
    160      }
     156}
    161157
    162158
  • libpolys/polys/p_Procs_Generate.cc

    r77d0bf r738395  
    123123  if (strcmp(s_field, "RingGeneral") == 0)
    124124  {
    125 #ifdef HAVE_RINGS
    126125    printf("#define HAVE_RINGS\n");
    127126    printf("#define HAVE_ZERODIVISORS\n");
    128 #else
    129     printf("#if 0\n");
    130 #endif
    131127  }
    132128  else
     
    207203  if (strcmp(s_field, "RingGeneral") == 0)
    208204  {
    209 #ifdef HAVE_RINGS
    210205    printf("#undef HAVE_RINGS\n");
    211206    printf("#undef HAVE_ZERODIVISORS\n");
    212 #else
    213     printf("#endif\n");
    214 #endif
    215207  }
    216208#ifndef p_Procs_Static
Note: See TracChangeset for help on using the changeset viewer.