Changeset 509ea41 in git for Singular/maps_ip.cc
- Timestamp:
- Apr 29, 2005, 6:04:36 PM (18 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
- Children:
- 6d7113d27870d87916efbd6084abc75fa74e64eb
- Parents:
- a09c2a0d411d9ac83fb45653be9dc871cfb79373
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/maps_ip.cc
ra09c2a0 r509ea41 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: maps_ip.cc,v 1. 7 2005-04-18 15:10:06 Singular Exp $ */4 /* $Id: maps_ip.cc,v 1.8 2005-04-29 16:04:36 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - the mapping of polynomials to other rings … … 23 23 #include "prCopy.h" 24 24 25 // define this if you want to use the fast_map routine for mapping ideals 26 #define FAST_MAP 27 28 #ifdef FAST_MAP 29 #include "fast_maps.h" 30 #endif 31 32 25 33 /*2 26 34 * maps the expression w to res, … … 266 274 poly pSubstPoly(poly p, int var, poly image) 267 275 { 276 if (p==NULL) return NULL; 268 277 #ifdef HAVE_PLURAL 269 278 if (rIsPluralRing(currRing)) … … 277 286 theMap->m[var-1]=pCopy(image); 278 287 279 leftv v=(leftv)omAlloc0Bin(sleftv_bin);280 sleftv tmpW;281 memset(&tmpW,0,sizeof(sleftv));282 tmpW.rtyp=POLY_CMD;283 tmpW.data=p;284 288 poly res=NULL; 285 if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,nCopy)) 286 { 287 WerrorS("map failed"); 288 v->data=NULL; 289 } 290 res=(poly)(v->data); 289 #ifdef FAST_MAP 290 if (pGetComp(p)==0) 291 { 292 ideal src_id=idInit(1,1); 293 src_id->m[0]=p; 294 ideal res_id=fast_map(src_id,currRing,(ideal)theMap,currRing); 295 res=res_id->m[0]; 296 res_id->m[0]=NULL; idDelete(&res_id); 297 src_id->m[0]=NULL; idDelete(&src_id); 298 } 299 else 300 #endif 301 { 302 sleftv tmpW; 303 memset(&tmpW,0,sizeof(sleftv)); 304 tmpW.rtyp=POLY_CMD; 305 tmpW.data=p; 306 leftv v=(leftv)omAlloc0Bin(sleftv_bin); 307 if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,nCopy)) 308 { 309 WerrorS("map failed"); 310 v->data=NULL; 311 } 312 res=(poly)(v->data); 313 omFreeBin((ADDRESS)v, sleftv_bin); 314 } 291 315 idDelete((ideal *)(&theMap)); 292 omFreeBin((ADDRESS)v, sleftv_bin);293 316 return res; 294 317 }
Note: See TracChangeset
for help on using the changeset viewer.