Changeset 351a5f in git


Ignore:
Timestamp:
Jan 13, 2011, 1:50:41 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
6af1cc514f43879d46e2d975e0f8daa3c319f0d8
Parents:
56790491568061b8fda62ac136d56bb3bca12583
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-01-13 13:50:41+01:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:59:25+01:00
Message:
syntax fixes for libpoly, part 3: ring.cc
Location:
libpolys
Files:
1 added
2 edited

Legend:

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

    r5679049 r351a5f  
    1313// #include <polys/options.h>
    1414#include <omalloc/omalloc.h>
    15 #include <polys/polys.h>
     15#include <misc/sy_bit.h>
     16#include <polys/monomials/ring.h>
     17#include <polys/monomials/p_polys.h>
    1618#include <coeffs/numbers.h>
    1719// #include <???/febase.h>
     
    3840#define BITS_PER_LONG 8*SIZEOF_LONG
    3941
    40 omBin sip_sring_bin = omGetSpecBin(sizeof(sip_sring));
     42omBin sip_sring_bin = omGetSpecBin(sizeof(ip_sring));
    4143
    4244static const char * const ringorder_name[] =
     
    102104 // }
    103105  /*------------ set global ring vars --------------------------------*/
    104   currRing = r;
    105   currQuotient=NULL;
     106  //currRing = r;
     107  //currQuotient=NULL;
    106108  if (r != NULL)
    107109  {
     
    111113
    112114    /*------------ global variables related to coefficients ------------*/
    113     nSetChar(r);
     115    nSetChar(r->cf);
    114116
    115117    /*------------ global variables related to polys -------------------*/
    116     pSetGlobals(r);
     118    p_SetGlobals(r);
    117119    /*------------ global variables related to factory -------------------*/
    118120#ifdef HAVE_FACTORY
     
    138140  }
    139141  /*weights: entries for 2 blocks: NULL*/
    140   r->wvhdl = (int **)omAlloc0((ord_size+1) * sizeof(int_ptr));
     142  r->wvhdl = (int **)omAlloc0((ord_size+1) * sizeof(int *));
    141143  r->order = ord;
    142144  r->block0 = block0;
     
    250252  omCheckAddrSize(r->block0,nblocks*sizeof(int));
    251253  omCheckAddrSize(r->block1,nblocks*sizeof(int));
    252   omCheckAddrSize(r->wvhdl,nblocks*sizeof(int_ptr));
     254  omCheckAddrSize(r->wvhdl,nblocks*sizeof(int *));
    253255  omCheckAddrSize(r->names,r->N*sizeof(char_ptr));
    254256
     
    260262    Print("//   # ground field : %d\n",rInternalChar(r));
    261263    Print("//   primitive element : %s\n", r->parameter[0]);
    262     if (r==currRing)
    263     {
    264       StringSetS("//   minpoly        : ");
    265       nfShowMipo();PrintS(StringAppendS("\n"));
    266     }
     264    StringSetS("//   minpoly        : ");
     265    nfShowMipo();PrintS(StringAppendS("\n"));
    267266  }
    268267#ifdef HAVE_RINGS
     
    313312        PrintS("0\n");
    314313      }
    315       else if (r==currRing)
    316       {
    317         StringSetS(""); nWrite(r->minpoly); PrintS(StringAppendS("\n"));
    318       }
    319314      else
    320315      {
    321         PrintS("...\n");
     316        StringSetS(""); n_Write(r->minpoly,r->cf); PrintS(StringAppendS("\n"));
    322317      }
    323318      if (r->minideal!=NULL)
    324319      {
    325         if (r==currRing) iiWriteMatrix((matrix)r->minideal,"//   minpolys",1,0);
    326         else PrintS("//   minpolys=...");
     320        iiWriteMatrix((matrix)r->minideal,"//   minpolys",1,0);
    327321        PrintLn();
    328322      }
     
    448442  if (r->qideal!=NULL)
    449443  {
    450     PrintS("\n// quotient ring from ideal");
    451     if (r==currRing)
    452     {
    453       PrintLn();
    454       iiWriteMatrix((matrix)r->qideal,"_",1);
    455     }
    456     else PrintS(" ...");
     444    PrintS("\n// quotient ring from ideal\n");
     445    iiWriteMatrix((matrix)r->qideal,"_",1);
    457446  }
    458447}
     
    11821171    tmpR.block0=(int*)omAlloc0(4*sizeof(int));
    11831172    tmpR.block1=(int*)omAlloc0(4*sizeof(int));
    1184     tmpR.wvhdl=(int**)omAlloc0(4*sizeof(int_ptr));
     1173    tmpR.wvhdl=(int**)omAlloc0(4*sizeof(int *));
    11851174    tmpR.order[0]=ringorder_dp;
    11861175    tmpR.block0[0]=1;
     
    12201209      tmpR.block0=(int*)omAlloc(3*sizeof(int));
    12211210      tmpR.block1=(int*)omAlloc(3*sizeof(int));
    1222       tmpR.wvhdl=(int**)omAlloc0(3*sizeof(int_ptr));
     1211      tmpR.wvhdl=(int**)omAlloc0(3*sizeof(int *));
    12231212      tmpR.order[0]=ringorder_unspec;
    12241213      tmpR.order[1]=ringorder_C;
     
    12531242      tmpR.block0=(int*)omAlloc0(b*sizeof(int));
    12541243      tmpR.block1=(int*)omAlloc0(b*sizeof(int));
    1255       tmpR.wvhdl=(int**)omAlloc0(b*sizeof(int_ptr));
     1244      tmpR.wvhdl=(int**)omAlloc0(b*sizeof(int *));
    12561245      /* weights not implemented yet ...*/
    12571246      if (rb!=NULL)
     
    13131302      tmpR.block0=(int*)omAlloc0(b*sizeof(int));
    13141303      tmpR.block1=(int*)omAlloc0(b*sizeof(int));
    1315       tmpR.wvhdl=(int**)omAlloc0(b*sizeof(int_ptr));
     1304      tmpR.wvhdl=(int**)omAlloc0(b*sizeof(int *));
    13161305      /* weights not implemented yet ...*/
    13171306      for (i=0;i<b;i++)
     
    16711660  {
    16721661    i=rBlocks(r);
    1673     res->wvhdl   = (int **)omAlloc(i * sizeof(int_ptr));
     1662    res->wvhdl   = (int **)omAlloc(i * sizeof(int *));
    16741663    res->order   = (int *) omAlloc(i * sizeof(int));
    16751664    res->block0  = (int *) omAlloc(i * sizeof(int));
     
    20662055
    20672056// return TRUE if p->exp[r->pOrdIndex] holds a weighted degree of p */
    2068 BOOLEAN rOrd_is_WeightedDegree_Ordering(ring r =currRing)
     2057BOOLEAN rOrd_is_WeightedDegree_Ordering(ring r )
    20692058{
    20702059  // Hmm.... what about Syz orderings?
     
    27422731  int *block0=(int*)omAlloc0((nblocks+1)*sizeof(int));
    27432732  int *block1=(int*)omAlloc0((nblocks+1)*sizeof(int));
    2744   int **wvhdl=(int**)omAlloc0((nblocks+1)*sizeof(int_ptr));
     2733  int **wvhdl=(int**)omAlloc0((nblocks+1)*sizeof(int *));
    27452734
    27462735  int i=0;
     
    28712860    omFreeSize(block0,(nblocks+1)*sizeof(int));
    28722861    omFreeSize(block1,(nblocks+1)*sizeof(int));
    2873     omFreeSize(wvhdl,(nblocks+1)*sizeof(int_ptr));
     2862    omFreeSize(wvhdl,(nblocks+1)*sizeof(int *));
    28742863    return r;
    28752864  }
     
    29842973
    29852974  /*weights: entries for 3 blocks: NULL*/
    2986   res->wvhdl = (int **)omAlloc0(3 * sizeof(int_ptr));
     2975  res->wvhdl = (int **)omAlloc0(3 * sizeof(int *));
    29872976  /*order: Wp,C,0*/
    29882977  res->order = (int *) omAlloc(3 * sizeof(int *));
     
    30413030    int *block0=(int*)omAlloc0((nblocks+1)*sizeof(int));
    30423031    int *block1=(int*)omAlloc0((nblocks+1)*sizeof(int));
    3043     int **wvhdl=(int**)omAlloc0((nblocks+1)*sizeof(int_ptr));
     3032    int **wvhdl=(int**)omAlloc0((nblocks+1)*sizeof(int *));
    30443033
    30453034    order[0]=ringorder_lp;
     
    42314220}
    42324221
    4233 void pDebugPrint(poly p)
    4234 {
    4235   p_DebugPrint(p, currRing);
    4236 }
    42374222#endif // RDEBUG
    42384223
     
    42884273//    F = system("ISUpdateComponents", F, V, MIN );
    42894274//    // replace gen(i) -> gen(MIN + V[i-MIN]) for all i > MIN in all terms from F!
    4290 void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r = currRing)
     4275void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r )
    42914276{
    42924277  assume( V != NULL );
     
    45894574  ring new_r = rCopy0(r, FALSE, FALSE);
    45904575  i+=2;
    4591   new_r->wvhdl=(int **)omAlloc0(i * sizeof(int_ptr));
     4576  new_r->wvhdl=(int **)omAlloc0(i * sizeof(int *));
    45924577  new_r->order   = (int *) omAlloc0(i * sizeof(int));
    45934578  new_r->block0   = (int *) omAlloc0(i * sizeof(int));
     
    49814966/// We will use it AS IS!
    49824967/// returns true is everything was allright!
    4983 bool rSetISReference(const ideal F, const int i = 0, const int p = 0, const intvec * componentWeights = NULL, const ring r = currRing)
     4968bool rSetISReference(const ideal F, const ring r,const int i = 0, const int p = 0, const intvec * componentWeights = NULL)
    49844969{
    49854970  // Put the reference set F into the ring -ordering -recor
     
    51895174  #ifdef HAVE_RINGS
    51905175   if (rField_is_Ring_Z(r)) return n_Z;
    5191    if (rField_is_Ring_ModN(r)) return n_Zm;
     5176   if (rField_is_Ring_ModN(r)) return n_Zn;
    51925177   if (rField_is_Ring_PtoM(r)) return n_Zpn;
    5193    if (rField_is_Ring_2toM(r)) return  n_Z2n;
     5178   if (rField_is_Ring_2toM(r)) return  n_Z2m;
    51945179  #endif
    51955180
     
    52225207  r->block0=(int*)omReallocSize(r->block0, size*sizeof(int), (size+1)*sizeof(int));
    52235208  r->block1=(int*)omReallocSize(r->block1, size*sizeof(int), (size+1)*sizeof(int));
    5224   r->wvhdl=(int_ptr*)omReallocSize(r->wvhdl,size*sizeof(int_ptr), (size+1)*sizeof(int_ptr));
     5209  r->wvhdl=(int **)omReallocSize(r->wvhdl,size*sizeof(int *), (size+1)*sizeof(int *));
    52255210  for(int k=size; k>pos; k--) r->wvhdl[k]=r->wvhdl[k-1];
    52265211  r->order[size]=0;
     
    52335218//  r->block0=(int*)omReallocSize(r->block0, size*sizeof(int), (size-1)*sizeof(int));
    52345219//  r->block1=(int*)omReallocSize(r->block1, size*sizeof(int), (size-1)*sizeof(int));
    5235 //  r->wvhdl=(int_ptr*)omReallocSize(r->wvhdl,size*sizeof(int_ptr), (size-1)*sizeof(int_ptr));
     5220//  r->wvhdl=(int **)omReallocSize(r->wvhdl,size*sizeof(int *), (size-1)*sizeof(int *));
    52365221//  for(int k=pos+1; k<size; k++) r->wvhdl[k]=r->wvhdl[k+1];
    52375222//  size--;
  • libpolys/polys/prCopy.h

    r5679049 r351a5f  
     1#ifndef PRCOPY_H
     2#define PRCOPY_H
    13/****************************************
    24*  Computer Algebra System SINGULAR     *
     
    1921 *
    2022 ************************************************************************/
    21 poly prMoveR_NoSort(poly &p, ring r, ring dest_r = currRing);
    22 poly prMoveR(poly &p, ring r, ring dest_r = currRing);
    23 poly prCopyR_NoSort(poly p, ring r, ring dest_r = currRing);
    24 poly prCopyR(poly p, ring r, ring dest_r = currRing);
    25 poly prShallowCopyR_NoSort(poly p, ring r, ring dest_t = currRing);
    26 poly prShallowCopyR(poly p, ring r, ring dest_t = currRing);
    27 poly prHeadR(poly p, ring r, ring dest_r = currRing);
     23poly prMoveR_NoSort(poly &p, ring r, ring dest_r);
     24poly prMoveR(poly &p, ring r, ring dest_r);
     25poly prCopyR_NoSort(poly p, ring r, ring dest_r);
     26poly prCopyR(poly p, ring r, ring dest_r);
     27poly prShallowCopyR_NoSort(poly p, ring r, ring dest_t);
     28poly prShallowCopyR(poly p, ring r, ring dest_t);
     29poly prHeadR(poly p, ring r, ring dest_rg);
    2830
    29 ideal idrMoveR_NoSort(ideal &id, ring r, ring dest_r = currRing);
    30 ideal idrMoveR(ideal &id, ring r, ring dest_r = currRing);
     31ideal idrMoveR_NoSort(ideal &id, ring r, ring dest_r );
     32ideal idrMoveR(ideal &id, ring r, ring dest_r );
    3133
    32 ideal idrCopyR_NoSort(ideal id, ring r, ring dest_r = currRing);
    33 ideal idrCopyR(ideal id, ring r, ring dest_r = currRing);
     34ideal idrCopyR_NoSort(ideal id, ring r, ring dest_r );
     35ideal idrCopyR(ideal id, ring r, ring dest_r );
    3436
    35 ideal idrShallowCopyR_NoSort(ideal id, ring r, ring dest_r = currRing);
    36 ideal idrShallowCopyR(ideal id, ring r, ring dest_r = currRing);
    37 
     37ideal idrShallowCopyR_NoSort(ideal id, ring r, ring dest_r );
     38ideal idrShallowCopyR(ideal id, ring r, ring dest_r );
    3839
    3940/// Copy leading terms of id[i] via prHeeadR into dest_r
    40 ideal idrHeadR(ideal id, ring r, ring dest_r = currRing);
    41 
    42 
    43 
    44 
     41ideal idrHeadR(ideal id, ring r, ring dest_r );
     42#endif
Note: See TracChangeset for help on using the changeset viewer.