Changeset 1f6c7a in git
- Timestamp:
- Oct 8, 2009, 5:12:37 PM (14 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 9193d93b4d40ee988851d32b6b7d64e21ec55ab1
- Parents:
- 23ab77a71f89616ef0697fae07d84e3a8b621e1b
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Minor.cc
r23ab77 r1f6c7a 584 584 } 585 585 shiftedBit = shiftedBit >> 1; 586 } 586 } 587 587 } 588 588 … … 658 658 string s = "("; 659 659 for (int r = this->getNumberOfRowBlocks() - 1; r >= 0; r--) { 660 sprintf(h, "% du", this->getRowKey(r)); t += h;660 sprintf(h, "%u", this->getRowKey(r)); t += h; 661 661 if (r < this->getNumberOfRowBlocks() - 1) 662 662 t = string(32 - t.length(), '0') + t; … … 665 665 s += ", "; 666 666 for (int c = this->getNumberOfColumnBlocks() - 1; c >= 0; c--) { 667 sprintf(h, "% du", this->getColumnKey(c)); t += h;667 sprintf(h, "%u", this->getColumnKey(c)); t += h; 668 668 if (c < this->getNumberOfColumnBlocks() - 1) 669 669 t = string(32 - t.length(), '0') + t; -
Singular/TestMinors.cc
r23ab77 r1f6c7a 80 80 const int zeroPercentage, const int entryBound, int* theMatrix) { 81 81 int theSize = rowCount * columnCount; 82 s rand(randomSeed); // random seed for ensuring reproducability of experiments82 siSeed = randomSeed; // random seed for ensuring reproducability of experiments 83 83 for (int i = 0; i < theSize; i++) { 84 if (( rand() % 100) < zeroPercentage)84 if ((siRand() % 100) < zeroPercentage) 85 85 theMatrix[i] = 0; 86 86 else 87 theMatrix[i] = 1 + ( rand() % entryBound); // ranges from 1 to entryBound, including both87 theMatrix[i] = 1 + (siRand() % entryBound); // ranges from 1 to entryBound, including both 88 88 } 89 89 } … … 117 117 +prpr; +prpr; 118 118 119 // looks for minor == 3000; to this end, it needs to compute 1001minors:120 testAllMinorsUntil(prpr, "Test III", 100, 60, 10, 10, 6, 471, 300, 10000, 3000, true, 10000);119 // looks for minor == 92868; to this end, it needs to compute 1632 minors: 120 testAllMinorsUntil(prpr, "Test III", 100, 60, 10, 10, 6, 471, 300, 10000, 92868, true, 10000); 121 121 +prpr; +prpr; 122 122 123 // looks for the first non-zero minor (6x6); to this end, it needs to compute 476minors:123 // looks for the first non-zero minor (6x6); to this end, it needs to compute 229 minors: 124 124 testAllMinorsUntil(prpr, "Test IV", 100, 60, 10, 75, 6, 4712, 300, 10000, 0, false, 10000); 125 125 +prpr; +prpr; 126 126 127 // looks for minor == 265986; to this end, it needs to compute 16minors:128 testAllMinorsUntil(prpr, "Test V", 100, 60, 10, 10, 6, 471, 300, 10000, 265986, true, 10000);127 // looks for minor == -43065; to this end, it needs to compute 23 minors: 128 testAllMinorsUntil(prpr, "Test V", 100, 60, 10, 10, 6, 471, 300, 10000, -43065, true, 10000); 129 129 130 130 return 0;
Note: See TracChangeset
for help on using the changeset viewer.