* define a ring with parameters und change to it * * DefRingPar and DefRingParlp corrupt still memory * ****************************************************/
| 2938 | * DefRingPar and DefRingParlp corrupt still memory * |
| 2939 | ****************************************************/ |
| 2940 | static void DefRingPar(intvec* va) |
| 2941 | { |
| 2942 | int nv = currRing->N; |
| 2943 | int nb = rBlocks(currRing) + 1; |
| 2944 | |
| 2945 | ring res=rCopy0(currRing,FALSE,FALSE); |
| 2946 | |
| 2947 | /*weights: entries for 3 blocks: NULL Made:???*/ |
| 2948 | res->wvhdl = (int **)omAlloc0(nb * sizeof(int_ptr)); |
| 2949 | res->wvhdl[0] = (int*) omAlloc(nv*sizeof(int)); |
| 2950 | for(int i=0; i<nv; i++) |
| 2951 | res->wvhdl[0][i] = (*va)[i]; |
| 2952 | |
| 2953 | /* order: a,lp,C,0 */ |
| 2954 | |
| 2955 | res->order = (rRingOrder_t *) omAlloc(nb * sizeof(rRingOrder_t *)); |
| 2956 | res->block0 = (int *)omAlloc0(nb * sizeof(int *)); |
| 2957 | res->block1 = (int *)omAlloc0(nb * sizeof(int *)); |
| 2958 | |
| 2959 | // ringorder a for the first block: var 1..nv |
| 2960 | res->order[0] = ringorder_a; |
| 2961 | res->block0[0] = 1; |
| 2962 | res->block1[0] = nv; |
| 2963 | |
| 2964 | // ringorder lp for the second block: var 1..nv |
| 2965 | res->order[1] = ringorder_lp; |
| 2966 | res->block0[1] = 1; |
| 2967 | res->block1[1] = nv; |
| 2968 | |
| 2969 | // ringorder C for the third block |
| 2970 | // it is very important within "idLift", |
| 2971 | // especially, by ring syz_ring=rCurrRingAssure_SyzComp(); |
| 2972 | // therefore, nb must be (nBlocks(currRing) + 1) |
| 2973 | res->order[2] = ringorder_C; |
| 2974 | |
| 2975 | // the last block: everything is 0 |
| 2976 | res->order[3] = (rRingOrder_t)0; |
| 2977 | |
| 2978 | // polynomial ring |
| 2979 | res->OrdSgn = 1; |
| 2980 | |
| 2981 | |
| 2982 | // complete ring intializations |
| 2983 | rComplete(res); |
| 2984 | |
| 2985 | // execute the created ring |
| 2986 | rChangeCurrRing(res); |
| 2987 | } |
| 2988 | |
| 2989 | static void DefRingParlp(void) |
| 2990 | { |
no test coverage detected