Changeset 4626:7d5d761443df in orange


Ignore:
Timestamp:
05/08/08 23:24:42 (6 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
9fb2556e4c00ec50f68afc5eb89367138c6ec417
Message:
  • changed ExampleGenerator::checkSum to accept a flag telling whether to check the meta attributes, too
  • ExampleTable::checkSum which had this flag before, now overloads the ExampleGenerator's method
  • ExampleTable now has a const and a non-const version; only the latter is present in ExampleGenerator, since ExampleGenerator::begin() is not const
Location:
source/orange
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • source/orange/examplegen.cpp

    r2564 r4626  
    9696 
    9797 
    98 int TExampleGenerator::checkSum() 
     98int TExampleGenerator::checkSum(const bool includeMetas) 
    9999{ unsigned long crc; 
    100100  INIT_CRC(crc); 
    101101  for(TExampleIterator ei(begin()); ei; ++ei) 
    102     (*ei).addToCRC(crc); 
     102    (*ei).addToCRC(crc, includeMetas); 
    103103  FINISH_CRC(crc); 
    104104  return int(crc & 0x7fffffff); 
  • source/orange/examplegen.hpp

    r1708 r4626  
    108108  virtual void removeMetaAttribute(const int &id); 
    109109 
    110   virtual int checkSum(); 
     110  virtual int checkSum(const bool includeMetas=false); 
    111111}; 
    112112 
  • source/orange/table.cpp

    r4239 r4626  
    809809} 
    810810 
     811int TExampleTable::checkSum(const bool includeMetas) 
     812{ unsigned long crc; 
     813  INIT_CRC(crc); 
     814 
     815  for(TExample **ei = examples, **ee = _Last; ei!=ee; (*ei++)->addToCRC(crc, includeMetas)); 
     816 
     817  FINISH_CRC(crc); 
     818  return int(crc & 0x7fffffff); 
     819} 
     820 
    811821int TExampleTable::checkSum(const bool includeMetas) const 
    812822{ unsigned long crc; 
  • source/orange/table.hpp

    r4239 r4626  
    120120  virtual void removeMetaAttribute(const int &id); 
    121121 
     122  virtual int checkSum(const bool includeMetas = false); 
    122123  virtual int checkSum(const bool includeMetas = false) const; 
    123124  virtual bool hasMissing() const; 
Note: See TracChangeset for help on using the changeset viewer.