special implementation for the case that the matrix has non-number, i.e., actual polynomial entries; if i is not the zero pointer than it is assumed to be a std basis (ideal), and the poly matrix is assumed to be already reduced w.r.t. i */
| 127 | if i is not the zero pointer than it is assumed to be a std basis (ideal), |
| 128 | and the poly matrix is assumed to be already reduced w.r.t. i */ |
| 129 | ideal getMinorIdeal_Poly (const poly* polyMatrix, const int rowCount, |
| 130 | const int columnCount, const int minorSize, |
| 131 | const int k, const char* algorithm, |
| 132 | const ideal i, const bool allDifferent) |
| 133 | { |
| 134 | /* setting up a MinorProcessor for matrices with polynomial entries: */ |
| 135 | PolyMinorProcessor mp; |
| 136 | mp.defineMatrix(rowCount, columnCount, polyMatrix); |
| 137 | int *myRowIndices=(int*)omAlloc(rowCount*sizeof(int)); |
| 138 | for (int j = 0; j < rowCount; j++) myRowIndices[j] = j; |
| 139 | int *myColumnIndices=(int*)omAlloc(columnCount*sizeof(int)); |
| 140 | for (int j = 0; j < columnCount; j++) myColumnIndices[j] = j; |
| 141 | mp.defineSubMatrix(rowCount, myRowIndices, columnCount, myColumnIndices); |
| 142 | mp.setMinorSize(minorSize); |
| 143 | |
| 144 | /* containers for all upcoming results: */ |
| 145 | PolyMinorValue theMinor; |
| 146 | poly f = NULL; |
| 147 | int collectedMinors = 0; |
| 148 | |
| 149 | /* the ideal to be returned: */ |
| 150 | ideal iii = idInit(1); |
| 151 | |
| 152 | bool zeroOk = ((k < 0) ? true : false); /* for k = 0, all minors are |
| 153 | requested, omitting zero minors */ |
| 154 | bool duplicatesOk = (allDifferent ? false : true); |
| 155 | int kk = ABS(k); /* absolute value of k */ |
| 156 | #ifdef COUNT_AND_PRINT_OPERATIONS |
| 157 | printCounters ("starting", true); |
| 158 | int qqq = 0; |
| 159 | #endif |
| 160 | /* looping over all minors: */ |
| 161 | while (mp.hasNextMinor() && ((kk == 0) || (collectedMinors < kk))) |
| 162 | { |
| 163 | /* retrieving the next minor: */ |
| 164 | theMinor = mp.getNextMinor(algorithm, i); |
| 165 | #if (defined COUNT_AND_PRINT_OPERATIONS) && (COUNT_AND_PRINT_OPERATIONS > 1) |
| 166 | qqq++; |
| 167 | Print("after %d", qqq); |
| 168 | printCounters ("-th minor", false); |
| 169 | #endif |
| 170 | f = theMinor.getResult(); |
| 171 | if (idInsertPolyWithTests(iii, collectedMinors, pCopy(f), |
| 172 | zeroOk, duplicatesOk)) |
| 173 | collectedMinors++; |
| 174 | } |
| 175 | #ifdef COUNT_AND_PRINT_OPERATIONS |
| 176 | printCounters ("ending", true); |
| 177 | #endif |
| 178 | |
| 179 | /* before we return the result, let's omit zero generators |
| 180 | in iii which come after the computed minors */ |
| 181 | idKeepFirstK(iii, collectedMinors); |
| 182 | omFree(myColumnIndices); |
| 183 | omFree(myRowIndices); |
| 184 | return(iii); |
| 185 | } |
| 186 |
no test coverage detected