Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/Witness.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class WitnessPlan : public Plan
public:
WitnessPlan (char const * const name, Plan * const input);
~WitnessPlan ();
Iterator * init () const;
Iterator * init () const override;
private:
Plan * const _input;
}; // class WitnessPlan
Expand All @@ -16,10 +16,18 @@ class WitnessIterator : public Iterator
public:
WitnessIterator (WitnessPlan const * const plan);
~WitnessIterator ();
bool next (Row & row);
void free (Row & row);
bool next (Row & row) override;
void free (Row & row) override;
size_t getRowCount() const {return _rows;}
size_t getParity() const{return _parity;}
size_t getInversions() const {return _inversions;}
private:
WitnessPlan const * const _plan;
Iterator * const _input;
RowCount _rows;
size_t _parity; //store XOR of row values
size_t _inversions; //Number of inversions
Row _previousRow; //Last observed row
bool _hasPrevious; //If previous row is valid

}; // class WitnessIterator