Changeset 1f6c7a in git


Ignore:
Timestamp:
Oct 8, 2009, 5:12:37 PM (14 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
9193d93b4d40ee988851d32b6b7d64e21ec55ab1
Parents:
23ab77a71f89616ef0697fae07d84e3a8b621e1b
Message:
bug fixes, replace srand by siRand


git-svn-id: file:///usr/local/Singular/svn/trunk@12175 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/Minor.cc

    r23ab77 r1f6c7a  
    584584            }
    585585            shiftedBit = shiftedBit >> 1;
    586         }                                           
     586        }
    587587    }
    588588
     
    658658    string s = "(";
    659659    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;
    661661        if (r < this->getNumberOfRowBlocks() - 1)
    662662            t = string(32 - t.length(), '0') + t;
     
    665665    s += ", ";
    666666    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;
    668668        if (c < this->getNumberOfColumnBlocks() - 1)
    669669            t = string(32 - t.length(), '0') + t;
  • Singular/TestMinors.cc

    r23ab77 r1f6c7a  
    8080                      const int zeroPercentage, const int entryBound, int* theMatrix) {
    8181    int theSize = rowCount * columnCount;
    82     srand(randomSeed); // random seed for ensuring reproducability of experiments
     82    siSeed = randomSeed; // random seed for ensuring reproducability of experiments
    8383    for (int i = 0; i < theSize; i++) {
    84         if ((rand() % 100) < zeroPercentage)
     84        if ((siRand() % 100) < zeroPercentage)
    8585            theMatrix[i] = 0;
    8686        else
    87             theMatrix[i] = 1 + (rand() % entryBound); // ranges from 1 to entryBound, including both
     87            theMatrix[i] = 1 + (siRand() % entryBound); // ranges from 1 to entryBound, including both
    8888    }
    8989}
     
    117117  +prpr; +prpr;
    118118
    119   // looks for minor == 3000; to this end, it needs to compute 1001 minors:
    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);
    121121  +prpr; +prpr;
    122122
    123   // looks for the first non-zero minor (6x6); to this end, it needs to compute 476 minors:
     123  // looks for the first non-zero minor (6x6); to this end, it needs to compute 229 minors:
    124124  testAllMinorsUntil(prpr, "Test IV", 100, 60, 10, 75, 6, 4712, 300, 10000, 0, false, 10000);
    125125  +prpr; +prpr;
    126126
    127   // looks for minor == 265986; to this end, it needs to compute 16 minors:
    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);
    129129
    130130  return 0;
Note: See TracChangeset for help on using the changeset viewer.