Minor.cc
Go to the documentation of this file.
1 
2 
3 
4 #include <kernel/mod2.h>
5 
7 
8 #include <kernel/structs.h>
9 #include <kernel/polys.h>
10 
11 using namespace std;
12 
14 {
15  _numberOfRowBlocks = 0;
16  _numberOfColumnBlocks = 0;
17  delete [] _rowKey;
18  delete [] _columnKey;
19  _rowKey = 0;
20  _columnKey = 0;
21 }
22 
24 {
25  _numberOfRowBlocks = mk.getNumberOfRowBlocks();
26  _numberOfColumnBlocks = mk.getNumberOfColumnBlocks();;
27 
28  /* allocate memory for new entries in _rowKey and _columnKey */
29  _rowKey = new unsigned int[_numberOfRowBlocks];
30  _columnKey = new unsigned int[_numberOfColumnBlocks];
31 
32  /* copying values from parameter arrays to private arrays */
33  for (int r = 0; r < _numberOfRowBlocks; r++)
34  _rowKey[r] = mk.getRowKey(r);
35  for (int c = 0; c < _numberOfColumnBlocks; c++)
36  _columnKey[c] = mk.getColumnKey(c);
37 }
38 
40 {
41  if (_numberOfRowBlocks != 0) delete [] _rowKey;
42  if (_numberOfColumnBlocks != 0) delete [] _columnKey;
43  _numberOfRowBlocks = 0;
44  _numberOfColumnBlocks = 0;
45  _rowKey = 0;
46  _columnKey = 0;
47 
48  _numberOfRowBlocks = mk.getNumberOfRowBlocks();
49  _numberOfColumnBlocks = mk.getNumberOfColumnBlocks();;
50 
51  /* allocate memory for new entries in _rowKey and _columnKey */
52  _rowKey = new unsigned int[_numberOfRowBlocks];
53  _columnKey = new unsigned int[_numberOfColumnBlocks];
54 
55  /* copying values from parameter arrays to private arrays */
56  for (int r = 0; r < _numberOfRowBlocks; r++)
57  _rowKey[r] = mk.getRowKey(r);
58  for (int c = 0; c < _numberOfColumnBlocks; c++)
59  _columnKey[c] = mk.getColumnKey(c);
60 
61  return *this;
62 }
63 
64 void MinorKey::set(const int lengthOfRowArray, const unsigned int* rowKey,
65  const int lengthOfColumnArray,
66  const unsigned int* columnKey)
67 {
68  /* free memory of _rowKey and _columnKey */
69  if (_numberOfRowBlocks > 0) { delete [] _rowKey; }
70  if (_numberOfColumnBlocks > 0) { delete [] _columnKey; }
71 
72  _numberOfRowBlocks = lengthOfRowArray;
73  _numberOfColumnBlocks = lengthOfColumnArray;
74 
75  /* allocate memory for new entries in _rowKey and _columnKey; */
76  _rowKey = new unsigned int[_numberOfRowBlocks];
77  _columnKey = new unsigned int[_numberOfColumnBlocks];
78 
79  /* copying values from parameter arrays to private arrays */
80  for (int r = 0; r < _numberOfRowBlocks; r++)
81  _rowKey[r] = rowKey[r];
82  for (int c = 0; c < _numberOfColumnBlocks; c++)
83  _columnKey[c] = columnKey[c];
84 }
85 
86 MinorKey::MinorKey(const int lengthOfRowArray,
87  const unsigned int* const rowKey,
88  const int lengthOfColumnArray,
89  const unsigned int* const columnKey)
90 {
91  _numberOfRowBlocks = lengthOfRowArray;
92  _numberOfColumnBlocks = lengthOfColumnArray;
93 
94  /* allocate memory for new entries in _rowKey and _columnKey */
95  _rowKey = new unsigned int[_numberOfRowBlocks];
96  _columnKey = new unsigned int[_numberOfColumnBlocks];
97 
98  /* copying values from parameter arrays to private arrays */
99  for (int r = 0; r < _numberOfRowBlocks; r++)
100  _rowKey[r] = rowKey[r];
101 
102  for (int c = 0; c < _numberOfColumnBlocks; c++)
103  _columnKey[c] = columnKey[c];
104 }
105 
107 {
108  _numberOfRowBlocks = 0;
109  _numberOfColumnBlocks = 0;
110  delete [] _rowKey;
111  delete [] _columnKey;
112  _rowKey = 0;
113  _columnKey = 0;
114 }
115 
116 //void MinorKey::print() const
117 //{
118 // PrintS(this->toString().c_str());
119 //}
120 
121 int MinorKey::getAbsoluteRowIndex(const int i) const
122 {
123  /* This method is to return the absolute (0-based) index of the i-th
124  row encoded in \a this.
125  Example: bit-pattern of rows: "10010001101", i = 3:
126  This should yield the 0-based absolute index of the 3-rd bit
127  (counted from the right), i.e. 7. */
128 
129  int matchedBits = -1; /* counter for matched bits;
130  this needs to reach i, then we're done */
131  for (int block = 0; block < getNumberOfRowBlocks(); block ++)
132  {
133  /* start with lowest bits, i.e. in block No. 0 */
134  /* the bits in this block of 32 bits: */
135  unsigned int blockBits = getRowKey(block);
136  unsigned int shiftedBit = 1;
137  int exponent = 0;
138  /* The invariant "shiftedBit = 2^exponent" will hold throughout the
139  entire while loop. */
140  while (exponent < 32)
141  {
142  if (shiftedBit & blockBits) matchedBits++;
143  if (matchedBits == i) return exponent + (32 * block);
144  shiftedBit = shiftedBit << 1;
145  exponent++;
146  }
147  }
148  /* We should never reach this line of code. */
149  assume(false);
150  return -1;
151 }
152 
154 {
155  /* This method is to return the absolute (0-based) index of the i-th
156  column encoded in \a this.
157  Example: bit-pattern of columns: "10010001101", i = 3:
158  This should yield the 0-based absolute index of the 3-rd bit
159  (counted from the right), i.e. 7. */
160 
161  int matchedBits = -1; /* counter for matched bits; this needs to reach i,
162  then we're done */
163  for (int block = 0; block < getNumberOfColumnBlocks(); block ++)
164  {
165  /* start with lowest bits, i.e. in block No. 0 */
166  /* the bits in this block of 32 bits: */
167  unsigned int blockBits = getColumnKey(block);
168  unsigned int shiftedBit = 1;
169  int exponent = 0;
170  /* The invariant "shiftedBit = 2^exponent" will hold throughout the
171  entire while loop. */
172  while (exponent < 32)
173  {
174  if (shiftedBit & blockBits) matchedBits++;
175  if (matchedBits == i) return exponent + (32 * block);
176  shiftedBit = shiftedBit << 1;
177  exponent++;
178  }
179  }
180  /* We should never reach this line of code. */
181  assume(false);
182  return -1;
183 }
184 
185 void MinorKey::getAbsoluteRowIndices(int* const target) const
186 {
187  int i = 0; /* index for filling the target array */
188  for (int block = 0; block < getNumberOfRowBlocks(); block ++)
189  {
190  /* start with lowest bits, i.e. in block No. 0 */
191  /* the bits in this block of 32 bits: */
192  unsigned int blockBits = getRowKey(block);
193  unsigned int shiftedBit = 1;
194  int exponent = 0;
195  /* The invariant "shiftedBit = 2^exponent" will hold throughout the
196  entire while loop. */
197  while (exponent < 32)
198  {
199  if (shiftedBit & blockBits) target[i++] = exponent + (32 * block);
200  shiftedBit = shiftedBit << 1;
201  exponent++;
202  }
203  }
204 }
205 
206 void MinorKey::getAbsoluteColumnIndices(int* const target) const
207 {
208  int i = 0; /* index for filling the target array */
209  for (int block = 0; block < getNumberOfColumnBlocks(); block ++)
210  {
211  /* start with lowest bits, i.e. in block No. 0 */
212  /* the bits in this block of 32 bits: */
213  unsigned int blockBits = getColumnKey(block);
214  unsigned int shiftedBit = 1;
215  int exponent = 0;
216  /* The invariant "shiftedBit = 2^exponent" will hold throughout the
217  entire while loop. */
218  while (exponent < 32)
219  {
220  if (shiftedBit & blockBits) target[i++] = exponent + (32 * block);
221  shiftedBit = shiftedBit << 1;
222  exponent++;
223  }
224  }
225 }
226 
227 int MinorKey::getRelativeRowIndex(const int i) const
228 {
229  /* This method is to return the relative (0-based) index of the row
230  with absolute index \c i.
231  Example: bit-pattern of rows: "10010001101", i = 7:
232  This should yield the 0-based relative index of the bit
233  corresponding to row no. 7, i.e. 3. */
234 
235  int matchedBits = -1; /* counter for matched bits; this is going to
236  contain our return value */
237  for (int block = 0; block < getNumberOfRowBlocks(); block ++)
238  {
239  /* start with lowest bits, i.e. in block No. 0 */
240  /* the bits in this block of 32 bits: */
241  unsigned int blockBits = getRowKey(block);
242  unsigned int shiftedBit = 1;
243  int exponent = 0;
244  /* The invariant "shiftedBit = 2^exponent" will hold throughout the
245  entire while loop. */
246  while (exponent < 32)
247  {
248  if (shiftedBit & blockBits) matchedBits++;
249  if (exponent + (32 * block) == i) return matchedBits;
250  shiftedBit = shiftedBit << 1;
251  exponent++;
252  }
253  }
254  /* We should never reach this line of code. */
255  assume(false);
256  return -1;
257 }
258 
260 {
261  /* This method is to return the relative (0-based) index
262  of the column with absolute index \c i.
263  Example: bit-pattern of columns: "10010001101", i = 7:
264  This should yield the 0-based relative index of the bit
265  corresponding to column no. 7, i.e. 3. */
266 
267  int matchedBits = -1; /* counter for matched bits; this is going
268  to contain our return value */
269  for (int block = 0; block < getNumberOfColumnBlocks(); block ++)
270  {
271  /* start with lowest bits, i.e. in block No. 0 */
272  /* the bits in this block of 32 bits: */
273  unsigned int blockBits = getColumnKey(block);
274  unsigned int shiftedBit = 1;
275  int exponent = 0;
276  /* The invariant "shiftedBit = 2^exponent" will hold
277  throughout the entire while loop. */
278  while (exponent < 32)
279  {
280  if (shiftedBit & blockBits) matchedBits++;
281  if (exponent + (32 * block) == i) return matchedBits;
282  shiftedBit = shiftedBit << 1;
283  exponent++;
284  }
285  }
286  /* We should never reach this line of code. */
287  assume(false);
288  return -1;
289 }
290 
291 unsigned int MinorKey::getRowKey(const int blockIndex) const
292 {
293  return _rowKey[blockIndex];
294 }
295 
296 unsigned int MinorKey::getColumnKey(const int blockIndex) const
297 {
298  return _columnKey[blockIndex];
299 }
300 
302 {
303  return _numberOfRowBlocks;
304 }
305 
307 {
308  return _numberOfColumnBlocks;
309 }
310 
311 #ifndef SING_NDEBUG
312 int MinorKey::getSetBits(const int a) const
313 {
314  int b = 0;
315  if (a == 1)
316  { /* rows */
317  for (int i = 0; i < _numberOfRowBlocks; i++)
318  {
319  unsigned int m = _rowKey[i];
320  unsigned int k = 1;
321  for (int j = 0; j < 32; j++)
322  {
323  /* k = 2^j */
324  if (m & k) b++;
325  k = k << 1;
326  }
327  }
328  }
329  else
330  { /* columns */
331  for (int i = 0; i < _numberOfColumnBlocks; i++)
332  {
333  unsigned int m = _columnKey[i];
334  unsigned int k = 1;
335  for (int j = 0; j < 32; j++)
336  {
337  /* k = 2^j */
338  if (m & k) b++;
339  k = k << 1;
340  }
341  }
342  }
343  return b;
344 }
345 #endif
346 
347 MinorKey MinorKey::getSubMinorKey (const int absoluteEraseRowIndex,
348  const int absoluteEraseColumnIndex) const
349 {
350  int rowBlock = absoluteEraseRowIndex / 32;
351  int exponent = absoluteEraseRowIndex % 32;
352  unsigned int newRowBits = getRowKey(rowBlock) - (1 << exponent);
353  int highestRowBlock = getNumberOfRowBlocks() - 1;
354  /* highestRowBlock will finally contain the highest block index with
355  non-zero bit pattern */
356  if ((newRowBits == 0) && (rowBlock == highestRowBlock))
357  {
358  /* we have thus nullified the highest block;
359  we can now forget about the highest block... */
360  highestRowBlock -= 1;
361  while (getRowKey(highestRowBlock) == 0) /* ...and maybe even some more
362  zero-blocks */
363  highestRowBlock -= 1;
364  }
365  /* highestRowBlock now contains the highest row block index with non-zero
366  bit pattern */
367 
368  int columnBlock = absoluteEraseColumnIndex / 32;
369  exponent = absoluteEraseColumnIndex % 32;
370  unsigned int newColumnBits = getColumnKey(columnBlock) - (1 << exponent);
371  int highestColumnBlock = getNumberOfColumnBlocks() - 1;
372  /* highestColumnBlock will finally contain the highest block index with
373  non-zero bit pattern */
374  if ((newColumnBits == 0) && (columnBlock == highestColumnBlock))
375  {
376  /* we have thus nullified the highest block;
377  we can now forget about the highest block... */
378  highestColumnBlock -= 1;
379  while (getColumnKey(highestColumnBlock) == 0) /* ...and maybe even some
380  more zero-blocks */
381  highestColumnBlock -= 1;
382  }
383  /* highestColumnBlock now contains the highest column block index with
384  non-zero bit pattern */
385 
386  MinorKey result(highestRowBlock + 1, _rowKey, highestColumnBlock + 1,
387  _columnKey);
388  /* This is just a copy with maybe some leading bit blocks omitted. We still
389  need to re-define the row block at index 'rowBlock' and the column block
390  at index 'columnBlock': */
391  if ((newRowBits != 0) || (rowBlock < getNumberOfRowBlocks() - 1))
392  result.setRowKey(rowBlock, newRowBits);
393  if ((newColumnBits != 0) || (columnBlock < getNumberOfColumnBlocks() - 1))
394  result.setColumnKey(columnBlock, newColumnBits);
395 
396  /* let's check that the number of selected rows and columns are equal;
397  (this check is only performed in the debug version) */
398  assume(result.getSetBits(1) == result.getSetBits(2));
399 
400  return result;
401 }
402 
403 void MinorKey::setRowKey (const int blockIndex, const unsigned int rowKey)
404 {
405  _rowKey[blockIndex] = rowKey;
406 }
407 
408 void MinorKey::setColumnKey (const int blockIndex,
409  const unsigned int columnKey)
410 {
411  _columnKey[blockIndex] = columnKey;
412 }
413 
414 int MinorKey::compare (const MinorKey& that) const
415 {
416  /* compare by rowKeys first; in case of equality, use columnKeys */
417  if (this->getNumberOfRowBlocks() < that.getNumberOfRowBlocks())
418  return -1;
419  if (this->getNumberOfRowBlocks() > that.getNumberOfRowBlocks())
420  return 1;
421  /* Here, numbers of rows are equal. */
422  for (int r = this->getNumberOfRowBlocks() - 1; r >= 0; r--)
423  {
424  if (this->getRowKey(r) < that.getRowKey(r)) return -1;
425  if (this->getRowKey(r) > that.getRowKey(r)) return 1;
426  }
427  /* Here, this and that encode ecaxtly the same sets of rows.
428  Now, we take a look at the columns. */
429  if (this->getNumberOfColumnBlocks() < that.getNumberOfColumnBlocks())
430  return -1;
431  if (this->getNumberOfColumnBlocks() > that.getNumberOfColumnBlocks())
432  return 1;
433  /* Here, numbers of columns are equal. */
434  for (int c = this->getNumberOfColumnBlocks() - 1; c >= 0; c--)
435  {
436  if (this->getColumnKey(c) < that.getColumnKey(c)) return -1;
437  if (this->getColumnKey(c) > that.getColumnKey(c)) return 1;
438  }
439  /* Here, this and that encode exactly the same sets of rows and columns. */
440  return 0;
441 }
442 
443 /* just to make the compiler happy;
444  this method should never be called */
445 bool MinorKey::operator==(const MinorKey& mk) const
446 {
447  assume(false);
448  return this->compare(mk) == 0;
449 }
450 
451 /* just to make the compiler happy;
452  this method should never be called */
453 bool MinorKey::operator<(const MinorKey& mk) const
454 {
455  assume(false);
456  return this->compare(mk) == -1;
457 }
458 
459 void MinorKey::selectFirstRows (const int k, const MinorKey& mk)
460 {
461  int hitBits = 0; /* the number of bits we have hit; in the end, this
462  has to be equal to k, the dimension of the minor */
463  int blockIndex = -1; /* the index of the current int in mk */
464  unsigned int highestInt = 0; /* the new highest block of this MinorKey */
465  /* We determine which ints of mk we can copy. Their indices will be
466  0, 1, ..., blockIndex - 1. And highestInt is going to capture the highest
467  int (which may be only a portion of the corresponding int in mk.
468  We loop until hitBits = k: */
469  while (hitBits < k)
470  {
471  blockIndex++;
472  highestInt = 0;
473  unsigned int currentInt = mk.getRowKey(blockIndex);
474  unsigned int shiftedBit = 1;
475  int exponent = 0;
476  /* invariant in the loop: shiftedBit = 2^exponent */
477  while (exponent < 32 && hitBits < k)
478  {
479  if (shiftedBit & currentInt)
480  {
481  highestInt += shiftedBit;
482  hitBits++;
483  }
484  shiftedBit = shiftedBit << 1;
485  exponent++;
486  }
487  }
488  /* free old memory */
489  delete [] _rowKey; _rowKey = 0;
490  _numberOfRowBlocks = blockIndex + 1;
491  /* allocate memory for new entries in _rowKey; */
492  _rowKey = new unsigned int[_numberOfRowBlocks];
493  /* copying values from mk to this MinorKey */
494  for (int r = 0; r < blockIndex; r++)
495  _rowKey[r] = mk.getRowKey(r);
496  _rowKey[blockIndex] = highestInt;
497 }
498 
499 void MinorKey::selectFirstColumns (const int k, const MinorKey& mk)
500 {
501  int hitBits = 0; /* the number of bits we have hit; in the end, this
502  has to be equal to k, the dimension of the minor */
503  int blockIndex = -1; /* the index of the current int in mk */
504  unsigned int highestInt = 0; /* the new highest block of this MinorKey */
505  /* We determine which ints of mk we can copy. Their indices will be
506  0, 1, ..., blockIndex - 1. And highestInt is going to capture the highest
507  int (which may be only a portion of the corresponding int in mk.
508  We loop until hitBits = k: */
509  while (hitBits < k)
510  {
511  blockIndex++;
512  highestInt = 0;
513  unsigned int currentInt = mk.getColumnKey(blockIndex);
514  unsigned int shiftedBit = 1;
515  int exponent = 0;
516  /* invariant in the loop: shiftedBit = 2^exponent */
517  while (exponent < 32 && hitBits < k)
518  {
519  if (shiftedBit & currentInt)
520  {
521  highestInt += shiftedBit;
522  hitBits++;
523  }
524  shiftedBit = shiftedBit << 1;
525  exponent++;
526  }
527  }
528  /* free old memory */
529  delete [] _columnKey; _columnKey = 0;
530  _numberOfColumnBlocks = blockIndex + 1;
531  /* allocate memory for new entries in _columnKey; */
532  _columnKey = new unsigned int[_numberOfColumnBlocks];
533  /* copying values from mk to this MinorKey */
534  for (int c = 0; c < blockIndex; c++)
535  _columnKey[c] = mk.getColumnKey(c);
536  _columnKey[blockIndex] = highestInt;
537 }
538 
539 bool MinorKey::selectNextRows (const int k, const MinorKey& mk)
540 {
541  /* We need to compute the set of k rows which must all be contained in mk.
542  AND: This set must be the least possible of this kind which is larger
543  than the currently encoded set of rows. (Here, '<' is w.r.t. to the
544  natural ordering on multi-indices.
545  Example: mk encodes the rows according to the bit pattern 11010111,
546  k = 3, this MinorKey encodes 10010100. Then, the method must
547  shift the set of rows in this MinorKey to 11000001 (, and
548  return true). */
549 
550  /* The next two variables will finally name a row which is
551  (1) currently not yet among the rows in this MinorKey, but
552  (2) among the rows in mk, and
553  (3) which is "higher" than the lowest row in this MinorKey, and
554  (4) which is the lowest possible choice such that (1) - (3) hold.
555  If we should not be able to find such a row, then there is no next
556  subset of rows. In this case, the method will return false; otherwise
557  always true. */
558  int newBitBlockIndex = 0; /* the block index of the bit */
559  unsigned int newBitToBeSet = 0; /* the bit as 2^e, where 0 <= e <= 31 */
560 
561  /* number of ints (representing rows) in this MinorKey: */
562  int blockCount = this->getNumberOfRowBlocks();
563  /* for iterating along the blocks of mk: */
564  int mkBlockIndex = mk.getNumberOfRowBlocks();
565 
566  int hitBits = 0; /* the number of bits we have hit */
567  int bitCounter = 0; /* for storing the number of bits hit before a
568  specific moment; see below */
569  while (hitBits < k)
570  {
571  mkBlockIndex--;
572  unsigned int currentInt = mk.getRowKey(mkBlockIndex);
573  unsigned int shiftedBit = 1 << 31; /* initially, this equals 2^31, i.e.
574  the highest bit */
575  while (hitBits < k && shiftedBit > 0)
576  {
577  if ((blockCount - 1 >= mkBlockIndex) &&
578  (shiftedBit & this->getRowKey(mkBlockIndex))) hitBits++;
579  else if (shiftedBit & currentInt)
580  {
581  newBitToBeSet = shiftedBit;
582  newBitBlockIndex = mkBlockIndex;
583  bitCounter = hitBits; /* So, whenever we set newBitToBeSet, we want
584  to remember the momentary number of hit
585  bits. This will later be needed; see below. */
586  }
587  shiftedBit = shiftedBit >> 1;
588  }
589  }
590  if (newBitToBeSet == 0)
591  {
592  return false;
593  }
594  else
595  {
596  /* Note that the following must hold when reaching this line of code:
597  (1) The row with bit newBitToBeSet in this->getRowKey(newBitBlockIndex)
598  is currently not among the rows in this MinorKey, but
599  (2) it is among the rows in mk, and
600  (3) it is higher than the lowest row in this MinorKey, and
601  (4) it is the lowest possible choice such that (1) - (3) hold.
602  In the above example, we would reach this line with
603  newBitToBeSet == 2^6 and bitCounter == 1 (resulting from the bit 2^7).
604  */
605 
606  if (blockCount - 1 < newBitBlockIndex)
607  { /* In this case, _rowKey is too small. */
608  /* free old memory */
609  delete [] _rowKey; _rowKey = 0;
610  _numberOfRowBlocks = newBitBlockIndex + 1;
611  /* allocate memory for new entries in _rowKey; */
612  _rowKey = new unsigned int[_numberOfRowBlocks];
613  /* initializing entries to zero */
614  for (int r = 0; r < _numberOfRowBlocks; r++) _rowKey[r] = 0;
615  }
616  else
617  {
618  /* We need to delete all bits in _rowKey[newBitBlockIndex] that are
619  below newBitToBeSet: */
620  unsigned int anInt = this->getRowKey(newBitBlockIndex);
621  unsigned int deleteBit = newBitToBeSet >> 1; // in example: = 2^5
622  while (deleteBit > 0)
623  {
624  if (anInt & deleteBit) anInt -= deleteBit;
625  deleteBit = deleteBit >> 1;
626  };
627  _rowKey[newBitBlockIndex] = anInt;
628  /* ...and we delete all entries in _rowKey[i] for
629  0 <= i < newBitBlockIndex */
630  for (int i = 0; i < newBitBlockIndex; i++)
631  _rowKey[i] = 0;
632  }
633 
634  /* We have now deleted all bits from _rowKey[...] below the bit
635  2^newBitToBeSet.
636  In the example we shall have at this point: _rowKey[...] = 10000000.
637  Now let's set the new bit: */
638  _rowKey[newBitBlockIndex] += newBitToBeSet;
639  /* in the example: _rowKey[newBitBlockIndex] = 11000000 */
640  bitCounter++; /* This is now the number of correct bits in _rowKey[...];
641  i.e. in the example this will be equal to 2. */
642 
643  /* Now we only need to fill _rowKey[...] with the lowest possible bits
644  until it consists of exactly k bits. (We know that we need to set
645  exactly (k - bitCounter) additional bits.) */
646  mkBlockIndex = -1;
647  while (bitCounter < k)
648  {
649  mkBlockIndex++;
650  unsigned int currentInt = mk.getRowKey(mkBlockIndex);
651  unsigned int shiftedBit = 1;
652  int exponent = 0;
653  /* invariant: shiftedBit = 2^exponent */
654  while (bitCounter < k && exponent < 32)
655  {
656  if (shiftedBit & currentInt)
657  {
658  _rowKey[mkBlockIndex] += shiftedBit;
659  bitCounter++;
660  };
661  shiftedBit = shiftedBit << 1;
662  exponent++;
663  }
664  };
665  /* in the example, we shall obtain _rowKey[...] = 11000001 */
666  return true;
667  }
668 }
669 
670 bool MinorKey::selectNextColumns (const int k, const MinorKey& mk)
671 {
672  /* We need to compute the set of k columns which must all be contained in mk.
673  AND: This set must be the least possible of this kind which is larger
674  than the currently encoded set of columns. (Here, '<' is w.r.t. to
675  the natural ordering on multi-indices.
676  Example: mk encodes the columns according to the bit pattern 11010111,
677  k = 3, this MinorKey encodes 10010100. Then, the method must
678  shift the set of columns in this MinorKey to 11000001 (, and
679  return true). */
680 
681  /* The next two variables will finally name a column which is
682  (1) currently not yet among the columns in this MinorKey, but
683  (2) among the columns in mk, and
684  (3) which is "higher" than the lowest column in this MinorKey, and
685  (4) which is the lowest possible choice such that (1) - (3) hold.
686  If we should not be able to find such a column, then there is no next
687  subset of columns. In this case, the method will return false; otherwise
688  always true. */
689  int newBitBlockIndex = 0; /* the block index of the bit */
690  unsigned int newBitToBeSet = 0; /* the bit as 2^e, where 0 <= e <= 31 */
691 
692  /* number of ints (representing columns) in this MinorKey: */
693  int blockCount = this->getNumberOfColumnBlocks();
694  /* for iterating along the blocks of mk: */
695  int mkBlockIndex = mk.getNumberOfColumnBlocks();
696 
697  int hitBits = 0; /* the number of bits we have hit */
698  int bitCounter = 0; /* for storing the number of bits hit before a specific
699  moment; see below */
700  while (hitBits < k)
701  {
702  mkBlockIndex--;
703  unsigned int currentInt = mk.getColumnKey(mkBlockIndex);
704  unsigned int shiftedBit = 1 << 31; /* initially, this equals 2^31, i.e.
705  the highest bit */
706  while (hitBits < k && shiftedBit > 0)
707  {
708  if ((blockCount - 1 >= mkBlockIndex) &&
709  (shiftedBit & this->getColumnKey(mkBlockIndex))) hitBits++;
710  else if (shiftedBit & currentInt)
711  {
712  newBitToBeSet = shiftedBit;
713  newBitBlockIndex = mkBlockIndex;
714  bitCounter = hitBits; /* So, whenever we set newBitToBeSet, we want to
715  remember the momentary number of hit bits.
716  This will later be needed; see below. */
717  }
718  shiftedBit = shiftedBit >> 1;
719  }
720  }
721  if (newBitToBeSet == 0)
722  {
723  return false;
724  }
725  else
726  {
727  /* Note that the following must hold when reaching this line of code:
728  (1) The column with bit newBitToBeSet in
729  this->getColumnKey(newBitBlockIndex) is currently not among the
730  columns in this MinorKey, but
731  (2) it is among the columns in mk, and
732  (3) it is higher than the lowest columns in this MinorKey, and
733  (4) it is the lowest possible choice such that (1) - (3) hold.
734  In the above example, we would reach this line with
735  newBitToBeSet == 2^6 and bitCounter == 1 (resulting from the bit 2^7).
736  */
737 
738  if (blockCount - 1 < newBitBlockIndex)
739  { /* In this case, _columnKey is too small. */
740  /* free old memory */
741  delete [] _columnKey; _columnKey = 0;
742  _numberOfColumnBlocks = newBitBlockIndex + 1;
743  /* allocate memory for new entries in _columnKey; */
744  _columnKey = new unsigned int[_numberOfColumnBlocks];
745  /* initializing entries to zero */
746  for (int c = 0; c < _numberOfColumnBlocks; c++) _columnKey[c] = 0;
747  }
748  else
749  {
750  /* We need to delete all bits in _columnKey[newBitBlockIndex] that are
751  below newBitToBeSet: */
752  unsigned int anInt = this->getColumnKey(newBitBlockIndex);
753  unsigned int deleteBit = newBitToBeSet >> 1; /* in example: = 2^5 */
754  while (deleteBit > 0)
755  {
756  if (anInt & deleteBit) anInt -= deleteBit;
757  deleteBit = deleteBit >> 1;
758  };
759  _columnKey[newBitBlockIndex] = anInt;
760  /* ...and we delete all entries in _columnKey[i] fo
761  0 <= i < newBitBlockIndex */
762  for (int i = 0; i < newBitBlockIndex; i++)
763  _columnKey[i] = 0;
764  }
765  /* We have now deleted all bits from _columnKey[...] below the bit
766  2^newBitToBeSet. In the example we shall have at this point:
767  _columnKey[...] = 10000000. Now let's set the new bit: */
768  _columnKey[newBitBlockIndex] += newBitToBeSet;
769  /* in the example: _columnKey[newBitBlockIndex] = 11000000 */
770  bitCounter++; /* This is now the number of correct bits in
771  _columnKey[...]; i.e. in the example this will be equal
772  to 2. */
773 
774  /* Now we only need to fill _columnKey[...] with the lowest possible bits
775  until it consists of exactly k bits. (We know that we need to set
776  exactly (k - bitCounter) additional bits.) */
777  mkBlockIndex = -1;
778  while (bitCounter < k)
779  {
780  mkBlockIndex++;
781  unsigned int currentInt = mk.getColumnKey(mkBlockIndex);
782  unsigned int shiftedBit = 1;
783  int exponent = 0;
784  /* invariant: shiftedBit = 2^exponent */
785  while (bitCounter < k && exponent < 32)
786  {
787  if (shiftedBit & currentInt)
788  {
789  _columnKey[mkBlockIndex] += shiftedBit;
790  bitCounter++;
791  };
792  shiftedBit = shiftedBit << 1;
793  exponent++;
794  }
795  };
796  /* in the example, we shall obtain _columnKey[...] = 11000001 */
797  return true;
798  }
799 }
800 
801 string MinorKey::toString() const
802 { return ""; }
803 /*
804  string t;
805  string s = "(";
806  unsigned int z = 0;
807  for (int r = this->getNumberOfRowBlocks() - 1; r >= 0; r--)
808  {
809  t = "";
810  z = this->getRowKey(r);
811  while (z != 0)
812  {
813  if ((z % 2) != 0) t = "1" + t; else t = "0" + t;
814  z = z / 2;
815  }
816  if (r < this->getNumberOfRowBlocks() - 1)
817  t = string(32 - t.length(), '0') + t;
818  s += t;
819  }
820  s += ", ";
821  for (int c = this->getNumberOfColumnBlocks() - 1; c >= 0; c--)
822  {
823  t = "";
824  z = this->getColumnKey(c);
825  while (z != 0)
826  {
827  if ((z % 2) != 0) t = "1" + t; else t = "0" + t;
828  z = z / 2;
829  }
830  if (c < this->getNumberOfColumnBlocks() - 1)
831  t = string(32 - t.length(), '0') + t;
832  s += t;
833  }
834  s += ")";
835  return s;
836 }
837 */
838 
840 
842 {
843  assume(false); /* must be overridden in derived classes */
844  return 0;
845 }
846 
847 /* just to make the compiler happy;
848  this method should never be called */
849 bool MinorValue::operator==(const MinorValue& mv) const
850 {
851  assume(false);
852  return (this == &mv); /* compare addresses of both objects */
853 }
854 
855 string MinorValue::toString () const
856 {
857  assume(false); /* must be overridden in derived classes */
858  return "";
859 }
860 
861 /* just to make the compiler happy;
862  this method should never be called */
863 bool MinorValue::operator<(const MinorValue& mv) const
864 {
865  assume(false);
866  return (this < &mv); /* compare addresses of both objects */
867 }
868 
870 {
871  return _retrievals;
872 }
873 
875 {
876  _retrievals++;
877 }
878 
880 {
881  return _potentialRetrievals;
882 }
883 
885 {
886  return _multiplications;
887 }
888 
890 {
891  return _additions;
892 }
893 
895 {
896  return _accumulatedMult;
897 }
898 
900 {
901  return _accumulatedSum;
902 }
903 
904 void MinorValue::print() const
905 {
906  PrintS(this->toString().c_str());
907 }
908 
909 
910 void MinorValue::SetRankingStrategy (const int rankingStrategy)
911 {
912  g_rankingStrategy = rankingStrategy;
913  //if (g_rankingStrategy == 6) : rand() is never used
914  //{
915  // /* initialize the random generator with system time */
916  // srand ( time(NULL) );
917  //}
918 }
919 
921 {
922  return g_rankingStrategy;
923 }
924 
925 /* this is for generically accessing the rank measure regardless of
926  which strategy has been set */
928 {
929  switch (this->GetRankingStrategy())
930  {
931  case 1: return this->rankMeasure1();
932  case 2: return this->rankMeasure2();
933  case 3: return this->rankMeasure3();
934  case 4: return this->rankMeasure4();
935  case 5: return this->rankMeasure5();
936  default: return this->rankMeasure1();
937  }
938 }
939 
940 /* here are some sensible caching strategies: */
942 {
943  /* number of actually performed multiplications */
944  return this->getMultiplications();
945 }
946 
948 {
949  /* accumulated number of performed multiplications, i.e. all including
950  nested multiplications */
951  return this->getAccumulatedMultiplications();
952 }
953 
955 {
956  /* number of performed multiplications, weighted with the ratio of
957  not yet performed retrievals over the maximal number of retrievals */
958  return this->getMultiplications()
959  * (this->getPotentialRetrievals()
960  - this->getRetrievals())
961  / this->getPotentialRetrievals();
962 }
963 
965 {
966  /* number of performed multiplications,
967  multiplied with the number of not yet performed retrievals */
968  return this->getMultiplications()
969  * (this->getPotentialRetrievals()
970  - this->getRetrievals());
971 }
972 
974 {
975  /* number of not yet performed retrievals;
976  tends to cache entries longer when they are going to be retrieved more
977  often in the future */
978  return this->getPotentialRetrievals() - this->getRetrievals();
979 }
980 
982 {
983  /* put measure for size of MinorValue here, i.e. number of monomials in
984  polynomial; so far, we use the accumulated number of multiplications
985  (i.e., including all nested ones) to simmulate the size of a polynomial */
986  return _accumulatedMult;
987 }
988 
989 IntMinorValue::IntMinorValue (const int result, const int multiplications,
990  const int additions,
991  const int accumulatedMultiplications,
992  const int accumulatedAdditions,
993  const int retrievals,
994  const int potentialRetrievals)
995 {
996  _result = result;
997  _multiplications = multiplications;
998  _additions = additions;
999  _accumulatedMult = accumulatedMultiplications;
1000  _accumulatedSum = accumulatedAdditions;
1001  _potentialRetrievals = potentialRetrievals;
1002  _retrievals = retrievals;
1003 }
1004 
1006 {
1007  _result = -1;
1008  _multiplications = -1;
1009  _additions = -1;
1010  _accumulatedMult = -1;
1011  _accumulatedSum = -1;
1012  _potentialRetrievals = -1;
1013  _retrievals = -1;
1014 }
1015 
1017 {
1018 }
1019 
1021 {
1022  return _result;
1023 }
1024 
1026 {
1027  char h[10];
1028 
1029  /* Let's see whether a cache has been used to compute this MinorValue: */
1030  bool cacheHasBeenUsed = true;
1031  if (this->getRetrievals() == -1) cacheHasBeenUsed = false;
1032 
1033  sprintf(h, "%d", this->getResult());
1034  string s = h;
1035  s += " [retrievals: ";
1036  if (cacheHasBeenUsed) { sprintf(h, "%d", this->getRetrievals()); s += h; }
1037  else s += "/";
1038  s += " (of ";
1039  if (cacheHasBeenUsed)
1040  {
1041  sprintf(h, "%d", this->getPotentialRetrievals());
1042  s += h;
1043  }
1044  else s += "/";
1045  s += "), *: ";
1046  sprintf(h, "%d", this->getMultiplications()); s += h;
1047  s += " (accumulated: ";
1048  sprintf(h, "%d", this->getAccumulatedMultiplications()); s += h;
1049  s += "), +: ";
1050  sprintf(h, "%d", this->getAdditions()); s += h;
1051  s += " (accumulated: ";
1052  sprintf(h, "%d", this->getAccumulatedAdditions()); s += h;
1053  s += "), rank: ";
1054  if (cacheHasBeenUsed) { sprintf(h, "%d", this->getUtility()); s += h; }
1055  else s += "/";
1056  s += "]";
1057  return s;
1058 }
1059 
1061 {
1062  _result = mv.getResult();
1063  _retrievals = mv.getRetrievals();
1064  _potentialRetrievals = mv.getPotentialRetrievals();
1065  _multiplications = mv.getMultiplications();
1066  _additions = mv.getAdditions();
1067  _accumulatedMult = mv.getAccumulatedMultiplications();
1068  _accumulatedSum = mv.getAccumulatedAdditions();
1069 }
1070 
1071 PolyMinorValue::PolyMinorValue (const poly result, const int multiplications,
1072  const int additions,
1073  const int accumulatedMultiplications,
1074  const int accumulatedAdditions,
1075  const int retrievals,
1076  const int potentialRetrievals)
1077 {
1078  _result = pCopy(result);
1079  _multiplications = multiplications;
1080  _additions = additions;
1081  _accumulatedMult = accumulatedMultiplications;
1082  _accumulatedSum = accumulatedAdditions;
1083  _potentialRetrievals = potentialRetrievals;
1084  _retrievals = retrievals;
1085 }
1086 
1088 {
1089  _result = NULL;
1090  _multiplications = -1;
1091  _additions = -1;
1092  _accumulatedMult = -1;
1093  _accumulatedSum = -1;
1094  _potentialRetrievals = -1;
1095  _retrievals = -1;
1096 }
1097 
1099 {
1100  p_Delete(&_result, currRing);
1101 }
1102 
1104 {
1105  return _result;
1106 }
1107 
1109 {
1110  /* put measure for size of PolyMinorValue here, e.g. the number of monomials
1111  in the cached polynomial */
1112  return pLength(_result); // the number of monomials in the polynomial
1113 }
1114 
1116 {
1117  char h[20];
1118 
1119  /* Let's see whether a cache has been used to compute this MinorValue: */
1120  bool cacheHasBeenUsed = true;
1121  if (this->getRetrievals() == -1) cacheHasBeenUsed = false;
1122 
1123  string s = pString(_result);
1124  s += " [retrievals: ";
1125  if (cacheHasBeenUsed) { sprintf(h, "%d", this->getRetrievals()); s += h; }
1126  else s += "/";
1127  s += " (of ";
1128  if (cacheHasBeenUsed)
1129  {
1130  sprintf(h, "%d", this->getPotentialRetrievals());
1131  s += h;
1132  }
1133  else s += "/";
1134  s += "), *: ";
1135  sprintf(h, "%d", this->getMultiplications()); s += h;
1136  s += " (accumulated: ";
1137  sprintf(h, "%d", this->getAccumulatedMultiplications()); s += h;
1138  s += "), +: ";
1139  sprintf(h, "%d", this->getAdditions()); s += h;
1140  s += " (accumulated: ";
1141  sprintf(h, "%d", this->getAccumulatedAdditions()); s += h;
1142  s += "), rank: ";
1143  if (cacheHasBeenUsed) { sprintf(h, "%d", this->getUtility()); s += h; }
1144  else s += "/";
1145  s += "]";
1146  return s;
1147 }
1148 
1150 {
1151  _result = pCopy(mv.getResult());
1152  _retrievals = mv.getRetrievals();
1153  _potentialRetrievals = mv.getPotentialRetrievals();
1154  _multiplications = mv.getMultiplications();
1155  _additions = mv.getAdditions();
1156  _accumulatedMult = mv.getAccumulatedMultiplications();
1157  _accumulatedSum = mv.getAccumulatedAdditions();
1158 }
1159 
1161 {
1162  if (_result != mv.getResult()) pDelete(&_result);
1163  _result = pCopy(mv.getResult());
1164  _retrievals = mv.getRetrievals();
1165  _potentialRetrievals = mv.getPotentialRetrievals();
1166  _multiplications = mv.getMultiplications();
1167  _additions = mv.getAdditions();
1168  _accumulatedMult = mv.getAccumulatedMultiplications();
1169  _accumulatedSum = mv.getAccumulatedAdditions();
1170 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
char * pString(poly p)
Definition: polys.h:288
PolyMinorValue()
just to make the compiler happy
Definition: Minor.cc:1087
const poly a
Definition: syzextra.cc:212
#define block
Definition: scanner.cc:662
int getRelativeColumnIndex(const int i) const
A method for retrieving the (0-based) relative index of the i-th column in this MinorKey.
Definition: Minor.cc:259
int getAdditions() const
A method for accessing the additions performed while computing this minor.
Definition: Minor.cc:889
MinorKey(const int lengthOfRowArray=0, const unsigned int *const rowKey=0, const int lengthOfColumnArray=0, const unsigned int *const columnKey=0)
A constructor for class MinorKey.
Definition: Minor.cc:86
void setColumnKey(const int blockIndex, const unsigned int columnKey)
A method for setting the blockIndex-th element of _columnKey.
Definition: Minor.cc:408
Compatiblity layer for legacy polynomial operations (over currRing)
bool selectNextColumns(const int k, const MinorKey &mk)
This method redefines the set of columns represented by this MinorKey.
Definition: Minor.cc:670
int getAccumulatedAdditions() const
A method for accessing the additions performed while computing this minor, including all nested addit...
Definition: Minor.cc:899
int getRelativeRowIndex(const int i) const
A method for retrieving the (0-based) relative index of the i-th row in this MinorKey.
Definition: Minor.cc:227
int getResult() const
Accessor for the private field _result.
Definition: Minor.cc:1020
virtual ~PolyMinorValue()
Destructor.
Definition: Minor.cc:1098
bool operator==(const MinorValue &mv) const
just to make the compiler happy
Definition: Minor.cc:849
void getAbsoluteRowIndices(int *const target) const
A method for retrieving the 0-based indices of all rows encoded in this MinorKey. ...
Definition: Minor.cc:185
STL namespace.
std::string toString() const
A method for providing a printable version of the represented MinorKey.
Definition: Minor.cc:801
void getAbsoluteColumnIndices(int *const target) const
A method for retrieving the 0-based indices of all columns encoded in this MinorKey.
Definition: Minor.cc:206
static void SetRankingStrategy(const int rankingStrategy)
A method for determining the value ranking strategy.
Definition: Minor.cc:910
int k
Definition: cfEzgcd.cc:93
static int g_rankingStrategy
private store for the current value ranking strategy; This member can be set using MinorValue::SetRan...
Definition: Minor.h:541
MinorKey & operator=(const MinorKey &)
just to make the compiler happy
Definition: Minor.cc:39
Class IntMinorValue is derived from MinorValue and can be used for representing values in a cache for...
Definition: Minor.h:717
bool operator<(const MinorValue &mv) const
just to make the compiler happy
Definition: Minor.cc:863
int getMultiplications() const
A method for accessing the multiplications performed while computing this minor.
Definition: Minor.cc:884
void incrementRetrievals()
A method for incrementing the number of performed retrievals of this instance of MinorValue.
Definition: Minor.cc:874
int rankMeasure4() const
A method for obtaining a rank measure for the given MinorValue.
Definition: Minor.cc:964
poly getResult() const
Accessor for the private field _result.
Definition: Minor.cc:1103
virtual std::string toString() const
A method for providing a printable version of the represented MinorValue.
Definition: Minor.cc:855
IntMinorValue()
just to make the compiler happy
Definition: Minor.cc:1005
int getNumberOfRowBlocks() const
Accessor of _numberOfRowBlocks.
Definition: Minor.cc:301
void setRowKey(const int blockIndex, const unsigned int rowKey)
A method for setting the blockIndex-th element of _rowKey.
Definition: Minor.cc:403
static int GetRankingStrategy()
Accessor for the static private field g_rankingStrategy.
Definition: Minor.cc:920
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int getSetBits(const int a) const
A method for counting the number of set bits.
void print() const
A method for printing a string representation of the given MinorValue to std::cout.
Definition: Minor.cc:904
const ring r
Definition: syzextra.cc:208
int getWeight() const
Accessor for the current weight of this class instance.
Definition: Minor.cc:981
void selectFirstRows(const int k, const MinorKey &mk)
This method redefines the set of rows represented by this MinorKey.
Definition: Minor.cc:459
int getPotentialRetrievals() const
A method for accessing the maximum number of potential retrievals of this minor.
Definition: Minor.cc:879
int j
Definition: myNF.cc:70
bool operator==(const MinorKey &) const
just to make the compiler happy
Definition: Minor.cc:445
void selectFirstColumns(const int k, const MinorKey &mk)
This method redefines the set of columns represented by this MinorKey.
Definition: Minor.cc:499
#define assume(x)
Definition: mod2.h:394
int getNumberOfColumnBlocks() const
Accessor of _numberOfColumnBlocks.
Definition: Minor.cc:306
int m
Definition: cfEzgcd.cc:119
int getUtility() const
A method for obtaining a rank measure for theiven MinorValue.
Definition: Minor.cc:927
int compare(const MinorKey &mk) const
A comparator for two instances of MinorKey.
Definition: Minor.cc:414
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
MinorKey getSubMinorKey(const int absoluteEraseRowIndex, const int absoluteEraseColumnIndex) const
A method for retrieving a sub-MinorKey resulting from omitting one row and one column of this MinorKe...
Definition: Minor.cc:347
int getAbsoluteColumnIndex(const int i) const
A method for retrieving the (0-based) index of the i-th column in the set of columns encoded in this...
Definition: Minor.cc:153
void operator=(const PolyMinorValue &mv)
Assignment operator which creates a deep copy.
Definition: Minor.cc:1160
static unsigned pLength(poly a)
Definition: p_polys.h:189
bool selectNextRows(const int k, const MinorKey &mk)
This method redefines the set of rows represented by this MinorKey.
Definition: Minor.cc:539
Class PolyMinorValue is derived from MinorValue and can be used for representing values in a cache fo...
Definition: Minor.h:799
int getAccumulatedMultiplications() const
A method for accessing the multiplications performed while computing this minor, including all nested...
Definition: Minor.cc:894
int rankMeasure2() const
A method for obtaining a rank measure for the given MinorValue.
Definition: Minor.cc:947
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
Class MinorKey can be used for representing keys in a cache for sub-determinantes; see class Cache...
Definition: Minor.h:39
#define NULL
Definition: omList.c:10
#define pDelete(p_ptr)
Definition: polys.h:169
~MinorKey()
A destructor for deleting an instance.
Definition: Minor.cc:106
unsigned int getRowKey(const int blockIndex) const
Inlined accessor of blockIndex-th element of _rowKey.
Definition: Minor.cc:291
virtual ~IntMinorValue()
Destructor.
Definition: Minor.cc:1016
bool operator<(const MinorKey &) const
just to make the compiler happy
Definition: Minor.cc:453
unsigned int getColumnKey(const int blockIndex) const
Accessor of blockIndex-th element of _columnKey.
Definition: Minor.cc:296
std::string toString(const gfan::ZCone *const c)
Definition: bbcone.cc:28
void set(const int lengthOfRowArray, const unsigned int *rowKey, const int lengthOfColumnArray, const unsigned int *columnKey)
A setter method for class MinorKey.
Definition: Minor.cc:64
int exponent(const CanonicalForm &f, int q)
int exponent ( const CanonicalForm & f, int q )
virtual int getWeight() const
A method for retrieving the weight of a given MinorValue.
Definition: Minor.cc:841
std::string toString() const
A method for providing a printable version of the represented MinorValue.
Definition: Minor.cc:1115
int getWeight() const
Accessor for the current weight of this class instance.
Definition: Minor.cc:1108
int getAbsoluteRowIndex(const int i) const
A method for retrieving the (0-based) index of the i-th row in the set of rows encoded in this...
Definition: Minor.cc:121
void reset()
A method for deleting all entries of _rowKey and _columnKey.
Definition: Minor.cc:13
polyrec * poly
Definition: hilb.h:10
int rankMeasure3() const
A method for obtaining a rank measure for the given MinorValue.
Definition: Minor.cc:954
static Poly * h
Definition: janet.cc:978
const poly b
Definition: syzextra.cc:213
int getRetrievals() const
A method for accessing the number of retrievals of this minor.
Definition: Minor.cc:869
int rankMeasure5() const
A method for obtaining a rank measure for the given MinorValue.
Definition: Minor.cc:973
return result
Definition: facAbsBiFact.cc:76
int rankMeasure1() const
A method for obtaining a rank measure for the given MinorValue.
Definition: Minor.cc:941
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168
std::string toString() const
A method for providing a printable version of the represented MinorValue.
Definition: Minor.cc:1025