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

Function maMap_CreateRings

kernel/maps/fast_maps.cc:281–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281void maMap_CreateRings(ideal map_id, ring map_r,
282 ideal image_id, ring image_r,
283 ring &src_r, ring &dest_r, BOOLEAN &simple)
284{
285#if HAVE_SRC_R > 0
286 int* weights = (int*) omAlloc0(map_r->N*sizeof(int));
287 int i;
288 int n = si_min(map_r->N, IDELEMS(image_id));
289
290 for (i=0; i<n; i++)
291 {
292 weights[i] = pLength(image_id->m[i])+1;
293 }
294 src_r = rModifyRing_Wp(map_r, weights);
295#else
296 src_r = map_r;
297#endif
298
299#if HAVE_DEST_R > 0
300 unsigned long maxExp = maGetMaxExp(map_id, map_r, image_id, image_r);
301 if (maxExp <= 1) maxExp = 2;
302 else if (maxExp > (unsigned long) image_r->bitmask)
303 maxExp = (unsigned long) image_r->bitmask;
304 dest_r = rModifyRing_Simple(image_r, TRUE, TRUE, maxExp, simple);
305#else
306 dest_r = image_r;
307#endif
308}
309
310static void maMap_KillRings(ring map_r, ring image_r, ring src_r, ring dest_r)
311{

Callers 1

fast_map_common_subexpFunction · 0.85

Calls 6

omAlloc0Function · 0.85
si_minFunction · 0.85
pLengthFunction · 0.85
rModifyRing_WpFunction · 0.85
maGetMaxExpFunction · 0.85
rModifyRing_SimpleFunction · 0.85

Tested by

no test coverage detected