Changeset 1745e5 in git for libpolys/polys/monomials


Ignore:
Timestamp:
Aug 1, 2011, 4:07:53 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
57592b355247b69310d60aa0448d638c327ad3e8
Parents:
283ef732868790f43d179f5c606f84691eaba355
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-08-01 16:07:53+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 13:01:18+01:00
Message:
int64.* ->misc, rCopy0AndAddA ->ring.h, fix walkSupport.cc
Location:
libpolys/polys/monomials
Files:
2 edited

Legend:

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

    r283ef7 r1745e5  
    1313#include <omalloc/omalloc.h>
    1414#include <misc/options.h>
    15 #include <misc/intvec.h>
     15#include <misc/int64vec.h>
    1616
    1717#include <coeffs/numbers.h>
     
    12971297
    12981298/*2
    1299  * create a copy of the ring r, which must be equivalent to currRing
     1299 * create a copy of the ring r
    13001300 * used for qring definition,..
    1301  * (i.e.: normal rings: same nCopy as currRing;
    1302  *        qring:        same nCopy, same idCopy as currRing)
    13031301 * DOES NOT CALL rComplete
    13041302 */
     
    14141412  //memset:   res->block1 = NULL;
    14151413  //memset: }
     1414
     1415  res->names   = (char **)omAlloc0(rVar(r) * sizeof(char *));
     1416  for (i=0; i<rVar(res); i++)
     1417  {
     1418    res->names[i] = omStrDup(r->names[i]);
     1419  }
     1420  if (r->qideal!=NULL)
     1421  {
     1422    if (copy_qideal)
     1423    {
     1424      #ifndef NDEBUG
     1425      if (!copy_ordering)
     1426        WerrorS("internal error: rCopy0(Q,TRUE,FALSE)");
     1427      else
     1428      #endif
     1429      {
     1430      #ifndef NDEBUG
     1431        WarnS("internal bad stuff: rCopy0(Q,TRUE,TRUE)");
     1432      #endif
     1433        rComplete(res);
     1434        res->qideal= idrCopyR_NoSort(r->qideal, r, res);
     1435        rUnComplete(res);
     1436      }
     1437    }
     1438    //memset: else res->qideal = NULL;
     1439  }
     1440  //memset: else res->qideal = NULL;
     1441  //memset: res->GetNC() = NULL; // copy is purely commutative!!!
     1442  return res;
     1443}
     1444
     1445/*2
     1446 * create a copy of the ring r
     1447 * used for qring definition,..
     1448 * DOES NOT CALL rComplete
     1449 */
     1450ring rCopy0AndAddA(const ring r,  int64vec *wv64, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
     1451{
     1452  if (r == NULL) return NULL;
     1453  int i,j;
     1454  ring res=(ring)omAllocBin(sip_sring_bin);
     1455  memset(res,0,sizeof(ip_sring));
     1456  //memcpy(res,r,sizeof(ip_sring));
     1457  //memset: res->idroot=NULL; /* local objects */
     1458  //ideal      minideal;
     1459  res->options=r->options; /* ring dependent options */
     1460
     1461  //memset: res->ordsgn=NULL;
     1462  //memset: res->typ=NULL;
     1463  //memset: res->VarOffset=NULL;
     1464  //memset: res->firstwv=NULL;
     1465
     1466  //struct omBin   PolyBin; /* Bin from where monoms are allocated */
     1467  //memset: res->PolyBin=NULL; // rComplete
     1468  res->cf=r->cf;     /* coeffs */
     1469  res->cf->ref++;
     1470
     1471  //memset: res->ref=0; /* reference counter to the ring */
     1472
     1473  res->float_len=r->float_len; /* additional char-flags */
     1474  res->float_len2=r->float_len2; /* additional char-flags */
     1475
     1476  res->N=rVar(r);      /* number of vars */
     1477  res->OrdSgn=r->OrdSgn; /* 1 for polynomial rings, -1 otherwise */
     1478
     1479  res->firstBlockEnds=r->firstBlockEnds;
     1480#ifdef HAVE_PLURAL
     1481  res->real_var_start=r->real_var_start;
     1482  res->real_var_end=r->real_var_end;
     1483#endif
     1484
     1485#ifdef HAVE_SHIFTBBA
     1486  res->isLPring=r->isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */
     1487#endif
     1488
     1489  res->VectorOut=r->VectorOut;
     1490  res->ShortOut=r->ShortOut;
     1491  res->CanShortOut=r->CanShortOut;
     1492  res->LexOrder=r->LexOrder; // TRUE if the monomial ordering has polynomial and power series blocks
     1493  res->MixedOrder=r->MixedOrder; // ?? 1 for lex ordering (except ls), -1 otherwise
     1494  res->ComponentOrder=r->ComponentOrder;
     1495
     1496  //memset: res->ExpL_Size=0;
     1497  //memset: res->CmpL_Size=0;
     1498  //memset: res->VarL_Size=0;
     1499  //memset: res->pCompIndex=0;
     1500  //memset: res->pOrdIndex=0;
     1501  //memset: res->OrdSize=0;
     1502  //memset: res->VarL_LowIndex=0;
     1503  //memset: res->MinExpPerLong=0;
     1504  //memset: res->NegWeightL_Size=0;
     1505  //memset: res->NegWeightL_Offset=NULL;
     1506  //memset: res->VarL_Offset=NULL;
     1507
     1508  // the following are set by rComplete unless predefined
     1509  // therefore, we copy these values: maybe they are non-standard
     1510  /* mask for getting single exponents */
     1511  res->bitmask=r->bitmask;
     1512  res->divmask=r->divmask;
     1513  res->BitsPerExp = r->BitsPerExp;
     1514  res->ExpPerLong =  r->ExpPerLong;
     1515
     1516  //memset: res->p_Procs=NULL;
     1517  //memset: res->pFDeg=NULL;
     1518  //memset: res->pLDeg=NULL;
     1519  //memset: res->pFDegOrig=NULL;
     1520  //memset: res->pLDegOrig=NULL;
     1521  //memset: res->p_Setm=NULL;
     1522  //memset: res->cf=NULL;
     1523  res->options=r->options;
     1524
     1525/*
     1526  if (r->extRing!=NULL)
     1527    r->extRing->ref++;
     1528 
     1529  res->extRing=r->extRing; 
     1530  //memset: res->minideal=NULL;
     1531*/
     1532 
     1533 
     1534  if (copy_ordering == TRUE)
     1535  {
     1536    i=rBlocks(r)+1; // DIFF to rCopy0
     1537    res->wvhdl   = (int **)omAlloc(i * sizeof(int *));
     1538    res->order   = (int *) omAlloc(i * sizeof(int));
     1539    res->block0  = (int *) omAlloc(i * sizeof(int));
     1540    res->block1  = (int *) omAlloc(i * sizeof(int));
     1541    for (j=0; j<i-1; j++)
     1542    {
     1543      if (r->wvhdl[j]!=NULL)
     1544      {
     1545        res->wvhdl[j+1] = (int*) omMemDup(r->wvhdl[j]); //DIFF
     1546      }
     1547      else
     1548        res->wvhdl[j+1]=NULL; //DIFF
     1549    }
     1550    memcpy(&(res->order[1]),r->order,(i-1) * sizeof(int)); //DIFF
     1551    memcpy(&(res->block0[1]),r->block0,(i-1) * sizeof(int)); //DIFF
     1552    memcpy(&(res->block1[1]),r->block1,(i-1) * sizeof(int)); //DIFF
     1553  }
     1554  //memset: else
     1555  //memset: {
     1556  //memset:   res->wvhdl = NULL;
     1557  //memset:   res->order = NULL;
     1558  //memset:   res->block0 = NULL;
     1559  //memset:   res->block1 = NULL;
     1560  //memset: }
     1561
     1562  //the added A
     1563  res->order[0]=ringorder_a64;
     1564  int length=wv64->rows();
     1565  int64 *A=(int64 *)omAlloc(length*sizeof(int64));
     1566  for(j=length-1;j>=0;j--)
     1567  {
     1568     A[j]=(*wv64)[j];
     1569  }
     1570  res->wvhdl[0]=(int *)A;
     1571  res->block0[0]=1;
     1572  res->block1[0]=length;
     1573  //
    14161574
    14171575  res->names   = (char **)omAlloc0(rVar(r) * sizeof(char *));
  • libpolys/polys/monomials/ring.h

    r283ef7 r1745e5  
    2828typedef struct ip_sring *         ring;
    2929class intvec;
     30class int64vec;
    3031struct p_Procs_s;
    3132typedef struct p_Procs_s p_Procs_s;
     
    346347ring   rCopy(ring r);
    347348ring   rCopy0(const ring r, BOOLEAN copy_qideal = TRUE, BOOLEAN copy_ordering = TRUE);
     349ring rCopy0AndAddA(ring r, int64vec *wv64, BOOLEAN copy_qideal = TRUE,
     350                   BOOLEAN copy_ordering = TRUE);
    348351ring   rOpposite(ring r);
    349352ring   rEnvelope(ring r);
Note: See TracChangeset for help on using the changeset viewer.