Changeset 4d5437 in git for Singular/maps_ip.cc


Ignore:
Timestamp:
Jan 20, 2016, 6:46:28 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
c631c329ed487e0ec9b60bd41077ba19cbf17ad3
Parents:
64b03151c6cf3d29b4a4304bab7a66c2b37b5e2d
Message:
maps for ideal revisited: new: maMapIdeal as general routine
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/maps_ip.cc

    r64b0315 r4d5437  
    3636/* debug output: Tok2Cmdname in maApplyFetch*/
    3737#include "ipshell.h"
    38 
    39 // define this if you want to use the fast_map routine for mapping ideals
    40 //#define FAST_MAP
    41 
    42 #ifdef FAST_MAP
    43 #include <polys/monomials/maps.h>
    44 #endif
    4538
    4639/*2
     
    377370  theMap->m[var-1]=pCopy(image);
    378371
    379   poly res=NULL;
    380 #ifdef FAST_MAP
    381   if (pGetComp(p)==0)
    382   {
    383     ideal src_id=idInit(1,1);
    384     src_id->m[0]=p;
    385 
    386     char *tmp = theMap->preimage;
    387     theMap->preimagei=(char*)1L; // map gets 1 as its rank (as an ideal)
    388     ideal res_id=fast_map(src_id,currRing,(ideal)theMap,currRing);
    389     theMap->preimage=tmp; // map gets its preimage back
    390 
    391     res=res_id->m[0];
    392     res_id->m[0]=NULL; idDelete(&res_id);
    393     src_id->m[0]=NULL; idDelete(&src_id);
    394   }
    395   else
    396 #endif
    397   {
    398     sleftv tmpW;
    399     memset(&tmpW,0,sizeof(sleftv));
    400     tmpW.rtyp=POLY_CMD;
    401     tmpW.data=p;
    402     leftv v=(leftv)omAlloc0Bin(sleftv_bin);
    403     if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,
    404                             n_SetMap(currRing->cf, currRing->cf)))
    405     {
    406       WerrorS("map failed");
    407       v->data=NULL;
    408     }
    409     res=(poly)(v->data);
    410     omFreeBin((ADDRESS)v, sleftv_bin);
    411   }
     372  sleftv tmpW;
     373  memset(&tmpW,0,sizeof(sleftv));
     374  tmpW.rtyp=POLY_CMD;
     375  tmpW.data=p;
     376  leftv v=(leftv)omAlloc0Bin(sleftv_bin);
     377  if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,
     378                          n_SetMap(currRing->cf, currRing->cf)))
     379  {
     380    WerrorS("map failed");
     381    v->data=NULL;
     382  }
     383  poly res=(poly)(v->data);
     384  omFreeBin((ADDRESS)v, sleftv_bin);
    412385  idDelete((ideal *)(&theMap));
    413386  return res;
Note: See TracChangeset for help on using the changeset viewer.