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

Function lCopy_newstruct

Singular/newstruct.cc:134–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132 }
133}
134lists lCopy_newstruct(lists L)
135{
136 lists N=(lists)omAlloc0Bin(slists_bin);
137 int n=L->nr;
138 ring save_ring=currRing;
139 N->Init(n+1);
140 for(;n>=0;n--)
141 {
142 if (RingDependend(L->m[n].rtyp)
143 ||((L->m[n].rtyp==LIST_CMD)&&lRingDependend((lists)L->m[n].data)))
144 {
145 assume((L->m[n-1].rtyp==RING_CMD) || (L->m[n-1].data==NULL));
146 if(L->m[n-1].data!=NULL)
147 {
148 if (L->m[n-1].data!=(void*)currRing)
149 rChangeCurrRing((ring)(L->m[n-1].data));
150 N->m[n].Copy(&L->m[n]);
151 }
152 else
153 {
154 N->m[n].rtyp=L->m[n].rtyp;
155 N->m[n].data=idrecDataInit(L->m[n].rtyp);
156 }
157 }
158 else if(L->m[n].rtyp==LIST_CMD)
159 {
160 N->m[n].rtyp=L->m[n].rtyp;
161 N->m[n].data=(void *)lCopy((lists)(L->m[n].data));
162 }
163 else if(L->m[n].rtyp>MAX_TOK)
164 {
165 N->m[n].rtyp=L->m[n].rtyp;
166 blackbox *b=getBlackboxStuff(N->m[n].rtyp);
167 N->m[n].data=(void *)b->blackbox_Copy(b,L->m[n].data);
168 }
169 else
170 N->m[n].Copy(&L->m[n]);
171 }
172 if (currRing!=save_ring) rChangeCurrRing(save_ring);
173 return N;
174}
175void * newstruct_Copy(blackbox*, void *d)
176{
177 lists n1=(lists)d;

Callers 2

newstruct_CopyFunction · 0.85
newstruct_Assign_sameFunction · 0.85

Calls 9

omAlloc0BinFunction · 0.85
lRingDependendFunction · 0.85
rChangeCurrRingFunction · 0.85
idrecDataInitFunction · 0.85
lCopyFunction · 0.85
getBlackboxStuffFunction · 0.85
RingDependendFunction · 0.70
InitMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected