aitools::invertedindex::MPHashFunction Class Reference

#include <MPHashFunction.hpp>

List of all members.

Public Types

enum  Algorithm {
  BMZ, CHM, BRZ, FCH,
  BDZ, CHD
}

Public Member Functions

 MPHashFunction ()
 ~MPHashFunction ()
void create (const bfs::path &vocabulary, Algorithm algorithm=BDZ) throw (std::invalid_argument, std::runtime_error)
void create (const Vocabulary &vocabulary, Algorithm algorithm=BDZ) throw (std::runtime_error)
uint32_t hash (const std::string &key) const
void load (const bfs::path &path) throw (std::invalid_argument)
void save (const bfs::path &path) throw (std::invalid_argument)
uint32_t size () const

Private Member Functions

void clear_ ()
void create_ (Algorithm algorithm, cmph_io_adapter_t *source) throw (std::runtime_error)

Private Attributes

cmph_t * mphf_

Detailed Description

A class to generate a minimal perfect hash function.

Author:
martin.trenkmann@uni-weimar.de
See also:
http://cmph.sourceforge.net

Created on Jun 22, 2008

Id
MPHashFunction.hpp,v 1.18 2010/05/11 23:41:08 trenkman Exp

Definition at line 31 of file MPHashFunction.hpp.


Member Enumeration Documentation

Defines the algorithms supported by the CMPH library.

Enumerator:
BMZ 
CHM 
BRZ 
FCH 
BDZ 
CHD 

Definition at line 38 of file MPHashFunction.hpp.


Constructor & Destructor Documentation

aitools::invertedindex::MPHashFunction::MPHashFunction (  ) 

The default constructor.

Definition at line 9 of file MPHashFunction.cpp.

aitools::invertedindex::MPHashFunction::~MPHashFunction (  ) 

The destructor.

Definition at line 13 of file MPHashFunction.cpp.

References clear_().

Here is the call graph for this function:


Member Function Documentation

void aitools::invertedindex::MPHashFunction::clear_ (  )  [private]

Definition at line 93 of file MPHashFunction.cpp.

References mphf_.

Referenced by ~MPHashFunction().

Here is the caller graph for this function:

void aitools::invertedindex::MPHashFunction::create ( const Vocabulary vocabulary,
Algorithm  algorithm = BDZ 
) throw (std::runtime_error)

Definition at line 46 of file MPHashFunction.cpp.

void aitools::invertedindex::MPHashFunction::create ( const bfs::path &  vocabulary,
Algorithm  algorithm = BDZ 
) throw (std::invalid_argument, std::runtime_error)

Definition at line 28 of file MPHashFunction.cpp.

References aitools::invertedindex::System::fclose(), and aitools::invertedindex::System::fopen().

Referenced by BOOST_AUTO_TEST_CASE(), and aitools::invertedindex::StorageBuilder::close().

Here is the call graph for this function:

Here is the caller graph for this function:

void aitools::invertedindex::MPHashFunction::create_ ( Algorithm  algorithm,
cmph_io_adapter_t *  source 
) throw (std::runtime_error) [private]

Definition at line 101 of file MPHashFunction.cpp.

References aitools::invertedindex::Exception::throw_runtime_error().

Here is the call graph for this function:

uint32_t aitools::invertedindex::MPHashFunction::hash ( const std::string &  key  )  const

Definition at line 72 of file MPHashFunction.cpp.

References mphf_.

Referenced by BOOST_AUTO_TEST_CASE(), aitools::invertedindex::StorageBuilder::close(), and aitools::invertedindex::StorageSearcher::quantile().

Here is the caller graph for this function:

void aitools::invertedindex::MPHashFunction::load ( const bfs::path &  path  )  throw (std::invalid_argument) [virtual]

Load the object from a file.

Parameters:
file the path to the file

Implements aitools::invertedindex::Externalizable.

Definition at line 19 of file MPHashFunction.cpp.

References aitools::invertedindex::System::fclose(), and aitools::invertedindex::System::fopen().

Referenced by BOOST_AUTO_TEST_CASE().

Here is the call graph for this function:

Here is the caller graph for this function:

void aitools::invertedindex::MPHashFunction::save ( const bfs::path &  path  )  throw (std::invalid_argument) [virtual]

Save the object to a file.

Parameters:
file the path to the file

Implements aitools::invertedindex::Externalizable.

Definition at line 78 of file MPHashFunction.cpp.

References aitools::invertedindex::System::fclose(), and aitools::invertedindex::System::fopen().

Referenced by BOOST_AUTO_TEST_CASE(), and aitools::invertedindex::StorageBuilder::close().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t aitools::invertedindex::MPHashFunction::size (  )  const

Definition at line 87 of file MPHashFunction.cpp.

References mphf_.

Referenced by BOOST_AUTO_TEST_CASE(), and aitools::invertedindex::StorageBuilder::close().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 79 of file MPHashFunction.hpp.

Referenced by clear_(), hash(), and size().


The documentation for this class was generated from the following files:
Generated on Wed May 30 15:07:34 2012 by  doxygen 1.6.3