Changeset c82e549 in git


Ignore:
Timestamp:
Feb 3, 2005, 6:52:26 PM (18 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
Children:
a730585b56aaa23c89f808eb7907185e3dd020f0
Parents:
d7e4de54a295ea5ba6e5f4e70126d6c3c126e6ed
Message:
*hannes: ringlist for nc algebras


git-svn-id: file:///usr/local/Singular/svn/trunk@7701 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    rd7e4de5 rc82e549  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.95 2005-01-24 15:04:39 Singular Exp $ */
     4/* $Id: ipshell.cc,v 1.96 2005-02-03 17:52:26 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    14481448}
    14491449
    1450 lists rDecompose(ring r)
    1451 {
     1450void rDecomposeCF(leftv h,const ring r,const ring R)
     1451{
     1452  lists L=(lists)omAlloc0Bin(slists_bin);
     1453  L->Init(4);
     1454  h->rtyp=LIST_CMD;
     1455  h->data=(void *)L;
    14521456  // 0: char/ cf - ring
    14531457  // 1: list (var)
    14541458  // 2: list (ord)
    14551459  // 3: qideal
    1456   lists L=(lists)omAlloc0Bin(slists_bin);
    1457   L->Init(4);
    14581460  // ----------------------------------------
    14591461  // 0: char/ cf - ring
    1460   #if 0 /* TODO */
    1461   if (rIsExtension(r))
    1462     rDecomposeCF(&(L->m[0]),r);
    1463   else
    1464   #endif
    1465   {
    1466     L->m[0].rtyp=INT_CMD;
    1467     L->m[0].data=(void *)r->ch;
    1468   }
     1462  L->m[0].rtyp=INT_CMD;
     1463  L->m[0].data=(void *)r->ch;
    14691464  // ----------------------------------------
    14701465  // 1: list (var)
     
    15281523  // 3: qideal
    15291524  L->m[3].rtyp=IDEAL_CMD;
     1525  if (R->minpoly==NULL)
     1526    L->m[3].data=(void *)idInit(1,1);
     1527  else
     1528  {
     1529    ideal I=idInit(1,1);
     1530    L->m[3].data=(void *)I;
     1531    I->m[0]=pOne();
     1532    pSetCoeff(I->m[0],R->minpoly);
     1533  }
     1534  // ----------------------------------------
     1535}
     1536void rDecomposeC(leftv h,const ring R)
     1537{
     1538  lists L=(lists)omAlloc0Bin(slists_bin);
     1539  L->Init(4);
     1540  h->rtyp=LIST_CMD;
     1541  h->data=(void *)L;
     1542  // 0: char/ cf - ring
     1543  // 1: list (var)
     1544  // 2: list (ord)
     1545  // 3: qideal
     1546  // ----------------------------------------
     1547  // 0: char/ cf - ring
     1548  L->m[0].rtyp=INT_CMD;
     1549  L->m[0].data=(void *)R->ch;
     1550  // ----------------------------------------
     1551  // 1: list (var)
     1552  lists LL=(lists)omAlloc0Bin(slists_bin);
     1553  LL->Init(1);
     1554    LL->m[0].rtyp=STRING_CMD;
     1555    LL->m[0].data=(void *)omStrDup(R->parameter[0]);
     1556  L->m[1].rtyp=LIST_CMD;
     1557  L->m[1].data=(void *)LL;
     1558  // ----------------------------------------
     1559  // 2: list (ord)
     1560  LL=(lists)omAlloc0Bin(slists_bin);
     1561  LL->Init(1);
     1562  lists LLL;
     1563  {
     1564    intvec *iv;
     1565    int j;
     1566    LL->m[0].rtyp=LIST_CMD;
     1567    LLL=(lists)omAlloc0Bin(slists_bin);
     1568    LLL->Init(2);
     1569    LLL->m[0].rtyp=STRING_CMD;
     1570    LLL->m[0].data=(void *)omStrDup("lp");
     1571    {
     1572      iv=new intvec(1);
     1573      for(;j>=0; j--) (*iv)[0]=1;
     1574    }
     1575    LLL->m[1].rtyp=INTVEC_CMD;
     1576    LLL->m[1].data=(void *)iv;
     1577    LL->m[0].data=(void *)LLL;
     1578  }
     1579  L->m[2].rtyp=LIST_CMD;
     1580  L->m[2].data=(void *)LL;
     1581  // ----------------------------------------
     1582  // 3: qideal
     1583  L->m[3].rtyp=IDEAL_CMD;
     1584  {
     1585    ideal I=idInit(1,1);
     1586    L->m[3].data=(void *)I;
     1587    //I->m[0]=pOne();
     1588    //pSetCoeff(I->m[0],R->minpoly);
     1589  }
     1590  // ----------------------------------------
     1591}
     1592
     1593lists rDecompose(ring r)
     1594{
     1595  // 0: char/ cf - ring
     1596  // 1: list (var)
     1597  // 2: list (ord)
     1598  // 3: qideal
     1599  // possibly:
     1600  // 4: C
     1601  // 5: D
     1602  lists L=(lists)omAlloc0Bin(slists_bin);
     1603  if (rIsPluralRing(r))
     1604    L->Init(6);
     1605  else
     1606    L->Init(4);
     1607  // ----------------------------------------
     1608  // 0: char/ cf - ring
     1609  #if 1 /* TODO */
     1610  if (rIsExtension(r))
     1611  {
     1612    if (rField_is_long_C(r))
     1613      rDecomposeC(&(L->m[0]),r);
     1614    else
     1615      rDecomposeCF(&(L->m[0]),r->algring,r);
     1616  }
     1617  else
     1618  #endif
     1619  {
     1620    L->m[0].rtyp=INT_CMD;
     1621    L->m[0].data=(void *)r->ch;
     1622  }
     1623  // ----------------------------------------
     1624  // 1: list (var)
     1625  lists LL=(lists)omAlloc0Bin(slists_bin);
     1626  LL->Init(r->N);
     1627  int i;
     1628  for(i=0; i<r->N; i++)
     1629  {
     1630    LL->m[i].rtyp=STRING_CMD;
     1631    LL->m[i].data=(void *)omStrDup(r->names[i]);
     1632  }
     1633  L->m[1].rtyp=LIST_CMD;
     1634  L->m[1].data=(void *)LL;
     1635  // ----------------------------------------
     1636  // 2: list (ord)
     1637  LL=(lists)omAlloc0Bin(slists_bin);
     1638  i=rBlocks(r)-1;
     1639  LL->Init(i);
     1640  i--;
     1641  lists LLL;
     1642  for(; i>=0; i--)
     1643  {
     1644    intvec *iv;
     1645    int j;
     1646    LL->m[i].rtyp=LIST_CMD;
     1647    LLL=(lists)omAlloc0Bin(slists_bin);
     1648    LLL->Init(2);
     1649    LLL->m[0].rtyp=STRING_CMD;
     1650    LLL->m[0].data=(void *)omStrDup(rSimpleOrdStr(r->order[i]));
     1651    if (r->block1[i]-r->block0[i] >=0 )
     1652    {
     1653      j=r->block1[i]-r->block0[i];
     1654      iv=new intvec(j+1);
     1655      if ((r->wvhdl!=NULL) && (r->wvhdl[i]!=NULL))
     1656      {
     1657        for(;j>=0; j--) (*iv)[j]=r->wvhdl[i][j];
     1658      }
     1659      else switch (r->order[i])
     1660      {
     1661        case ringorder_dp:
     1662        case ringorder_Dp:
     1663        case ringorder_ds:
     1664        case ringorder_Ds:
     1665        case ringorder_lp:
     1666          for(;j>=0; j--) (*iv)[j]=1;
     1667          break;
     1668        default: /* do nothing */;
     1669      }
     1670    }
     1671    else
     1672    {
     1673      iv=new intvec(1);
     1674    }
     1675    LLL->m[1].rtyp=INTVEC_CMD;
     1676    LLL->m[1].data=(void *)iv;
     1677    LL->m[i].data=(void *)LLL;
     1678  }
     1679  L->m[2].rtyp=LIST_CMD;
     1680  L->m[2].data=(void *)LL;
     1681  // ----------------------------------------
     1682  // 3: qideal
     1683  L->m[3].rtyp=IDEAL_CMD;
    15301684  if (r->qideal==NULL)
    15311685    L->m[3].data=(void *)idInit(1,1);
     
    15331687    L->m[3].data=(void *)idCopy(r->qideal);
    15341688  // ----------------------------------------
     1689  #ifdef HAVE_PLURAL
     1690  if (rIsPluralRing(r))
     1691  {
     1692    L->m[4].rtyp=MATRIX_CMD;
     1693    L->m[4].data=(void *)mpCopy(r->nc->C);
     1694    L->m[5].rtyp=MATRIX_CMD;
     1695    L->m[5].data=(void *)mpCopy(r->nc->D);
     1696  }
     1697  #endif
    15351698  return L;
    15361699}
     
    15381701ring rCompose(lists  L)
    15391702{
    1540   if (L->nr!=3) return NULL;
     1703  if ((L->nr!=3)
     1704#ifdef HAVE_PLURAL
     1705  &&(L->nr!=5)
     1706#endif
     1707  )
     1708    return NULL;
    15411709  // 0: char/ cf - ring
    15421710  // 1: list (var)
    15431711  // 2: list (ord)
    15441712  // 3: qideal
     1713  // possibly:
     1714  // 4: C
     1715  // 5: D
    15451716  ring R=(ring) omAlloc0Bin(sip_sring_bin);
    15461717  if (L->m[0].Typ()==INT_CMD)
     
    17231894  // todo
    17241895  rComplete(R);
     1896
     1897  // ---------------------------------------------------------------
     1898  #ifdef HAVE_PLURAL
     1899  if (L->nr==5)
     1900  {
     1901    if (nc_CallPlural((matrix)L->m[4].Data(),(matrix)L->m[5].Data(),
     1902        NULL,NULL,R))
     1903      goto rCompose_err;
     1904  }
     1905  #endif
    17251906  return R;
    17261907
Note: See TracChangeset for help on using the changeset viewer.