The bliss C++ API 0.77 (Debian 0.77-3)
uintseqhash.hh
1#pragma once
2
3/*
4 Copyright (c) 2003-2021 Tommi Junttila
5 Released under the GNU Lesser General Public License version 3.
6
7 This file is part of bliss.
8
9 bliss is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, version 3 of the License.
12
13 bliss is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with bliss. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22namespace bliss {
23
28{
29protected:
30 unsigned int h;
31public:
32 UintSeqHash() {h = 0; }
33 UintSeqHash(const UintSeqHash &other) {h = other.h; }
34 UintSeqHash& operator=(const UintSeqHash &other) {h = other.h; return *this; }
35
37 void reset() {h = 0; }
38
40 void update(unsigned int n);
41
43 unsigned int get_value() const {return h; }
44
48 int cmp(const UintSeqHash &other) const {
49 return (h < other.h)?-1:((h == other.h)?0:1);
50 }
52 bool is_lt(const UintSeqHash &other) const {return cmp(other) < 0; }
54 bool is_le(const UintSeqHash &other) const {return cmp(other) <= 0; }
56 bool is_equal(const UintSeqHash &other) const {return cmp(other) == 0; }
57};
58
59
60} // namespace bliss
A updatable hash for sequences of unsigned ints.
Definition: uintseqhash.hh:28
unsigned int get_value() const
Definition: uintseqhash.hh:43
int cmp(const UintSeqHash &other) const
Definition: uintseqhash.hh:48
bool is_equal(const UintSeqHash &other) const
Definition: uintseqhash.hh:56
void update(unsigned int n)
Definition: uintseqhash.cc:96
void reset()
Definition: uintseqhash.hh:37
bool is_le(const UintSeqHash &other) const
Definition: uintseqhash.hh:54
bool is_lt(const UintSeqHash &other) const
Definition: uintseqhash.hh:52
Definition: abstractgraph.cc:35