| 455 | } |
| 456 | |
| 457 | ideal getMinorIdealCache (const matrix mat, const int minorSize, const int k, |
| 458 | const ideal iSB, const int cacheStrategy, |
| 459 | const int cacheN, const int cacheW, |
| 460 | const bool allDifferent) |
| 461 | { |
| 462 | /* Note that this method should be replaced by getMinorIdealCache_toBeDone, |
| 463 | to enable faster computations in the case of matrices which contain |
| 464 | only numbers. But so far, this method is not yet usable as it replaces |
| 465 | the numbers by ints which may result in overflows during computations |
| 466 | of minors. */ |
| 467 | int rowCount = mat->nrows; |
| 468 | int columnCount = mat->ncols; |
| 469 | poly* myPolyMatrix = (poly*)(mat->m); |
| 470 | int length = rowCount * columnCount; |
| 471 | poly* nfPolyMatrix = (poly*)omAlloc(length*sizeof(poly)); |
| 472 | ideal iii; /* the ideal to be filled and returned */ |
| 473 | |
| 474 | /* copy all polynomials and reduce them w.r.t. iSB |
| 475 | (if iSB is present, i.e., not the NULL pointer) */ |
| 476 | for (int i = 0; i < length; i++) |
| 477 | { |
| 478 | if (iSB==NULL) |
| 479 | nfPolyMatrix[i] = pCopy(myPolyMatrix[i]); |
| 480 | else |
| 481 | nfPolyMatrix[i] = kNF(iSB, currRing->qideal, myPolyMatrix[i]); |
| 482 | } |
| 483 | |
| 484 | iii = getMinorIdealCache_Poly(nfPolyMatrix, rowCount, columnCount, |
| 485 | minorSize, k, iSB, cacheStrategy, |
| 486 | cacheN, cacheW, allDifferent); |
| 487 | |
| 488 | /* clean up */ |
| 489 | for (int j = 0; j < length; j++) pDelete(&nfPolyMatrix[j]); |
| 490 | omFree(nfPolyMatrix); |
| 491 | |
| 492 | return iii; |
| 493 | } |
| 494 | |
| 495 | ideal getMinorIdealHeuristic (const matrix mat, const int minorSize, |
| 496 | const int k, const ideal iSB, |
no test coverage detected