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

Function VMatrDefault

Singular/walk.cc:2791–2837  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2789 * define and execute a new ring with ordering (M,C) *
2790 *****************************************************/
2791static ring VMatrDefault(intvec* va)
2792{
2793
2794 ring r = rCopy0(currRing,FALSE,FALSE);
2795 int i, nv = currRing->N;
2796
2797 int nb = 4;
2798
2799 /*weights: entries for 3 blocks: NULL Made:???*/
2800 r->wvhdl = (int **)omAlloc0(nb * sizeof(int_ptr));
2801 r->wvhdl[0] = (int*) omAlloc(nv*nv*sizeof(int));
2802 r->wvhdl[1] =NULL; // (int*) omAlloc(nv*sizeof(int));
2803 r->wvhdl[2]=NULL;
2804 r->wvhdl[3]=NULL;
2805 for(i=0; i<nv*nv; i++)
2806 r->wvhdl[0][i] = (*va)[i];
2807
2808 /* order: a,lp,C,0 */
2809 r->order = (rRingOrder_t*) omAlloc(nb * sizeof(rRingOrder_t*));
2810 r->block0 = (int *)omAlloc0(nb * sizeof(int *));
2811 r->block1 = (int *)omAlloc0(nb * sizeof(int *));
2812
2813 // ringorder a for the first block: var 1..nv
2814 r->order[0] = ringorder_M;
2815 r->block0[0] = 1;
2816 r->block1[0] = nv;
2817
2818 // ringorder C for the second block
2819 r->order[1] = ringorder_C;
2820 r->block0[1] = 1;
2821 r->block1[1] = nv;
2822
2823// ringorder C for the third block: var 1..nv
2824 r->order[2] = ringorder_C;
2825 r->block0[2] = 1;
2826 r->block1[2] = nv;
2827
2828 // the last block: everything is 0
2829 r->order[3] = (rRingOrder_t)0;
2830
2831 // complete ring intializations
2832
2833 rComplete(r);
2834
2835 //rChangeCurrRing(r);
2836 return r;
2837}
2838
2839/***********************************************************
2840 * define and execute a new ring with ordering (a(vb),M,C) *

Callers 5

MwalkFunction · 0.85
MrwalkFunction · 0.85
MprwalkFunction · 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