Changeset e4611fa in git for Singular/maps_ip.cc


Ignore:
Timestamp:
Apr 6, 2004, 5:14:26 PM (20 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
6a33fd790520524415959fe0fa50e769516c1130
Parents:
e1f17c418b7f988342fa9f2397050bd5f3fa2e35
Message:
*hannes: optimization


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

Legend:

Unmodified
Added
Removed
  • Singular/maps_ip.cc

    re1f17c re4611fa  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: maps_ip.cc,v 1.3 2004-04-06 09:13:35 Singular Exp $ */
     4/* $Id: maps_ip.cc,v 1.4 2004-04-06 15:14:26 Singular Exp $ */
    55/*
    66* ABSTRACT - the mapping of polynomials to other rings
     
    300300ideal  idSubstPoly(ideal id, int n, poly e)
    301301{
    302   int k=MATROWS((matrix)id)*MATCOLS((matrix)id);
    303   ideal res=(ideal)mpNew(MATROWS((matrix)id),MATCOLS((matrix)id));
    304 
    305   res->rank = id->rank;
    306   for(k--;k>=0;k--)
    307   {
    308     res->m[k]=pSubstPoly(id->m[k],n,e);
    309   }
     302
     303#ifdef HAVE_PLURAL
     304  if (rIsPluralRing(currRing))
     305  {
     306    int k=MATROWS((matrix)id)*MATCOLS((matrix)id);
     307    ideal res=(ideal)mpNew(MATROWS((matrix)id),MATCOLS((matrix)id));
     308    res->rank = id->rank;
     309    WarnS("not implemented: only substitution only by a monomial");
     310    for(k--;k>=0;k--)
     311    {
     312      res->m[k]=pSubst(pCopy(id->m[k]),n,e);
     313    }
     314    return res;
     315  }
     316#endif
     317  map theMap=(map)idMaxIdeal(1);
     318  theMap->preimage=NULL;
     319  pDelete(&(theMap->m[n-1]));
     320  theMap->m[n-1]=pCopy(e);
     321
     322  leftv v=(leftv)omAlloc0Bin(sleftv_bin);
     323  sleftv tmpW;
     324  memset(&tmpW,0,sizeof(sleftv));
     325  tmpW.rtyp=IDEAL_CMD;
     326  tmpW.data=id;
     327  if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,nCopy))
     328  {
     329    WerrorS("map failed");
     330    v->data=NULL;
     331  }
     332  ideal res=(ideal)(v->data);
     333  idDelete((ideal *)(&theMap));
     334  omFreeBin((ADDRESS)v, sleftv_bin);
    310335  return res;
    311336}
Note: See TracChangeset for help on using the changeset viewer.