Changeset 5eef8d in git


Ignore:
Timestamp:
May 14, 2008, 4:08:41 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
06879b7d7091f46b683a5e4267de4e3edc1ab70f
Parents:
37d75ad2529983159dcf69a89eba6be075aa734a
Message:
*hannes: ringlist for gf-char


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

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r37d75ad r5eef8d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.182 2008-03-28 11:01:56 Singular Exp $ */
     4/* $Id: ipshell.cc,v 1.183 2008-05-14 14:08:41 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    16441644    if (r->algring!=NULL)
    16451645      rDecomposeCF(&(L->m[0]),r->algring,r);
     1646    else
     1647    {
     1648      lists Lc=(lists)omAlloc0Bin(slists_bin);
     1649      Lc->Init(4);
     1650      // char:
     1651      Lc->m[0].rtyp=INT_CMD;
     1652      Lc->m[0].data=(void*)r->ch;
     1653      // var:
     1654      lists Lv=(lists)omAlloc0Bin(slists_bin);
     1655      Lv->Init(1);
     1656      Lv->m[0].rtyp=STRING_CMD;
     1657      Lv->m[0].data=(void *)omStrDup(r->parameter[0]);
     1658      Lc->m[1].rtyp=LIST_CMD;
     1659      Lc->m[1].data=(void*)Lv;
     1660      // ord:
     1661      lists Lo=(lists)omAlloc0Bin(slists_bin);
     1662      Lo->Init(1);
     1663      lists Loo=(lists)omAlloc0Bin(slists_bin);
     1664      Loo->Init(2);
     1665      Loo->m[0].rtyp=STRING_CMD;
     1666      Loo->m[0].data=(void *)omStrDup(rSimpleOrdStr(ringorder_lp));
     1667      intvec *iv=new intvec(1); (*iv)[0]=1;
     1668      Loo->m[1].rtyp=INTVEC_CMD;
     1669      Loo->m[1].data=(void *)iv;
     1670      Lo->m[0].rtyp=LIST_CMD;
     1671      Lo->m[0].data=(void*)Loo;
     1672
     1673      Lc->m[2].rtyp=LIST_CMD;
     1674      Lc->m[2].data=(void*)Lo;
     1675      // q-ideal:
     1676      Lc->m[3].rtyp=IDEAL_CMD;
     1677      Lc->m[3].data=(void *)idInit(1,1);
     1678      // ----------------------
     1679      L->m[0].rtyp=LIST_CMD;
     1680      L->m[0].data=(void*)Lc;
     1681    }
    16461682    if (L->m[0].rtyp==0)
    16471683    {
     
    17871823  )
    17881824    return NULL;
     1825  int is_gf_char=0;
    17891826  // 0: char/ cf - ring
    17901827  // 1: list (var)
     
    19712008    {
    19722009      int l;
    1973       if (((R->ch!=0) && (R->ch<2))
     2010      if (((R->ch!=0) && (R->ch<2) && (is_gf_char=-1))
    19742011      #ifndef NV_OPS
    19752012      || (R->ch > 32003)
     
    19902027    else
    19912028    {
    1992       R->algring=rCompose((lists)L->m[0].Data());
    1993       if (R->algring==NULL)
    1994       {
    1995         WerrorS("could not create rational function coefficient field");
    1996         goto rCompose_err;
    1997       }
    1998       if (R->algring->ch>0)
    1999          R->ch= -R->algring->ch;
     2029      if (LL->m[0].Typ()==INT_CMD)
     2030      {
     2031        int ch=(int)(long)LL->m[0].Data();
     2032        while ((ch!=fftable[is_gf_char]) && (fftable[is_gf_char])) is_gf_char++;
     2033        if (fftable[is_gf_char]==0) is_gf_char=-1;
     2034      }
     2035      if (is_gf_char==-1)
     2036      {
     2037        R->algring=rCompose((lists)L->m[0].Data());
     2038        if (R->algring==NULL)
     2039        {
     2040          WerrorS("could not create rational function coefficient field");
     2041          goto rCompose_err;
     2042        }
     2043        if (R->algring->ch>0)
     2044          R->ch= -R->algring->ch;
     2045        else
     2046          R->ch=1;
     2047        R->P=R->algring->N;
     2048        R->parameter=(char**)omAlloc0(R->P*sizeof(char_ptr));
     2049        int i;
     2050        for(i=R->P-1;i>=0;i--)
     2051          R->parameter[i]=omStrDup(R->algring->names[i]);
     2052        if (R->algring->qideal!=NULL)
     2053        {
     2054          if (IDELEMS(R->algring->qideal)==1)
     2055          {
     2056            R->minpoly=naInit(1);
     2057            lnumber n=(lnumber)R->minpoly;
     2058            n->z=R->algring->qideal->m[0];
     2059            R->algring->qideal->m[0]=NULL;
     2060            idDelete(&(R->algring->qideal));
     2061          }
     2062          else
     2063          {
     2064            WerrorS("not implemented yet.");
     2065          }
     2066        }
     2067      }
    20002068      else
    2001          R->ch=1;
    2002       R->P=R->algring->N;
    2003       R->parameter=(char**)omAlloc0(R->P*sizeof(char_ptr));
    2004       int i;
    2005       for(i=R->P-1;i>=0;i--)
    2006         R->parameter[i]=omStrDup(R->algring->names[i]);
    2007       if (R->algring->qideal!=NULL)
    2008       {
    2009         if (IDELEMS(R->algring->qideal)==1)
    2010         {
    2011           R->minpoly=naInit(1);
    2012           lnumber n=(lnumber)R->minpoly;
    2013           n->z=R->algring->qideal->m[0];
    2014           R->algring->qideal->m[0]=NULL;
    2015           idDelete(&(R->algring->qideal));
    2016         }
    2017         else
    2018         {
    2019           WerrorS("not implemented yet.");
    2020         }
     2069      { // gf-char
     2070        R->ch=fftable[is_gf_char];
     2071        R->P=1;
     2072        R->parameter=(char**)omAlloc0(1*sizeof(char_ptr));
     2073        R->parameter[0]=omStrDup((char*)((lists)(LL->m[1].Data()))->m[0].Data());
    20212074      }
    20222075    }
Note: See TracChangeset for help on using the changeset viewer.