 |
My Project
UNKNOWN_GIT_VERSION
|
Go to the documentation of this file.
30 const int length,
int* intArray,
31 poly* nfPolyArray,
int& zeroCounter)
40 nfPolyArray[
i] =
pCopy(polyArray[
i]);
47 if (nfPolyArray[
i] ==
NULL)
54 bool isConstant =
true;
55 for (
int j = 1;
j <= n;
j++)
58 if (!isConstant)
result =
false;
62 if (characteristic != 0) intArray[
i] = intArray[
i] % characteristic;
63 if (intArray[
i] == 0) zeroCounter++;
77 const int columnCount,
const int minorSize,
78 const int k,
const char* algorithm,
79 const ideal
i,
const bool allDifferent)
84 int *myRowIndices=(
int*)
omAlloc(rowCount*
sizeof(
int));
85 for (
int j = 0;
j < rowCount;
j++) myRowIndices[
j] =
j;
86 int *myColumnIndices=(
int*)
omAlloc(columnCount*
sizeof(
int));
87 for (
int j = 0;
j < columnCount;
j++) myColumnIndices[
j] =
j;
88 mp.
defineSubMatrix(rowCount, myRowIndices, columnCount, myColumnIndices);
94 int collectedMinors = 0;
100 bool zeroOk = ((
k < 0) ?
true :
false);
102 bool duplicatesOk = (allDifferent ?
false :
true);
106 while (mp.
hasNextMinor() && ((kk == 0) || (collectedMinors < kk)))
119 if (collectedMinors == 0) jjj =
idInit(1);
132 const int columnCount,
const int minorSize,
133 const int k,
const char* algorithm,
134 const ideal
i,
const bool allDifferent)
139 int *myRowIndices=(
int*)
omAlloc(rowCount*
sizeof(
int));
140 for (
int j = 0;
j < rowCount;
j++) myRowIndices[
j] =
j;
141 int *myColumnIndices=(
int*)
omAlloc(columnCount*
sizeof(
int));
142 for (
int j = 0;
j < columnCount;
j++) myColumnIndices[
j] =
j;
143 mp.
defineSubMatrix(rowCount, myRowIndices, columnCount, myColumnIndices);
149 int collectedMinors = 0;
154 bool zeroOk = ((
k < 0) ?
true :
false);
156 bool duplicatesOk = (allDifferent ?
false :
true);
158 #ifdef COUNT_AND_PRINT_OPERATIONS
163 while (mp.
hasNextMinor() && ((kk == 0) || (collectedMinors < kk)))
167 #if (defined COUNT_AND_PRINT_OPERATIONS) && (COUNT_AND_PRINT_OPERATIONS > 1)
169 Print(
"after %d", qqq);
174 zeroOk, duplicatesOk))
177 #ifdef COUNT_AND_PRINT_OPERATIONS
190 const int k,
const char* algorithm,
191 const ideal
i,
const bool allDifferent)
193 int rowCount = mat->
nrows;
194 int columnCount = mat->
ncols;
195 poly* myPolyMatrix = (poly*)(mat->
m);
201 int* myIntMatrix = (
int*)
omAlloc(rowCount * columnCount *
sizeof(
int));
202 poly* nfPolyMatrix = (poly*)
omAlloc(rowCount * columnCount *
sizeof(poly));
204 myIntMatrix, nfPolyMatrix, zz))
206 algorithm,
i, allDifferent);
209 if ((
k == 0) && (strcmp(algorithm,
"Bareiss") == 0)
223 k, algorithm,
i, allDifferent);
229 for (
int j = 0;
j < rowCount * columnCount;
j++)
pDelete(&nfPolyMatrix[
j]);
241 const char* algorithm,
const ideal iSB,
242 const bool allDifferent)
249 int rowCount = mat->
nrows;
250 int columnCount = mat->
ncols;
251 poly* myPolyMatrix = (poly*)(mat->
m);
252 int length = rowCount * columnCount;
255 if ((
k == 0) && (strcmp(algorithm,
"Bareiss") == 0)
277 nfPolyMatrix[
i] =
kNF(iSB,
currRing->qideal,myPolyMatrix[
i]);
284 nfPolyMatrix[
i] =
pCopy(myPolyMatrix[
i]);
288 k, algorithm, iSB, allDifferent);
305 const int columnCount,
const int minorSize,
306 const int k,
const ideal
i,
307 const int cacheStrategy,
const int cacheN,
308 const int cacheW,
const bool allDifferent)
313 int *myRowIndices=(
int*)
omAlloc(rowCount*
sizeof(
int));
314 for (
int j = 0;
j < rowCount;
j++) myRowIndices[
j] =
j;
315 int *myColumnIndices=(
int*)
omAlloc(columnCount*
sizeof(
int));
316 for (
int j = 0;
j < columnCount;
j++) myColumnIndices[
j] =
j;
317 mp.
defineSubMatrix(rowCount, myRowIndices, columnCount, myColumnIndices);
325 int collectedMinors = 0;
331 bool zeroOk = ((
k < 0) ?
true :
false);
333 bool duplicatesOk = (allDifferent ?
false :
true);
337 while (mp.
hasNextMinor() && ((kk == 0) || (collectedMinors < kk)))
350 if (collectedMinors == 0) jjj =
idInit(1);
363 const int columnCount,
const int minorSize,
364 const int k,
const ideal
i,
365 const int cacheStrategy,
const int cacheN,
366 const int cacheW,
const bool allDifferent)
371 int *myRowIndices=(
int*)
omAlloc(rowCount*
sizeof(
int));
372 for (
int j = 0;
j < rowCount;
j++) myRowIndices[
j] =
j;
373 int *myColumnIndices=(
int*)
omAlloc(columnCount*
sizeof(
int));
374 for (
int j = 0;
j < columnCount;
j++) myColumnIndices[
j] =
j;
375 mp.
defineSubMatrix(rowCount, myRowIndices, columnCount, myColumnIndices);
383 int collectedMinors = 0;
388 bool zeroOk = ((
k < 0) ?
true :
false);
390 bool duplicatesOk = (allDifferent ?
false :
true);
392 #ifdef COUNT_AND_PRINT_OPERATIONS
397 while (mp.
hasNextMinor() && ((kk == 0) || (collectedMinors < kk)))
401 #if (defined COUNT_AND_PRINT_OPERATIONS) && (COUNT_AND_PRINT_OPERATIONS > 1)
403 Print(
"after %d", qqq);
411 #ifdef COUNT_AND_PRINT_OPERATIONS
418 if (collectedMinors == 0) jjj =
idInit(1);
427 const int k,
const ideal iSB,
428 const int cacheStrategy,
const int cacheN,
429 const int cacheW,
const bool allDifferent)
431 int rowCount = mat->
nrows;
432 int columnCount = mat->
ncols;
433 poly* myPolyMatrix = (poly*)(mat->
m);
439 int* myIntMatrix = (
int*)
omAlloc(rowCount * columnCount *
sizeof(
int));
440 poly* nfPolyMatrix = (poly*)
omAlloc(rowCount * columnCount *
sizeof(poly));
442 myIntMatrix, nfPolyMatrix, zz))
444 minorSize,
k, iSB, cacheStrategy, cacheN,
445 cacheW, allDifferent);
448 minorSize,
k, iSB, cacheStrategy, cacheN,
449 cacheW, allDifferent);
453 for (
int j = 0;
j < rowCount * columnCount;
j++)
pDelete(&nfPolyMatrix[
j]);
460 const ideal iSB,
const int cacheStrategy,
461 const int cacheN,
const int cacheW,
462 const bool allDifferent)
469 int rowCount = mat->
nrows;
470 int columnCount = mat->
ncols;
471 poly* myPolyMatrix = (poly*)(mat->
m);
472 int length = rowCount * columnCount;
481 nfPolyMatrix[
i] =
pCopy(myPolyMatrix[
i]);
483 nfPolyMatrix[
i] =
kNF(iSB,
currRing->qideal, myPolyMatrix[
i]);
487 minorSize,
k, iSB, cacheStrategy,
488 cacheN, cacheW, allDifferent);
498 const int k,
const ideal iSB,
499 const bool allDifferent)
528 if (minorSize <= 2)
b =
true;
529 else if (vars <= 2)
b =
true;
536 if (
k != 0)
l =
true;
548 3, 200, 100000, allDifferent);
static void SetRankingStrategy(const int rankingStrategy)
A method for determining the value ranking strategy.
void setMinorSize(const int minorSize)
Sets the size of the minor(s) of interest.
static ideal idCopyFirstK(const ideal ide, const int k)
#define idDelete(H)
delete an ideal
ideal getMinorIdeal_Int(const int *intMatrix, const int rowCount, const int columnCount, const int minorSize, const int k, const char *algorithm, const ideal i, const bool allDifferent)
static BOOLEAN rField_is_Domain(const ring r)
ideal getMinorIdealCache_Poly(const poly *polyMatrix, const int rowCount, const int columnCount, const int minorSize, const int k, const ideal i, const int cacheStrategy, const int cacheN, const int cacheW, const bool allDifferent)
#define pGetExp(p, i)
Exponent.
void idKeepFirstK(ideal id, const int k)
keeps the first k (>= 1) entries of the given ideal (Note that the kept polynomials may be zero....
Compatiblity layer for legacy polynomial operations (over currRing)
bool arrayIsNumberArray(const poly *polyArray, const ideal iSB, const int length, int *intArray, poly *nfPolyArray, int &zeroCounter)
static BOOLEAN length(leftv result, leftv arg)
ideal getMinorIdealHeuristic(const matrix mat, const int minorSize, const int k, const ideal iSB, const bool allDifferent)
Returns the specified set of minors (= subdeterminantes) of the given matrix.
ideal getMinorIdeal_Poly(const poly *polyMatrix, const int rowCount, const int columnCount, const int minorSize, const int k, const char *algorithm, const ideal i, const bool allDifferent)
ideal getMinorIdeal_toBeDone(const matrix mat, const int minorSize, const int k, const char *algorithm, const ideal i, const bool allDifferent)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
ideal getMinorIdealCache_toBeDone(const matrix mat, const int minorSize, const int k, const ideal iSB, const int cacheStrategy, const int cacheN, const int cacheW, const bool allDifferent)
Class PolyMinorProcessor is derived from class MinorProcessor.
void printCounters(char *prefix, bool resetToZero)
Class IntMinorValue is derived from MinorValue and can be used for representing values in a cache for...
static BOOLEAN rField_is_Ring(const ring r)
IntMinorValue getNextMinor(const int characteristic, const ideal &iSB, const char *algorithm)
A method for obtaining the next minor when iterating through all minors of a given size within a pre-...
ideal idMinors(matrix a, int ar, ideal R)
compute all ar-minors of the matrix a the caller of mpRecMin the elements of the result are not in R ...
BOOLEAN idInsertPolyWithTests(ideal h1, const int validEntries, const poly h2, const bool zeroOk, const bool duplicateOk)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
void defineMatrix(const int numberOfRows, const int numberOfColumns, const poly *polyMatrix)
A method for defining a matrix with polynomial entries.
Class IntMinorProcessor is derived from class MinorProcessor.
void defineSubMatrix(const int numberOfRows, const int *rowIndices, const int numberOfColumns, const int *columnIndices)
A method for defining a sub-matrix within a pre-defined matrix.
poly getResult() const
Accessor for the private field _result.
bool hasNextMinor()
A method for checking whether there is a next choice of rows and columns when iterating through all m...
Class PolyMinorValue is derived from MinorValue and can be used for representing values in a cache fo...
ideal getMinorIdealCache(const matrix mat, const int minorSize, const int k, const ideal iSB, const int cacheStrategy, const int cacheN, const int cacheW, const bool allDifferent)
Returns the specified set of minors (= subdeterminantes) of the given matrix.
ideal idInit(int idsize, int rank)
initialise an ideal / module
ideal getMinorIdealCache_Int(const int *intMatrix, const int rowCount, const int columnCount, const int minorSize, const int k, const ideal i, const int cacheStrategy, const int cacheN, const int cacheW, const bool allDifferent)
void defineMatrix(const int numberOfRows, const int numberOfColumns, const int *matrix)
A method for defining a matrix with integer entries.
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
int getResult() const
Accessor for the private field _result.
#define pCopy(p)
return a copy of the poly
Class Cache is a template-implementation of a cache with arbitrary classes for representing keys and ...
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
ideal getMinorIdeal(const matrix mat, const int minorSize, const int k, const char *algorithm, const ideal iSB, const bool allDifferent)
Returns the specified set of minors (= subdeterminantes) of the given matrix.
static BOOLEAN rField_is_Z(const ring r)
PolyMinorValue getNextMinor(const char *algorithm, const ideal &iSB)
A method for obtaining the next minor when iterating through all minors of a given size within a pre-...