*computes a standard basis for h1 and stores the transformation matrix * in ma */
| 974 | * in ma |
| 975 | */ |
| 976 | ideal idLiftStd (ideal h1, matrix* T, tHomog hi, ideal * S, GbVariant alg, |
| 977 | ideal h11) |
| 978 | { |
| 979 | int inputIsIdeal=id_RankFreeModule(h1,currRing); |
| 980 | long k; |
| 981 | intvec *w=NULL; |
| 982 | |
| 983 | idDelete((ideal*)T); |
| 984 | BOOLEAN lift3=FALSE; |
| 985 | if (S!=NULL) { lift3=TRUE; idDelete(S); } |
| 986 | if (idIs0(h1)) |
| 987 | { |
| 988 | *T=mpNew(1,IDELEMS(h1)); |
| 989 | if (lift3) |
| 990 | { |
| 991 | *S=idFreeModule(IDELEMS(h1)); |
| 992 | } |
| 993 | return idInit(1,h1->rank); |
| 994 | } |
| 995 | |
| 996 | BITSET save2; |
| 997 | SI_SAVE_OPT2(save2); |
| 998 | |
| 999 | k=si_max(1,inputIsIdeal); |
| 1000 | |
| 1001 | if ((!lift3)&&(!TEST_OPT_RETURN_SB)) si_opt_2 |=Sy_bit(V_IDLIFT); |
| 1002 | |
| 1003 | ring orig_ring = currRing; |
| 1004 | ring syz_ring = rAssure_SyzOrder(orig_ring,TRUE); |
| 1005 | rSetSyzComp(k,syz_ring); |
| 1006 | rChangeCurrRing(syz_ring); |
| 1007 | |
| 1008 | ideal s_h1; |
| 1009 | |
| 1010 | if (orig_ring != syz_ring) |
| 1011 | s_h1 = idrCopyR_NoSort(h1,orig_ring,syz_ring); |
| 1012 | else |
| 1013 | s_h1 = h1; |
| 1014 | ideal s_h11=NULL; |
| 1015 | if (h11!=NULL) |
| 1016 | { |
| 1017 | s_h11=idrCopyR_NoSort(h11,orig_ring,syz_ring); |
| 1018 | } |
| 1019 | |
| 1020 | |
| 1021 | ideal s_h3=idPrepare(s_h1,s_h11,hi,k,&w,alg); // main (syz) GB computation |
| 1022 | |
| 1023 | |
| 1024 | if (w!=NULL) delete w; |
| 1025 | if (syz_ring!=orig_ring) |
| 1026 | { |
| 1027 | idDelete(&s_h1); |
| 1028 | if (s_h11!=NULL) idDelete(&s_h11); |
| 1029 | } |
| 1030 | |
| 1031 | if (S!=NULL) (*S)=idInit(IDELEMS(s_h3),IDELEMS(h1)); |
| 1032 | |
| 1033 | s_h3=idExtractG_T_S(s_h3,T,S,k,IDELEMS(h1),inputIsIdeal,orig_ring,syz_ring); |
no test coverage detected