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

Function VMatrRefine

Singular/walk.cc:2842–2894  ·  view source on GitHub ↗

* define and execute a new ring with ordering (a(vb),M,C) * ***********************************************************/

Source from the content-addressed store, hash-verified

2840 * define and execute a new ring with ordering (a(vb),M,C) *
2841 ***********************************************************/
2842static ring VMatrRefine(intvec* va, intvec* vb)
2843{
2844
2845 ring r = rCopy0(currRing,FALSE,FALSE);
2846 int i, nv = currRing->N;
2847 int nvs = nv*nv;
2848
2849 int nb = 4;
2850
2851 /*weights: entries for 3 blocks: NULL Made:???*/
2852 r->wvhdl = (int **)omAlloc0(nb * sizeof(int_ptr));
2853 r->wvhdl[0] = (int*) omAlloc(nv*sizeof(int));
2854 r->wvhdl[1] = (int*) omAlloc(nvs*sizeof(int));
2855 r->wvhdl[2]=NULL;
2856 r->wvhdl[3]=NULL;
2857 for(i=0; i<nvs; i++)
2858 {
2859 r->wvhdl[1][i] = (*va)[i];
2860 }
2861 for(i=0; i<nv; i++)
2862 {
2863 r->wvhdl[0][i] = (*vb)[i];
2864 }
2865 /* order: a,lp,C,0 */
2866 r->order = (rRingOrder_t *) omAlloc(nb * sizeof(rRingOrder_t *));
2867 r->block0 = (int *)omAlloc0(nb * sizeof(int *));
2868 r->block1 = (int *)omAlloc0(nb * sizeof(int *));
2869
2870 // ringorder a for the first block: var 1..nv
2871 r->order[0] = ringorder_a;
2872 r->block0[0] = 1;
2873 r->block1[0] = nv;
2874
2875 // ringorder M for the second block: var 1..nv
2876 r->order[1] = ringorder_M;
2877 r->block0[1] = 1;
2878 r->block1[1] = nv;
2879
2880 // ringorder C for the third block: var 1..nv
2881 r->order[2] = ringorder_C;
2882 r->block0[2] = 1;
2883 r->block1[2] = nv;
2884
2885 // the last block: everything is 0
2886 r->order[3] = (rRingOrder_t)0;
2887
2888 // complete ring intializations
2889
2890 rComplete(r);
2891
2892 //rChangeCurrRing(r);
2893 return r;
2894}
2895
2896/**********************************************************************
2897* define and execute a new ring which order is a lexicographic order *

Callers 7

MwalkFunction · 0.85
MrwalkFunction · 0.85
MprwalkFunction · 0.85
rec_fractal_callFunction · 0.85
rec_r_fractal_callFunction · 0.85
MfwalkFunction · 0.85
MfrwalkFunction · 0.85

Calls 3

rCopy0Function · 0.85
omAlloc0Function · 0.85
rCompleteFunction · 0.85

Tested by

no test coverage detected