Loading...
Searching...
No Matches
uintseqhash.hh
#pragma once
/*
Copyright (c) 2003-2021 Tommi Junttila
Released under the GNU Lesser General Public License version 3.
This file is part of bliss.
bliss is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, version 3 of the License.
bliss is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with bliss. If not, see <http://www.gnu.org/licenses/>.
*/
namespace bliss {
class UintSeqHash
{
protected:
unsigned int h;
public:
UintSeqHash() {h = 0; }
UintSeqHash(const UintSeqHash &other) {h = other.h; }
UintSeqHash& operator=(const UintSeqHash &other) {h = other.h; return *this; }
void reset() {h = 0; }
void update(unsigned int n);
unsigned int get_value() const {return h; }
int cmp(const UintSeqHash &other) const {
return (h < other.h)?-1:((h == other.h)?0:1);
}
bool is_lt(const UintSeqHash &other) const {return cmp(other) < 0; }
bool is_le(const UintSeqHash &other) const {return cmp(other) <= 0; }
bool is_equal(const UintSeqHash &other) const {return cmp(other) == 0; }
};
} // namespace bliss
bliss::UintSeqHash::get_value
unsigned int get_value() const
Definition uintseqhash.hh:43
bliss::UintSeqHash::cmp
int cmp(const UintSeqHash &other) const
Definition uintseqhash.hh:48
bliss::UintSeqHash::is_equal
bool is_equal(const UintSeqHash &other) const
Definition uintseqhash.hh:56
bliss::UintSeqHash::update
void update(unsigned int n)
Definition uintseqhash.cc:96
bliss::UintSeqHash::reset
void reset()
Definition uintseqhash.hh:37
bliss::UintSeqHash::is_le
bool is_le(const UintSeqHash &other) const
Definition uintseqhash.hh:54
bliss::UintSeqHash::is_lt
bool is_lt(const UintSeqHash &other) const
Definition uintseqhash.hh:52
bliss
Definition abstractgraph.cc:35