GENIE
genie Namespace Reference

This is the top-level namespace of the project. More...

Namespaces

 compression
 
 exception
 
 execution_policy
 
 matching
 
 original
 
 query
 
 table
 
 utility
 

Classes

class  Config
 Config class holds all user configurable settings of GENIE. More...
 
class  ExecutionPolicy
 ExecutionPolicy class is the interface for building table, building query, and matching. More...
 

Typedefs

typedef std::vector< std::vector< int > > TableData
 Raw table data format used for building the table. More...
 
typedef std::vector< std::vector< int > > QueryData
 Raw query data format used for building the queries. More...
 
typedef std::pair< std::vector< int >, std::vector< int > > SearchResult
 Matching result (top K's ID and count). More...
 

Functions

std::shared_ptr< ExecutionPolicyMakePolicy (const Config &config)
 Builds and returns a policy according to the configurations. More...
 
TableData LoadTableDataFromCsv (const std::string &filename)
 Reads data from a CSV file and returns in TableData format. More...
 
std::shared_ptr< genie::table::inv_tableLoadTableFromBinary (const std::string &filename)
 Reads data from a binary file and returns pre-built table. More...
 
void SaveTableToBinary (const std::string &filename, const std::shared_ptr< const genie::table::inv_table > &table)
 Save inverted table to a binary file. More...
 
QueryData LoadQueryDataFromCsv (const std::string &filename, const std::shared_ptr< const ExecutionPolicy > &policy)
 Reads query from a CSV file and returns in QueryData format. More...
 
SearchResult Search (std::shared_ptr< genie::ExecutionPolicy > &policy, const std::string &table_filename, const std::string &query_filename)
 1st-level interface for end-to-end matching with given table and query CSV file paths. More...
 
std::shared_ptr< genie::table::inv_tableBuildTable (std::shared_ptr< genie::ExecutionPolicy > &policy, const TableData &table_data)
 2nd-level interface for building table with TableData. More...
 
std::vector< genie::query::QueryBuildQuery (std::shared_ptr< genie::ExecutionPolicy > &policy, const std::shared_ptr< genie::table::inv_table > &table, const QueryData &query_data)
 2nd-level interface for building queries with table and QueryData. More...
 
SearchResult Match (std::shared_ptr< genie::ExecutionPolicy > &policy, const std::shared_ptr< genie::table::inv_table > &table, const std::vector< genie::query::Query > &queries)
 2nd-level interface for matching with pre-built table and queries. More...
 

Detailed Description

This is the top-level namespace of the project.

This code is a modification of code from SIMDIntersectionAndCompression library by Leonid Boytsov, Nathan Kurz and Daniel Lemire

Typedef Documentation

◆ QueryData

typedef std::vector<std::vector<int> > genie::QueryData

Raw query data format used for building the queries.

Definition at line 16 of file types.h.

◆ SearchResult

typedef std::pair<std::vector<int>, std::vector<int> > genie::SearchResult

Matching result (top K's ID and count).

Definition at line 20 of file types.h.

◆ TableData

typedef std::vector<std::vector<int> > genie::TableData

Raw table data format used for building the table.

Definition at line 12 of file types.h.

Function Documentation

◆ BuildQuery()

std::vector<genie::query::Query> genie::BuildQuery ( std::shared_ptr< genie::ExecutionPolicy > &  policy,
const std::shared_ptr< genie::table::inv_table > &  table,
const QueryData query_data 
)

2nd-level interface for building queries with table and QueryData.

◆ BuildTable()

std::shared_ptr<genie::table::inv_table> genie::BuildTable ( std::shared_ptr< genie::ExecutionPolicy > &  policy,
const TableData table_data 
)

2nd-level interface for building table with TableData.

◆ LoadQueryDataFromCsv()

QueryData genie::LoadQueryDataFromCsv ( const std::string &  filename,
const std::shared_ptr< const ExecutionPolicy > &  policy 
)

Reads query from a CSV file and returns in QueryData format.

◆ LoadTableDataFromCsv()

TableData genie::LoadTableDataFromCsv ( const std::string &  filename)

Reads data from a CSV file and returns in TableData format.

◆ LoadTableFromBinary()

std::shared_ptr<genie::table::inv_table> genie::LoadTableFromBinary ( const std::string &  filename)

Reads data from a binary file and returns pre-built table.

◆ MakePolicy()

shared_ptr< ExecutionPolicy > genie::MakePolicy ( const Config config)

Builds and returns a policy according to the configurations.

Definition at line 14 of file execution_policy.cc.

◆ Match()

SearchResult genie::Match ( std::shared_ptr< genie::ExecutionPolicy > &  policy,
const std::shared_ptr< genie::table::inv_table > &  table,
const std::vector< genie::query::Query > &  queries 
)

2nd-level interface for matching with pre-built table and queries.

◆ SaveTableToBinary()

void genie::SaveTableToBinary ( const std::string &  filename,
const std::shared_ptr< const genie::table::inv_table > &  table 
)

Save inverted table to a binary file.

◆ Search()

SearchResult genie::Search ( std::shared_ptr< genie::ExecutionPolicy > &  policy,
const std::string &  table_filename,
const std::string &  query_filename 
)

1st-level interface for end-to-end matching with given table and query CSV file paths.