GENIE
genie::table::inv_list Class Reference

This class manages one inverted list. More...

#include <inv_list.h>

Public Member Functions

 inv_list ()
 Create an empty inv_list. More...
 
 inv_list (std::vector< int > &vin)
 
 inv_list (std::vector< int > *vin)
 
unsigned int _shift_bits_subsequence ()
 
void invert_bijectMap (std::vector< std::vector< int > > &vin)
 
void invert_bijectMap (int *data, unsigned int item_num, unsigned int *index, unsigned int row_num)
 Handle input from binary file. More...
 
void invert_subsequence (std::vector< std::vector< int >> &vin)
 
void invert_subsequence (int *data, unsigned int item_num, unsigned int *index, unsigned int row_num)
 This function is used for subsequence search, binary input. More...
 
void invert_sequence (std::vector< std::vector< int >> &vin, int shift_bits)
 This is used for sequence match. More...
 
 inv_list (std::vector< std::string > &vin)
 
 inv_list (std::vector< std::string > *vin)
 
int min ()
 Return the min value of the inverted vector. More...
 
int max ()
 Return the max value of the inverted vector. More...
 
int size ()
 Return the number of instances. More...
 
void invert (std::vector< int > &vin)
 
void invert (std::vector< int > *vin)
 
void invert (std::vector< std::string > &vin)
 
void invert (std::vector< std::string > *vin)
 
void invert (std::vector< std::string > &vin, int(*stoi)(std::string &))
 
void invert (std::vector< std::string > *vin, int(*stoi)(std::string &))
 
bool contains (int value)
 Check whether the vaule is in the inv_list. More...
 
std::vector< int > * index (int value)
 The indexes of the value. More...
 
int value_range ()
 Return the number of different values in the attribute. More...
 

Public Attributes

std::unordered_map< int, int > _distinct
 

Detailed Description

This class manages one inverted list.

This class contains information about one attribute and value range of the attribute. It also stores id of data points that contain a specific value on that attribute.

Definition at line 23 of file inv_list.h.

Constructor & Destructor Documentation

◆ inv_list() [1/5]

genie::table::inv_list::inv_list ( )
inline

Create an empty inv_list.

Definition at line 61 of file inv_list.h.

◆ inv_list() [2/5]

genie::table::inv_list::inv_list ( std::vector< int > &  vin)

◆ inv_list() [3/5]

genie::table::inv_list::inv_list ( std::vector< int > *  vin)

◆ inv_list() [4/5]

genie::table::inv_list::inv_list ( std::vector< std::string > &  vin)

◆ inv_list() [5/5]

genie::table::inv_list::inv_list ( std::vector< std::string > *  vin)

Member Function Documentation

◆ _shift_bits_subsequence()

unsigned int genie::table::inv_list::_shift_bits_subsequence ( )
Returns
The shift bits used in subsequence search

Definition at line 290 of file inv_list.cc.

◆ contains()

bool genie::table::inv_list::contains ( int  value)

Check whether the vaule is in the inv_list.

Parameters
valueThe given value.
Returns
True only if the vaule is in the inv_list.

Definition at line 373 of file inv_list.cc.

◆ index()

vector< int > * genie::table::inv_list::index ( int  value)

The indexes of the value.

Parameters
valueThe given value.

The value's indexes in the original vector. Return NULL if the given value does not appear in the original vector.

Returns
Pointer points to the indexes vector. NULL if the value does not appear in the original vector.

Definition at line 381 of file inv_list.cc.

◆ invert() [1/6]

void genie::table::inv_list::invert ( std::vector< int > &  vin)

◆ invert() [2/6]

void genie::table::inv_list::invert ( std::vector< int > *  vin)

◆ invert() [3/6]

void genie::table::inv_list::invert ( std::vector< std::string > &  vin)

◆ invert() [4/6]

void genie::table::inv_list::invert ( std::vector< std::string > *  vin)

◆ invert() [5/6]

void genie::table::inv_list::invert ( std::vector< std::string > &  vin,
int(*)(std::string &)  stoi 
)

◆ invert() [6/6]

void genie::table::inv_list::invert ( std::vector< std::string > *  vin,
int(*)(std::string &)  stoi 
)

◆ invert_bijectMap() [1/2]

void genie::table::inv_list::invert_bijectMap ( std::vector< std::vector< int > > &  vin)

◆ invert_bijectMap() [2/2]

void genie::table::inv_list::invert_bijectMap ( int *  data,
unsigned int  item_num,
unsigned int *  index,
unsigned int  row_num 
)

Handle input from binary file.

Parameters
dataThe data array
item_numLength of data array
indexStores the starting position of each data point in data array
row_numLength of index array

This function does the same thing as invert_bijectMap(vector<vector<int> > & vin), but the input is from a binary form.

Definition at line 160 of file inv_list.cc.

◆ invert_sequence()

void genie::table::inv_list::invert_sequence ( std::vector< std::vector< int >> &  vin,
int  shift_bits 
)

This is used for sequence match.

Parameters
vinData to be inverted.
shift_bitsNumber of bits to shift.

Definition at line 87 of file inv_list.cc.

◆ invert_subsequence() [1/2]

void genie::table::inv_list::invert_subsequence ( std::vector< std::vector< int >> &  vin)

◆ invert_subsequence() [2/2]

void genie::table::inv_list::invert_subsequence ( int *  data,
unsigned int  item_num,
unsigned int *  index,
unsigned int  row_num 
)

This function is used for subsequence search, binary input.

Parameters
dataArray storing all sequence elements
item_numLength of data array
indexStores elements pointing to starting position of each row in data array
row_numLength of index array

Definition at line 232 of file inv_list.cc.

◆ max()

int genie::table::inv_list::max ( )

Return the max value of the inverted vector.

Returns
The max value of the inverted vector.

Definition at line 42 of file inv_list.cc.

◆ min()

int genie::table::inv_list::min ( )

Return the min value of the inverted vector.

Returns
The min value of the inverted vector.

Definition at line 37 of file inv_list.cc.

◆ size()

int genie::table::inv_list::size ( )

Return the number of instances.

Returns
The number of instances.

Definition at line 47 of file inv_list.cc.

◆ value_range()

int genie::table::inv_list::value_range ( )

Return the number of different values in the attribute.

Returns
Number of different values in the attribute

Definition at line 389 of file inv_list.cc.

Member Data Documentation

◆ _distinct

std::unordered_map<int, int> genie::table::inv_list::_distinct

Definition at line 29 of file inv_list.h.


The documentation for this class was generated from the following files: