Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions src/util/irep_hash_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Author: Daniel Kroening, [email protected]

#include "irep_hash_container.h"
#include "irep.h"
#include "irep_hash.h"

/*******************************************************************\

Expand Down Expand Up @@ -41,6 +42,27 @@ size_t irep_hash_container_baset::number(const irept &irep)

/*******************************************************************\

Function: irep_hash_container_baset::vector_hasht::operator()

Inputs:

Outputs:

Purpose:

\*******************************************************************/

size_t irep_hash_container_baset::vector_hasht::operator()(
const packedt &p) const
{
size_t result=p.size(); // seed
for(auto elem : p)
result=hash_combine(result, elem);
return result;
}

/*******************************************************************\

Function: irep_hash_container_baset::pack

Inputs:
Expand Down
9 changes: 1 addition & 8 deletions src/util/irep_hash_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Author: Daniel Kroening, [email protected]
#include <cstdlib> // for size_t
#include <vector>

#include "irep_hash.h"
#include "numbering.h"

class irept;
Expand Down Expand Up @@ -55,13 +54,7 @@ class irep_hash_container_baset

struct vector_hasht
{
size_t operator()(const packedt &p) const
{
size_t result=p.size(); // seed
for(auto elem : p)
result=hash_combine(result, elem);
return result;
}
size_t operator()(const packedt &p) const;
};

typedef hash_numbering<packedt, vector_hasht> numberingt;
Expand Down