Ignore:
Timestamp:
Apr 20, 2011, 9:43:24 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
03bf555de3ab718b020a7fd0a086b5c2e493dbd0
Parents:
1ddd044275ba5d4433a597ff9edee1abfce81a0e
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-04-20 21:43:24+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:23+01:00
Message:
FIX: we can link against libpolys
FIX: rField_*(r...) all should call corresponding nCoeff_*(r->cf...)
ADD: first tests of polynomial rings

TODO for Frank: change ring.* wrt ring-related variables (moved to coeffs &&& renamed!)
TODO: poly. algs. over rings are UNusable at the moment
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/monomials/ring.cc

    r1ddd04 r17e473  
    138138ring rDefault(coeffs cf, int N, char **n,int ord_size, int *ord, int *block0, int *block1)
    139139{
     140  assume( cf != NULL);
    140141  ring r=(ring) omAlloc0Bin(sip_sring_bin);
    141142  r->ch    = n_GetChar(cf);
     
    167168  if (ch==0) cf=nInitChar(n_Q,NULL);
    168169  else       cf=nInitChar(n_Zp,(void*)(long)ch);
     170  assume( cf != NULL);
    169171  return rDefault(cf,N,n,ord_size,ord,block0,block1);
    170172}
    171173ring   rDefault(coeffs cf, int N, char **n)
    172174
     175  assume( cf != NULL);
    173176  /*order: lp,0*/
    174177  int *order = (int *) omAlloc(2* sizeof(int));
     
    190193  if (ch==0) cf=nInitChar(n_Q,NULL);
    191194  else       cf=nInitChar(n_Zp,(void*)(long)ch);
     195  assume( cf != NULL);
    192196  return rDefault(cf,N,n);
    193197}
     
    286290  else if (rField_is_Ring(r))
    287291  {
     292    TODO(Frank, "Please consider addapting the variable names...");
     293   
    288294    PrintS("//   coeff. ring is : ");
    289295    if (rField_is_Ring_Z(r)) PrintS("Integers\n");
     296/*
    290297    long l = (long)mpz_sizeinbase(r->ringflaga, 10) + 2;
    291298    char* s = (char*) omAlloc(l);
     
    295302    if (rField_is_Ring_PtoM(r)) Print("Z/%s^%lu\n", s, r->ringflagb);
    296303    omFreeSize((ADDRESS)s, l);
     304*/ 
    297305  }
    298306#endif
     
    521529  }
    522530#ifdef HAVE_RINGS
     531  TODO(Frank, "Please consider addapting the variable names...");
     532/*
    523533  if (r->ringflaga != NULL)
    524534  {
     
    531541    omFree((ADDRESS)r->nrnModul);
    532542  }
     543*/
    533544#endif
    534545  omFreeBin(r, sip_sring_bin);
     
    649660
    650661#ifdef HAVE_RINGS
     662  TODO(Frank, "Please consider addapting the variable names...");
     663/*
    651664  if (rField_is_Ring_Z(r))
    652665  {
    653     s=omStrDup("integer");                   /* Z */
     666    s=omStrDup("integer");                   // Z
    654667    return s;
    655668  }
     
    674687    return s;
    675688  }
     689*/
    676690#endif
    677691  if (r->parameter==NULL)
     
    777791{
    778792#ifdef HAVE_RINGS
     793  TODO(Frank, "Please consider addapting the variable names...");
     794/*
    779795  if (rField_is_Ring_2toM(r))
    780796    return binaryPower(2, (int)(unsigned long)r->ringflagb);
     
    784800    return binaryPower((int)mpz_get_ui(r->ringflaga),
    785801                       (int)(unsigned long)r->ringflagb);
     802*/
    786803#endif
    787804  if (rField_is_numeric(r))
     
    15971614ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
    15981615{
     1616  TODO(Hans, "Please consider the change to '->cf'...");
     1617 
    15991618  if (r == NULL) return NULL;
    16001619  int i,j;
     
    16151634  res->ch=r->ch;     /* characteristic */
    16161635#ifdef HAVE_RINGS
    1617   res->ringtype=r->ringtype;  /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */
     1636  TODO(Frank, "Please consider addapting the variable names...");
     1637/*
     1638  res->ringtype=r->ringtype;  // cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m
    16181639  if (r->ringflaga!=NULL)
    16191640  {
     
    16271648    mpz_init_set(res->nrnModul,r->nrnModul);
    16281649  }
     1650*/
    16291651#endif
    16301652  //memset: res->ref=0; /* reference counter to the ring */
     
    16821704  //memset: res->cf=NULL;
    16831705  res->options=r->options;
    1684   #ifdef HAVE_RINGS
    1685   res->ringtype=r->ringtype;
    1686   #endif
     1706#ifdef HAVE_RINGS
     1707  TODO(Frank, "Please consider addapting the variable names...");
     1708//  res->ringtype=r->ringtype;
     1709#endif
    16871710  //
    16881711  if (r->algring!=NULL)
     
    34733496  // set intStrategy
    34743497#ifdef HAVE_RINGS
    3475   if (rField_is_Extension(r) || rField_is_Q(r) || rField_is_Ring(r))
     3498  if (
     3499         rField_is_Extension(r)
     3500      || rField_is_Q(r)
     3501      || rField_is_Ring(r))
    34763502#else
    34773503  if (rField_is_Extension(r) || rField_is_Q(r))
Note: See TracChangeset for help on using the changeset viewer.