MCPcopy Create free account
hub / github.com/Singular/Singular / iiMap

Function iiMap

Singular/ipshell.cc:613–6652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611}
612
613leftv iiMap(map theMap, const char * what)
614{
615 idhdl w,r;
616 leftv v;
617 int i;
618 nMapFunc nMap;
619
620 r=IDROOT->get(theMap->preimage,myynest);
621 if ((currPack!=basePack)
622 &&((r==NULL) || ((r->typ != RING_CMD) )))
623 r=basePack->idroot->get(theMap->preimage,myynest);
624 if ((r==NULL) && (currRingHdl!=NULL)
625 && (strcmp(theMap->preimage,IDID(currRingHdl))==0))
626 {
627 r=currRingHdl;
628 }
629 if ((r!=NULL) && (r->typ == RING_CMD))
630 {
631 ring src_ring=IDRING(r);
632 if ((nMap=n_SetMap(src_ring->cf, currRing->cf))==NULL)
633 {
634 Werror("can not map from ground field of %s to current ground field",
635 theMap->preimage);
636 return NULL;
637 }
638 if (IDELEMS(theMap)<src_ring->N)
639 {
640 theMap->m=(polyset)omReallocSize((ADDRESS)theMap->m,
641 IDELEMS(theMap)*sizeof(poly),
642 (src_ring->N)*sizeof(poly));
643#ifdef HAVE_SHIFTBBA
644 if (rIsLPRing(src_ring))
645 {
646 // src_ring [x,y,z,...]
647 // curr_ring [a,b,c,...]
648 //
649 // map=[a,b,c,d] -> [a,b,c,...]
650 // map=[a,b] -> [a,b,0,...]
651
652 short src_lV = src_ring->isLPring;
653 short src_ncGenCount = src_ring->LPncGenCount;
654 short src_nVars = src_lV - src_ncGenCount;
655 int src_nblocks = src_ring->N / src_lV;
656
657 short dest_nVars = currRing->isLPring - currRing->LPncGenCount;
658 short dest_ncGenCount = currRing->LPncGenCount;
659
660 // add missing NULL generators
661 for(i=IDELEMS(theMap); i < src_lV - src_ncGenCount; i++)
662 {
663 theMap->m[i]=NULL;
664 }
665
666 // remove superfluous generators
667 for(i = src_nVars; i < IDELEMS(theMap); i++)
668 {
669 if (theMap->m[i] != NULL)
670 {

Callers 1

jjMAPFunction · 0.85

Calls 15

n_SetMapFunction · 0.85
WerrorFunction · 0.85
rIsLPRingFunction · 0.85
p_DeleteFunction · 0.85
p_OneFunction · 0.85
p_SetExpFunction · 0.85
p_SetmFunction · 0.85
p_CopyFunction · 0.85
WerrorSFunction · 0.85
omAlloc0BinFunction · 0.85
p_TotaldegreeFunction · 0.85
pTotaldegreeFunction · 0.85

Tested by

no test coverage detected