| 11076 | } |
| 11077 | |
| 11078 | ring sbaRing (kStrategy strat, const ring r, BOOLEAN /*complete*/, int /*sgn*/) |
| 11079 | { |
| 11080 | int n = rBlocks(r); // Including trailing zero! |
| 11081 | // if sbaOrder == 1 => use (C,monomial order from r) |
| 11082 | if (strat->sbaOrder == 1) |
| 11083 | { |
| 11084 | if (r->order[0] == ringorder_C || r->order[0] == ringorder_c) |
| 11085 | { |
| 11086 | return r; |
| 11087 | } |
| 11088 | ring res = rCopy0(r, TRUE, FALSE); |
| 11089 | res->order = (rRingOrder_t *)omAlloc0((n+1)*sizeof(rRingOrder_t)); |
| 11090 | res->block0 = (int *)omAlloc0((n+1)*sizeof(int)); |
| 11091 | res->block1 = (int *)omAlloc0((n+1)*sizeof(int)); |
| 11092 | int **wvhdl = (int **)omAlloc0((n+1)*sizeof(int*)); |
| 11093 | res->wvhdl = wvhdl; |
| 11094 | for (int i=1; i<n; i++) |
| 11095 | { |
| 11096 | res->order[i] = r->order[i-1]; |
| 11097 | res->block0[i] = r->block0[i-1]; |
| 11098 | res->block1[i] = r->block1[i-1]; |
| 11099 | res->wvhdl[i] = r->wvhdl[i-1]; |
| 11100 | } |
| 11101 | |
| 11102 | // new 1st block |
| 11103 | res->order[0] = ringorder_C; // Prefix |
| 11104 | // removes useless secondary component order if defined in old ring |
| 11105 | for (int i=rBlocks(res); i>0; --i) |
| 11106 | { |
| 11107 | if (res->order[i] == ringorder_C || res->order[i] == ringorder_c) |
| 11108 | { |
| 11109 | res->order[i] = (rRingOrder_t)0; |
| 11110 | } |
| 11111 | } |
| 11112 | rComplete(res, 1); |
| 11113 | #ifdef HAVE_PLURAL |
| 11114 | if (rIsPluralRing(r)) |
| 11115 | { |
| 11116 | if ( nc_rComplete(r, res, false) ) // no qideal! |
| 11117 | { |
| 11118 | #ifndef SING_NDEBUG |
| 11119 | WarnS("error in nc_rComplete"); |
| 11120 | #endif |
| 11121 | // cleanup? |
| 11122 | |
| 11123 | // rDelete(res); |
| 11124 | // return r; |
| 11125 | |
| 11126 | // just go on.. |
| 11127 | } |
| 11128 | } |
| 11129 | #endif |
| 11130 | strat->tailRing = res; |
| 11131 | return (res); |
| 11132 | } |
| 11133 | // if sbaOrder == 3 => degree - position - ring order |
| 11134 | if (strat->sbaOrder == 3) |
| 11135 | { |
no test coverage detected