3 #include "tableentry.h"
6 #include "ordergraph.h"
7 #include "orderelement.h"
10 unsigned int table_entry_hash_function(TableEntry *This) {
12 for (uint i = 0; i < This->inputSize; i++) {
19 bool table_entry_equals(TableEntry *key1, TableEntry *key2) {
20 if (key1->inputSize != key2->inputSize)
22 for (uint i = 0; i < key1->inputSize; i++)
23 if (key1->inputs[i] != key2->inputs[i])
28 unsigned int order_node_hash_function(OrderNode *This) {
29 return (uint) This->id;
32 bool order_node_equals(OrderNode *key1, OrderNode *key2) {
33 return key1->id == key2->id;
36 unsigned int order_edge_hash_function(OrderEdge *This) {
37 return (uint) (((uintptr_t)This->sink) ^ ((uintptr_t)This->source << 4));
40 bool order_edge_equals(OrderEdge *key1, OrderEdge *key2) {
41 return key1->sink == key2->sink && key1->source == key2->source;
44 unsigned int order_element_hash_function(OrderElement *This) {
45 return (uint)This->item;
48 bool order_element_equals(OrderElement *key1, OrderElement *key2) {
49 return key1->item == key2->item;
52 unsigned int order_pair_hash_function(OrderPair *This) {
53 return (uint) (This->first << 2) ^ This->second;
56 bool order_pair_equals(OrderPair *key1, OrderPair *key2) {
57 return key1->first == key2->first && key1->second == key2->second;