| 29 | STATIC_VAR scfmon hsecure= NULL; |
| 30 | |
| 31 | scfmon hInit(ideal S, ideal Q, int *Nexist) |
| 32 | { |
| 33 | id_LmTest(S, currRing); |
| 34 | if (Q!=NULL) id_LmTest(Q, currRing); |
| 35 | |
| 36 | hisModule = id_RankFreeModule(S, currRing); |
| 37 | |
| 38 | if (hisModule < 0) |
| 39 | hisModule = 0; |
| 40 | |
| 41 | int sl, ql, i, k = 0; |
| 42 | polyset si, qi, ss; |
| 43 | scfmon ex, ek; |
| 44 | |
| 45 | if (S!=NULL) |
| 46 | { |
| 47 | si = S->m; |
| 48 | sl = IDELEMS(S); |
| 49 | } |
| 50 | else |
| 51 | { |
| 52 | si = NULL; |
| 53 | sl = 0; |
| 54 | } |
| 55 | if (Q!=NULL) |
| 56 | { |
| 57 | qi = Q->m; |
| 58 | ql = IDELEMS(Q); |
| 59 | } |
| 60 | else |
| 61 | { |
| 62 | qi = NULL; |
| 63 | ql = 0; |
| 64 | } |
| 65 | if ((sl + ql) == 0) |
| 66 | { |
| 67 | *Nexist = 0; |
| 68 | return NULL; |
| 69 | } |
| 70 | ss = si; |
| 71 | for (i = sl; i>0; i--) |
| 72 | { |
| 73 | if (*ss!=0) |
| 74 | k++; |
| 75 | ss++; |
| 76 | } |
| 77 | ss = qi; |
| 78 | for (i = ql; i>0; i--) |
| 79 | { |
| 80 | if (*ss!=0) |
| 81 | k++; |
| 82 | ss++; |
| 83 | } |
| 84 | *Nexist = k; |
| 85 | if (k==0) |
| 86 | return NULL; |
| 87 | ek = ex = (scfmon)omAlloc0(k * sizeof(scmon)); |
| 88 | hsecure = (scfmon) omAlloc0(k * sizeof(scmon)); |
no test coverage detected