Changeset e2afced in git for Singular/Minor.cc


Ignore:
Timestamp:
Oct 8, 2009, 12:11:57 PM (15 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
0a52b49fcfbb9270ac1d60e85d52e30fd24bbd96
Parents:
967a9d48cc1d702f106bf47d327d87adbaf6833c
Message:
changes due to 32bit vs. 64bit (to make code run on compute servers)


git-svn-id: file:///usr/local/Singular/svn/trunk@12170 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/Minor.cc

    r967a9d re2afced  
    66#include "polys.h"
    77#include <Minor.h>
     8#include "febase.h"
    89
    910void MinorKey::reset() {
     
    2122
    2223    // allocate memory for new entries in _rowKey and _columnKey;
    23     _rowKey = new unsigned long[_numberOfRowBlocks];
    24     _columnKey = new unsigned long[_numberOfColumnBlocks];
     24    _rowKey = new unsigned int[_numberOfRowBlocks];
     25    _columnKey = new unsigned int[_numberOfColumnBlocks];
    2526
    2627    // copying values from parameter arrays to private arrays
     
    4344
    4445    // allocate memory for new entries in _rowKey and _columnKey;
    45     _rowKey = new unsigned long[_numberOfRowBlocks];
    46     _columnKey = new unsigned long[_numberOfColumnBlocks];
     46    _rowKey = new unsigned int[_numberOfRowBlocks];
     47    _columnKey = new unsigned int[_numberOfColumnBlocks];
    4748
    4849    // copying values from parameter arrays to private arrays
     
    5556}
    5657
    57 void MinorKey::set(const int lengthOfRowArray, const unsigned long* rowKey,
    58                    const int lengthOfColumnArray, const unsigned long* columnKey) {
     58void MinorKey::set(const int lengthOfRowArray, const unsigned int* rowKey,
     59                   const int lengthOfColumnArray, const unsigned int* columnKey) {
    5960    // free memory of _rowKey and _columnKey
    6061    if (_numberOfRowBlocks > 0) { delete [] _rowKey; }
     
    6566
    6667    // allocate memory for new entries in _rowKey and _columnKey;
    67     _rowKey = new unsigned long[_numberOfRowBlocks];
    68     _columnKey = new unsigned long[_numberOfColumnBlocks];
     68    _rowKey = new unsigned int[_numberOfRowBlocks];
     69    _columnKey = new unsigned int[_numberOfColumnBlocks];
    6970
    7071    // copying values from parameter arrays to private arrays
     
    7576}
    7677
    77 MinorKey::MinorKey(const int lengthOfRowArray, const unsigned long* const rowKey,
    78                    const int lengthOfColumnArray, const unsigned long* const columnKey) {
     78MinorKey::MinorKey(const int lengthOfRowArray, const unsigned int* const rowKey,
     79                   const int lengthOfColumnArray, const unsigned int* const columnKey) {
    7980    _numberOfRowBlocks = lengthOfRowArray;
    8081    _numberOfColumnBlocks = lengthOfColumnArray;
    8182
    8283    // allocate memory for new entries in _rowKey and _columnKey;
    83     _rowKey = new unsigned long[_numberOfRowBlocks];
    84     _columnKey = new unsigned long[_numberOfColumnBlocks];
     84    _rowKey = new unsigned int[_numberOfRowBlocks];
     85    _columnKey = new unsigned int[_numberOfColumnBlocks];
    8586
    8687    // copying values from parameter arrays to private arrays
     
    109110    int matchedBits = -1; // counter for matched bits; this needs to reach i, then we're done
    110111    for (int block = 0; block < getNumberOfRowBlocks(); block ++) { // start with lowest bits, i.e. in block No. 0
    111         unsigned long blockBits = getRowKey(block); // the bits in this block of 32 bits
    112         unsigned long shiftedBit = 1;
     112        unsigned int blockBits = getRowKey(block); // the bits in this block of 32 bits
     113        unsigned int shiftedBit = 1;
    113114        int exponent = 0;
    114115        // The invariant "shiftedBit = 2^exponent" will hold throughout the entire while loop.
     
    131132    int matchedBits = -1; // counter for matched bits; this needs to reach i, then we're done
    132133    for (int block = 0; block < getNumberOfColumnBlocks(); block ++) { // start with lowest bits, i.e. in block No. 0
    133         unsigned long blockBits = getColumnKey(block); // the bits in this block of 32 bits
    134         unsigned long shiftedBit = 1;
     134        unsigned int blockBits = getColumnKey(block); // the bits in this block of 32 bits
     135        unsigned int shiftedBit = 1;
    135136        int exponent = 0;
    136137        // The invariant "shiftedBit = 2^exponent" will hold throughout the entire while loop.
     
    149150    int i = 0; // index for filling the target array
    150151    for (int block = 0; block < getNumberOfRowBlocks(); block ++) { // start with lowest bits, i.e. in block No. 0
    151         unsigned long blockBits = getRowKey(block); // the bits in this block of 32 bits
    152         unsigned long shiftedBit = 1;
     152        unsigned int blockBits = getRowKey(block); // the bits in this block of 32 bits
     153        unsigned int shiftedBit = 1;
    153154        int exponent = 0;
    154155        // The invariant "shiftedBit = 2^exponent" will hold throughout the entire while loop.
     
    165166    int i = 0; // index for filling the target array
    166167    for (int block = 0; block < getNumberOfColumnBlocks(); block ++) { // start with lowest bits, i.e. in block No. 0
    167         unsigned long blockBits = getColumnKey(block); // the bits in this block of 32 bits
    168         unsigned long shiftedBit = 1;
     168        unsigned int blockBits = getColumnKey(block); // the bits in this block of 32 bits
     169        unsigned int shiftedBit = 1;
    169170        int exponent = 0;
    170171        // The invariant "shiftedBit = 2^exponent" will hold throughout the entire while loop.
     
    186187    int matchedBits = -1; // counter for matched bits; this is going to contain our return value
    187188    for (int block = 0; block < getNumberOfRowBlocks(); block ++) { // start with lowest bits, i.e. in block No. 0
    188         unsigned long blockBits = getRowKey(block); // the bits in this block of 32 bits
    189         unsigned long shiftedBit = 1;
     189        unsigned int blockBits = getRowKey(block); // the bits in this block of 32 bits
     190        unsigned int shiftedBit = 1;
    190191        int exponent = 0;
    191192        // The invariant "shiftedBit = 2^exponent" will hold throughout the entire while loop.
     
    209210    int matchedBits = -1; // counter for matched bits; this is going to contain our return value
    210211    for (int block = 0; block < getNumberOfColumnBlocks(); block ++) { // start with lowest bits, i.e. in block No. 0
    211         unsigned long blockBits = getColumnKey(block); // the bits in this block of 32 bits
    212         unsigned long shiftedBit = 1;
     212        unsigned int blockBits = getColumnKey(block); // the bits in this block of 32 bits
     213        unsigned int shiftedBit = 1;
    213214        int exponent = 0;
    214215        // The invariant "shiftedBit = 2^exponent" will hold throughout the entire while loop.
     
    224225}
    225226
    226 unsigned long MinorKey::getRowKey(const int blockIndex) const {
     227unsigned int MinorKey::getRowKey(const int blockIndex) const {
    227228    return _rowKey[blockIndex];
    228229}
    229230
    230 unsigned long MinorKey::getColumnKey(const int blockIndex) const {
     231unsigned int MinorKey::getColumnKey(const int blockIndex) const {
    231232    return _columnKey[blockIndex];
    232233}
     
    244245    if (a == 1) { // rows
    245246        for (int i = 0; i < _numberOfRowBlocks; i++) {
    246             unsigned long m = _rowKey[i];
    247             unsigned long k = 1;
     247            unsigned int m = _rowKey[i];
     248            unsigned int k = 1;
    248249            for (int j = 0; j < 32; j++) {
    249250                // k = 2^j
     
    255256    else { // columns
    256257        for (int i = 0; i < _numberOfColumnBlocks; i++) {
    257             unsigned long m = _columnKey[i];
    258             unsigned long k = 1;
     258            unsigned int m = _columnKey[i];
     259            unsigned int k = 1;
    259260            for (int j = 0; j < 32; j++) {
    260261                // k = 2^j
     
    271272    int rowBlock = absoluteEraseRowIndex / 32;
    272273    int exponent = absoluteEraseRowIndex % 32;
    273     unsigned long newRowBits = getRowKey(rowBlock) - (1 << exponent);
     274    unsigned int newRowBits = getRowKey(rowBlock) - (1 << exponent);
    274275    int highestRowBlock = getNumberOfRowBlocks() - 1;
    275276    // highestRowBlock will finally contain the highest block index with non-zero bit pattern
     
    285286    int columnBlock = absoluteEraseColumnIndex / 32;
    286287    exponent = absoluteEraseColumnIndex % 32;
    287     unsigned long newColumnBits = getColumnKey(columnBlock) - (1 << exponent);
     288    unsigned int newColumnBits = getColumnKey(columnBlock) - (1 << exponent);
    288289    int highestColumnBlock = getNumberOfColumnBlocks() - 1;
    289290    // highestColumnBlock will finally contain the highest block index with non-zero bit pattern
     
    318319}
    319320
    320 void MinorKey::setRowKey (const int blockIndex, const unsigned long rowKey) {
     321void MinorKey::setRowKey (const int blockIndex, const unsigned int rowKey) {
    321322    _rowKey[blockIndex] = rowKey;
    322323}
    323324
    324 void MinorKey::setColumnKey (const int blockIndex, const unsigned long columnKey) {
     325void MinorKey::setColumnKey (const int blockIndex, const unsigned int columnKey) {
    325326    _columnKey[blockIndex] = columnKey;
    326327}
     
    369370    int hitBits = 0;      // the number of bits we have hit; in the end, this has to be equal to k,
    370371                          // the dimension of the minor
    371     int blockIndex = -1;  // the index of the current long in mk
    372     unsigned long highestLong = 0;  // the new highest block of this MinorKey
    373     // We determine which longs of mk we can copy. Their indices will be 0, 1, ..., blockIndex - 1.
    374     // And highestLong is going to capture the highest long (which may be only a portion of
    375     // the corresponding long in mk. We loop until hitBits = k:
     372    int blockIndex = -1;  // the index of the current int in mk
     373    unsigned int highestInt = 0;  // the new highest block of this MinorKey
     374    // We determine which ints of mk we can copy. Their indices will be 0, 1, ..., blockIndex - 1.
     375    // And highestInt is going to capture the highest int (which may be only a portion of
     376    // the corresponding int in mk. We loop until hitBits = k:
    376377    while (hitBits < k) {
    377378        blockIndex++;
    378         highestLong = 0;
    379         unsigned long currentLong = mk.getRowKey(blockIndex);
    380         unsigned long shiftedBit = 1;
     379        highestInt = 0;
     380        unsigned int currentInt = mk.getRowKey(blockIndex);
     381        unsigned int shiftedBit = 1;
    381382        int exponent = 0;
    382383        // invariant in the loop: shiftedBit = 2^exponent
    383384        while (exponent < 32 && hitBits < k) {
    384             if (shiftedBit & currentLong) {
    385                 highestLong += shiftedBit;
     385            if (shiftedBit & currentInt) {
     386                highestInt += shiftedBit;
    386387                hitBits++;
    387388            }
     
    394395    _numberOfRowBlocks = blockIndex + 1;
    395396    // allocate memory for new entries in _rowKey;
    396     _rowKey = new unsigned long[_numberOfRowBlocks];
     397    _rowKey = new unsigned int[_numberOfRowBlocks];
    397398    // copying values from mk to this MinorKey
    398399    for (int r = 0; r < blockIndex; r++)
    399400        _rowKey[r] = mk.getRowKey(r);
    400     _rowKey[blockIndex] = highestLong;
     401    _rowKey[blockIndex] = highestInt;
    401402}
    402403
     
    404405    int hitBits = 0;      // the number of bits we have hit; in the end, this has to be equal to k,
    405406                          // the dimension of the minor
    406     int blockIndex = -1;  // the index of the current long in mk
    407     unsigned long highestLong = 0;  // the new highest block of this MinorKey
    408     // We determine which longs of mk we can copy. Their indices will be 0, 1, ..., blockIndex - 1.
    409     // And highestLong is going to capture the highest long (which may be only a portion of
    410     // the corresponding long in mk. We loop until hitBits = k:
     407    int blockIndex = -1;  // the index of the current int in mk
     408    unsigned int highestInt = 0;  // the new highest block of this MinorKey
     409    // We determine which ints of mk we can copy. Their indices will be 0, 1, ..., blockIndex - 1.
     410    // And highestInt is going to capture the highest int (which may be only a portion of
     411    // the corresponding int in mk. We loop until hitBits = k:
    411412    while (hitBits < k) {
    412413        blockIndex++;
    413         highestLong = 0;
    414         unsigned long currentLong = mk.getColumnKey(blockIndex);
    415         unsigned long shiftedBit = 1;
     414        highestInt = 0;
     415        unsigned int currentInt = mk.getColumnKey(blockIndex);
     416        unsigned int shiftedBit = 1;
    416417        int exponent = 0;
    417418        // invariant in the loop: shiftedBit = 2^exponent
    418419        while (exponent < 32 && hitBits < k) {
    419             if (shiftedBit & currentLong) {
    420                 highestLong += shiftedBit;
     420            if (shiftedBit & currentInt) {
     421                highestInt += shiftedBit;
    421422                hitBits++;
    422423            }
     
    429430    _numberOfColumnBlocks = blockIndex + 1;
    430431    // allocate memory for new entries in _columnKey;
    431     _columnKey = new unsigned long[_numberOfColumnBlocks];
     432    _columnKey = new unsigned int[_numberOfColumnBlocks];
    432433    // copying values from mk to this MinorKey
    433434    for (int c = 0; c < blockIndex; c++)
    434435        _columnKey[c] = mk.getColumnKey(c);
    435     _columnKey[blockIndex] = highestLong;
     436    _columnKey[blockIndex] = highestInt;
    436437}
    437438
     
    453454    // In this case, the method will return false; otherwise always true.
    454455    int newBitBlockIndex = 0;         // the block index of the bit
    455     unsigned long newBitToBeSet = 0;  // the bit as 2^e, where 0 <= e <= 31
    456 
    457     int blockCount = this->getNumberOfRowBlocks();  // number of longs (representing rows) in this MinorKey
     456    unsigned int newBitToBeSet = 0;  // the bit as 2^e, where 0 <= e <= 31
     457
     458    int blockCount = this->getNumberOfRowBlocks();  // number of ints (representing rows) in this MinorKey
    458459    int mkBlockIndex = mk.getNumberOfRowBlocks();   // for iterating along the blocks of mk
    459460
     
    463464    while (hitBits < k) {
    464465        mkBlockIndex--;
    465         unsigned long currentLong = mk.getRowKey(mkBlockIndex);
    466         unsigned long shiftedBit = 1 << 31; // initially, this equals 2^31, i.e. the highest bit
     466        unsigned int currentInt = mk.getRowKey(mkBlockIndex);
     467        unsigned int shiftedBit = 1 << 31; // initially, this equals 2^31, i.e. the highest bit
    467468        while (hitBits < k && shiftedBit > 0) {
    468             if (blockCount - 1 >= mkBlockIndex &&
    469                 shiftedBit & this->getRowKey(mkBlockIndex)) hitBits++;
    470             else if (shiftedBit & currentLong) {
     469            if ((blockCount - 1 >= mkBlockIndex) &&
     470                (shiftedBit & this->getRowKey(mkBlockIndex))) hitBits++;
     471            else if (shiftedBit & currentInt) {
    471472                newBitToBeSet = shiftedBit;
    472473                newBitBlockIndex = mkBlockIndex;
     
    496497            _numberOfRowBlocks = newBitBlockIndex + 1;
    497498            // allocate memory for new entries in _rowKey;
    498             _rowKey = new unsigned long[_numberOfRowBlocks];
     499            _rowKey = new unsigned int[_numberOfRowBlocks];
    499500        }
    500501        else {
    501502            // We need to delete all bits in _rowKey[newBitBlockIndex] that are below newBitToBeSet:
    502             unsigned long aLong = this->getRowKey(newBitBlockIndex);
    503             unsigned long deleteBit = newBitToBeSet >> 1; // in example: = 2^5
     503            unsigned int anInt = this->getRowKey(newBitBlockIndex);
     504            unsigned int deleteBit = newBitToBeSet >> 1; // in example: = 2^5
    504505            while (deleteBit > 0) {
    505                 if (aLong & deleteBit) aLong -= deleteBit;
     506                if (anInt & deleteBit) anInt -= deleteBit;
    506507                deleteBit = deleteBit >> 1;
    507508            };
    508             _rowKey[newBitBlockIndex] = aLong;
     509            _rowKey[newBitBlockIndex] = anInt;
    509510            // ...and we delete all entries in _rowKey[i] for 0 <= i < newBitBlockIndex
    510511            for (int i = 0; i < newBitBlockIndex; i++)
     
    525526        while (bitCounter < k) {
    526527            mkBlockIndex++;
    527             unsigned long currentLong = mk.getRowKey(mkBlockIndex);
    528             unsigned long shiftedBit = 1;
     528            unsigned int currentInt = mk.getRowKey(mkBlockIndex);
     529            unsigned int shiftedBit = 1;
    529530            int exponent = 0;
    530531            // invariant: shiftedBit = 2^exponent
    531532            while (bitCounter < k && exponent < 32) {
    532                 if (shiftedBit & currentLong) {
     533                if (shiftedBit & currentInt) {
    533534                    _rowKey[mkBlockIndex] += shiftedBit;
    534535                    bitCounter++;
     
    561562    // In this case, the method will return false; otherwise always true.
    562563    int newBitBlockIndex = 0;         // the block index of the bit
    563     unsigned long newBitToBeSet = 0;  // the bit as 2^e, where 0 <= e <= 31
    564 
    565     int blockCount = this->getNumberOfColumnBlocks();  // number of longs (representing columns) in this MinorKey
     564    unsigned int newBitToBeSet = 0;  // the bit as 2^e, where 0 <= e <= 31
     565
     566    int blockCount = this->getNumberOfColumnBlocks();  // number of ints (representing columns) in this MinorKey
    566567    int mkBlockIndex = mk.getNumberOfColumnBlocks();   // for iterating along the blocks of mk
    567568
     
    571572    while (hitBits < k) {
    572573        mkBlockIndex--;
    573         unsigned long currentLong = mk.getColumnKey(mkBlockIndex);
    574         unsigned long shiftedBit = 1 << 31; // initially, this equals 2^31, i.e. the highest bit
     574        unsigned int currentInt = mk.getColumnKey(mkBlockIndex);
     575        unsigned int shiftedBit = 1 << 31; // initially, this equals 2^31, i.e. the highest bit
    575576        while (hitBits < k && shiftedBit > 0) {
    576             if (blockCount - 1 >= mkBlockIndex &&
    577                 shiftedBit & this->getColumnKey(mkBlockIndex)) hitBits++;
    578             else if (shiftedBit & currentLong) {
     577            if ((blockCount - 1 >= mkBlockIndex) &&
     578                (shiftedBit & this->getColumnKey(mkBlockIndex))) hitBits++;
     579            else if (shiftedBit & currentInt) {
    579580                newBitToBeSet = shiftedBit;
    580581                newBitBlockIndex = mkBlockIndex;
     
    583584            }
    584585            shiftedBit = shiftedBit >> 1;
    585         }
     586        }                                           
    586587    }
    587588
     
    604605            _numberOfColumnBlocks = newBitBlockIndex + 1;
    605606            // allocate memory for new entries in _columnKey;
    606             _columnKey = new unsigned long[_numberOfColumnBlocks];
     607            _columnKey = new unsigned int[_numberOfColumnBlocks];
    607608        }
    608609        else {
    609610            // We need to delete all bits in _columnKey[newBitBlockIndex] that are below newBitToBeSet:
    610             unsigned long aLong = this->getColumnKey(newBitBlockIndex);
    611             unsigned long deleteBit = newBitToBeSet >> 1; // in example: = 2^5
     611            unsigned int anInt = this->getColumnKey(newBitBlockIndex);
     612            unsigned int deleteBit = newBitToBeSet >> 1; // in example: = 2^5
    612613            while (deleteBit > 0) {
    613                 if (aLong & deleteBit) aLong -= deleteBit;
     614                if (anInt & deleteBit) anInt -= deleteBit;
    614615                deleteBit = deleteBit >> 1;
    615616            };
    616             _columnKey[newBitBlockIndex] = aLong;
     617            _columnKey[newBitBlockIndex] = anInt;
    617618            // ...and we delete all entries in _columnKey[i] for 0 <= i < newBitBlockIndex
    618619            for (int i = 0; i < newBitBlockIndex; i++)
     
    633634        while (bitCounter < k) {
    634635            mkBlockIndex++;
    635             unsigned long currentLong = mk.getColumnKey(mkBlockIndex);
    636             unsigned long shiftedBit = 1;
     636            unsigned int currentInt = mk.getColumnKey(mkBlockIndex);
     637            unsigned int shiftedBit = 1;
    637638            int exponent = 0;
    638639            // invariant: shiftedBit = 2^exponent
    639640            while (bitCounter < k && exponent < 32) {
    640                 if (shiftedBit & currentLong) {
     641                if (shiftedBit & currentInt) {
    641642                    _columnKey[mkBlockIndex] += shiftedBit;
    642643                    bitCounter++;
     
    657658    string s = "(";
    658659    for (int r = this->getNumberOfRowBlocks() - 1; r >= 0; r--) {
    659         sprintf(h, "%ld", this->getRowKey(r)); t += h;
     660        sprintf(h, "%du", this->getRowKey(r)); t += h;
    660661        if (r < this->getNumberOfRowBlocks() - 1)
    661662            t = string(32 - t.length(), '0') + t;
     
    664665    s += ", ";
    665666    for (int c = this->getNumberOfColumnBlocks() - 1; c >= 0; c--) {
    666         sprintf(h, "%ld", this->getColumnKey(c)); t += h;
     667        sprintf(h, "%du", this->getColumnKey(c)); t += h;
    667668        if (c < this->getNumberOfColumnBlocks() - 1)
    668669            t = string(32 - t.length(), '0') + t;
     
    675676int MinorValue::_RankingStrategy = -1;
    676677
    677 long MinorValue::getWeight () const
     678int MinorValue::getWeight () const
    678679{
    679680  assert(false);  // must be overridden in derived classes
     
    701702}
    702703
    703 long MinorValue::getRetrievals() const {
     704int MinorValue::getRetrievals() const {
    704705    return _retrievals;
    705706}
     
    709710}
    710711
    711 long MinorValue::getPotentialRetrievals() const {
     712int MinorValue::getPotentialRetrievals() const {
    712713    return _potentialRetrievals;
    713714}
    714715
    715 long MinorValue::getMultiplications() const {
     716int MinorValue::getMultiplications() const {
    716717    return _multiplications;
    717718}
    718719
    719 long MinorValue::getAdditions() const {
     720int MinorValue::getAdditions() const {
    720721    return _additions;
    721722}
    722723
    723 long MinorValue::getAccumulatedMultiplications() const {
     724int MinorValue::getAccumulatedMultiplications() const {
    724725    return _accumulatedMult;
    725726}
    726727
    727 long MinorValue::getAccumulatedAdditions() const {
     728int MinorValue::getAccumulatedAdditions() const {
    728729    return _accumulatedSum;
    729730}
     
    789790}
    790791
    791 long LongMinorValue::getWeight () const {
     792int IntMinorValue::getWeight () const {
    792793    // put measure for size of MinorValue here, i.e. number of monomials in polynomial;
    793794    // so far, we use the accumulated number of multiplications (i.e., including all nested ones)
     
    796797}
    797798
    798 LongMinorValue::LongMinorValue (const long result, const int multiplications, const int additions,
     799IntMinorValue::IntMinorValue (const int result, const int multiplications, const int additions,
    799800                                const int accumulatedMultiplications, const int accumulatedAdditions,
    800801                                const int retrievals, const int potentialRetrievals) {
     
    808809}
    809810
    810 LongMinorValue::LongMinorValue () {
     811IntMinorValue::IntMinorValue () {
    811812    _result = -1;
    812813    _multiplications = -1;
     
    818819}
    819820
    820 LongMinorValue::~LongMinorValue()
     821IntMinorValue::~IntMinorValue()
    821822{
    822823}
    823824
    824 long LongMinorValue::getResult() const {
     825int IntMinorValue::getResult() const {
    825826    return _result;
    826827}
    827828
    828 string LongMinorValue::toString () const {
     829string IntMinorValue::toString () const {
    829830    char h[10];
    830831
     
    833834    if (this->getRetrievals() == -1) cacheHasBeenUsed = false;
    834835
    835     sprintf(h, "%ld", this->getResult());
     836    sprintf(h, "%d", this->getResult());
    836837    string s = h;
    837838    s += " [retrievals: ";
    838     if (cacheHasBeenUsed) { sprintf(h, "%ld", this->getRetrievals()); s += h; }
     839    if (cacheHasBeenUsed) { sprintf(h, "%d", this->getRetrievals()); s += h; }
    839840    else s += "/";
    840841    s += " (of ";
    841     if (cacheHasBeenUsed) { sprintf(h, "%ld", this->getPotentialRetrievals()); s += h; }
     842    if (cacheHasBeenUsed) { sprintf(h, "%d", this->getPotentialRetrievals()); s += h; }
    842843    else s += "/";
    843844    s += "), *: ";
    844     sprintf(h, "%ld", this->getMultiplications()); s += h;
     845    sprintf(h, "%d", this->getMultiplications()); s += h;
    845846    s += " (accumulated: ";
    846     sprintf(h, "%ld", this->getAccumulatedMultiplications()); s += h;
     847    sprintf(h, "%d", this->getAccumulatedMultiplications()); s += h;
    847848    s += "), +: ";
    848     sprintf(h, "%ld", this->getAdditions()); s += h;
     849    sprintf(h, "%d", this->getAdditions()); s += h;
    849850    s += " (accumulated: ";
    850     sprintf(h, "%ld", this->getAccumulatedAdditions()); s += h;
     851    sprintf(h, "%d", this->getAccumulatedAdditions()); s += h;
    851852    s += "), rank: ";
    852853    if (cacheHasBeenUsed) { sprintf(h, "%d", this->getUtility()); s += h; }
     
    856857}
    857858
    858 LongMinorValue::LongMinorValue (const LongMinorValue& mv) {
     859IntMinorValue::IntMinorValue (const IntMinorValue& mv) {
    859860    _result = mv.getResult();
    860861    _retrievals = mv.getRetrievals();
     
    899900}
    900901
    901 long PolyMinorValue::getWeight () const {
     902int PolyMinorValue::getWeight () const {
    902903    // put measure for size of PolyMinorValue here, e.g. the number of monomials
    903904    // the cached polynomial
     
    914915    string s = pString(_result);
    915916    s += " [retrievals: ";
    916     if (cacheHasBeenUsed) { sprintf(h, "%ld", this->getRetrievals()); s += h; }
     917    if (cacheHasBeenUsed) { sprintf(h, "%d", this->getRetrievals()); s += h; }
    917918    else s += "/";
    918919    s += " (of ";
    919     if (cacheHasBeenUsed) { sprintf(h, "%ld", this->getPotentialRetrievals()); s += h; }
     920    if (cacheHasBeenUsed) { sprintf(h, "%d", this->getPotentialRetrievals()); s += h; }
    920921    else s += "/";
    921922    s += "), *: ";
    922     sprintf(h, "%ld", this->getMultiplications()); s += h;
     923    sprintf(h, "%d", this->getMultiplications()); s += h;
    923924    s += " (accumulated: ";
    924     sprintf(h, "%ld", this->getAccumulatedMultiplications()); s += h;
     925    sprintf(h, "%d", this->getAccumulatedMultiplications()); s += h;
    925926    s += "), +: ";
    926     sprintf(h, "%ld", this->getAdditions()); s += h;
     927    sprintf(h, "%d", this->getAdditions()); s += h;
    927928    s += " (accumulated: ";
    928     sprintf(h, "%ld", this->getAccumulatedAdditions()); s += h;
     929    sprintf(h, "%d", this->getAccumulatedAdditions()); s += h;
    929930    s += "), rank: ";
    930931    if (cacheHasBeenUsed) { sprintf(h, "%d", this->getUtility()); s += h; }
Note: See TracChangeset for help on using the changeset viewer.