Changeset 48f20b in git
- Timestamp:
- Aug 6, 2019, 3:11:46 PM (4 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 9102bbc549613cd829348b8de22f634afde32b53
- Parents:
- 48031edf76982bafd335b01e2c649c3d29265c35
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipshell.cc
r48031e r48f20b 2252 2252 // R->cf->ch=0; 2253 2253 // ---------------------------------------- 2254 // 1:2254 // 0, (r1,r2) [, "i" ] 2255 2255 if (L->m[1].rtyp!=LIST_CMD) 2256 2256 { … … 2259 2259 } 2260 2260 lists LL=(lists)L->m[1].data; 2261 if (( (LL->nr!=2)2261 if ((LL->nr!=2) 2262 2262 || (LL->m[0].rtyp!=INT_CMD) 2263 2263 || (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`)"); 2268 2266 return; 2269 2267 } 2270 2268 int r1=(int)(long)LL->m[0].data; 2271 2269 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; 2272 2275 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 { 2301 2277 if (L->m[2].rtyp!=STRING_CMD) 2302 2278 { … … 2304 2280 return; 2305 2281 } 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 } 2310 2291 } 2311 2292
Note: See TracChangeset
for help on using the changeset viewer.