Changeset 48f20b in git


Ignore:
Timestamp:
Aug 6, 2019, 3:11:46 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
9102bbc549613cd829348b8de22f634afde32b53
Parents:
48031edf76982bafd335b01e2c649c3d29265c35
Message:
fix: ringlist->ring for real/complex cf.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r48031e r48f20b  
    22522252//  R->cf->ch=0;
    22532253  // ----------------------------------------
    2254   // 1:
     2254  // 0, (r1,r2) [, "i" ]
    22552255  if (L->m[1].rtyp!=LIST_CMD)
    22562256  {
     
    22592259  }
    22602260  lists LL=(lists)L->m[1].data;
    2261   if (((LL->nr!=2)
     2261  if ((LL->nr!=2)
    22622262    || (LL->m[0].rtyp!=INT_CMD)
    22632263    || (LL->m[1].rtyp!=INT_CMD))
    2264   && ((LL->nr!=1)
    2265     || (LL->m[0].rtyp!=INT_CMD)))
    2266   {
    2267     WerrorS("invalid coeff. field description list");
     2264  {
     2265    WerrorS("invalid coeff. field description list, expected list(`int`,`int`)");
    22682266    return;
    22692267  }
    22702268  int r1=(int)(long)LL->m[0].data;
    22712269  int r2=(int)(long)LL->m[1].data;
     2270  r1=si_min(r1,32767);
     2271  r2=si_min(r2,32767);
     2272  LongComplexInfo par; memset(&par, 0, sizeof(par));
     2273  par.float_len=r1;
     2274  par.float_len2=r2;
    22722275  if (L->nr==2) // complex
    2273     R->cf = nInitChar(n_long_C, NULL);
    2274   else if ((r1<=SHORT_REAL_LENGTH)
    2275   && (r2<=SHORT_REAL_LENGTH))
    2276     R->cf = nInitChar(n_R, NULL);
    2277   else
    2278   {
    2279     LongComplexInfo* p = (LongComplexInfo *)omAlloc0(sizeof(LongComplexInfo));
    2280     p->float_len=r1;
    2281     p->float_len2=r2;
    2282     R->cf = nInitChar(n_long_R, p);
    2283   }
    2284 
    2285   if ((r1<=SHORT_REAL_LENGTH)   // should go into nInitChar
    2286   && (r2<=SHORT_REAL_LENGTH))
    2287   {
    2288     R->cf->float_len=SHORT_REAL_LENGTH/2;
    2289     R->cf->float_len2=SHORT_REAL_LENGTH;
    2290   }
    2291   else
    2292   {
    2293     R->cf->float_len=si_min(r1,32767);
    2294     R->cf->float_len2=si_min(r2,32767);
    2295   }
    2296   // ----------------------------------------
    2297   // 2: list (par)
    2298   if (L->nr==2)
    2299   {
    2300     //R->cf->extRing->N=1;
     2276  {
    23012277    if (L->m[2].rtyp!=STRING_CMD)
    23022278    {
     
    23042280      return;
    23052281    }
    2306     //(rParameter(R))=(char**)omAlloc0(rPar(R)*sizeof(char_ptr));
    2307     rParameter(R)[0]=omStrDup((char *)L->m[2].data);
    2308   }
    2309   // ----------------------------------------
     2282    par.par_name=(char*)L->m[2].data;
     2283    R->cf = nInitChar(n_long_C, &par);
     2284  }
     2285  else if ((r1<=SHORT_REAL_LENGTH) && (r2<=SHORT_REAL_LENGTH)) /* && L->nr==1*/
     2286    R->cf = nInitChar(n_R, NULL);
     2287  else /* && L->nr==1*/
     2288  {
     2289    R->cf = nInitChar(n_long_R, &par);
     2290  }
    23102291}
    23112292
Note: See TracChangeset for help on using the changeset viewer.