Debian Codegraph @

Source/Parser/Expressions/CExpressionHashMixer.cpp

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #include "CExpressionHashMixer.h"
22
23
24 namespace Konclude {
25
26 namespace Parser {
27
28 namespace Expression {
29
30
31 CExpressionHashMixer::CExpressionHashMixer() {
32 }
33
34
35 CExpressionHashMixer::~CExpressionHashMixer() {
36 }
37
38 cint64 CExpressionHashMixer::getHashValueMixed(cint64 hashValue1) {
39 cint64 hashValue = hashValue1;
40 return hashValue;
41 }
42
43 cint64 CExpressionHashMixer::getHashValueMixed(cint64 hashValue1, cint64 hashValue2) {
44 cint64 hashValue = hashValue1;
45 hashValue = ((hashValue*13)-1)^hashValue2;
46 return hashValue;
47 }
48
49 cint64 CExpressionHashMixer::getHashValueMixed(cint64 hashValue1, cint64 hashValue2, cint64 hashValue3) {
50 cint64 hashValue = hashValue1;
51 hashValue = ((hashValue*13)-1)^hashValue2;
52 hashValue = ((hashValue*13)-1)^hashValue3;
53 return hashValue;
54 }
55
56 cint64 CExpressionHashMixer::getHashValueMixed(cint64 hashValue1, cint64 hashValue2, cint64 hashValue3, cint64 hashValue4) {
57 cint64 hashValue = hashValue1;
58 hashValue = ((hashValue*13)-1)^hashValue2;
59 hashValue = ((hashValue*13)-1)^hashValue3;
60 hashValue = ((hashValue*13)-1)^hashValue4;
61 return hashValue;
62 }
63
64 cint64 CExpressionHashMixer::getHashValueMixed(cint64 hashValue1, cint64 hashValue2, cint64 hashValue3, cint64 hashValue4, cint64 hashValue5) {
65 cint64 hashValue = hashValue1;
66 hashValue = ((hashValue * 13) - 1) ^ hashValue2;
67 hashValue = ((hashValue * 13) - 1) ^ hashValue3;
68 hashValue = ((hashValue * 13) - 1) ^ hashValue4;
69 hashValue = ((hashValue * 13) - 1) ^ hashValue5;
70 return hashValue;
71 }
72
73
74 }; // end namespace Expression
75
76 }; // end namespace Parser
77
78 }; // end namespace Konclude