Concordia
Utils Class Reference

#include <utils.hpp>

Public Member Functions

 Utils ()
 
virtual ~Utils ()
 

Static Public Member Functions

static void writeIndexCharacter (std::ofstream &file, INDEX_CHARACTER_TYPE character)
 
static void writeMarker (std::ofstream &file, SUFFIX_MARKER_TYPE marker)
 
static INDEX_CHARACTER_TYPE readIndexCharacter (std::ifstream &file)
 
static SUFFIX_MARKER_TYPE readMarker (std::ifstream &file)
 
static sauchar_t * indexVectorToSaucharArray (const std::vector< INDEX_CHARACTER_TYPE > &input)
 
static std::vector< sauchar_t > indexVectorToSaucharVector (const std::vector< INDEX_CHARACTER_TYPE > &input)
 
static void appendCharToSaucharVector (boost::shared_ptr< std::vector< sauchar_t > > vector, INDEX_CHARACTER_TYPE character)
 
static void appendCharToSaucharVector (std::vector< sauchar_t > &vector, INDEX_CHARACTER_TYPE character)
 
template<typename T >
static void printVector (const std::vector< T > &vector)
 
static SUFFIX_MARKER_TYPE getIdFromMarker (SUFFIX_MARKER_TYPE marker)
 
static SUFFIX_MARKER_TYPE getOffsetFromMarker (SUFFIX_MARKER_TYPE marker)
 
static SUFFIX_MARKER_TYPE getLengthFromMarker (SUFFIX_MARKER_TYPE marker)
 
static SUFFIX_MARKER_TYPE createMarker (SUFFIX_MARKER_TYPE id, SUFFIX_MARKER_TYPE offset, SUFFIX_MARKER_TYPE length)
 
static double getLogarithmicOverlay (const std::vector< Interval > &intervalList, SUFFIX_MARKER_TYPE sentenceSize, double k)
 
static double getLogarithmicOverlay (const std::vector< MatchedPatternFragment > &fragmentList, SUFFIX_MARKER_TYPE patternSize, double k)
 

Static Public Attributes

static SUFFIX_MARKER_TYPE maxSentenceSize
 

Detailed Description

Class offering a range of simple utility methods.

Constructor & Destructor Documentation

Utils::Utils ( )
explicit

Constructor

Utils::~Utils ( )
virtual

Destructor.

Member Function Documentation

void Utils::appendCharToSaucharVector ( boost::shared_ptr< std::vector< sauchar_t > >  vector,
INDEX_CHARACTER_TYPE  character 
)
static

Appends an index character to a high resolution vector.

Parameters
vectorvector to be appended to
charactercharacter to append

Here is the caller graph for this function:

void Utils::appendCharToSaucharVector ( std::vector< sauchar_t > &  vector,
INDEX_CHARACTER_TYPE  character 
)
static

Appends an index character to a high resolution vector.

Parameters
vectorvector to be appended to
charactercharacter to append
SUFFIX_MARKER_TYPE Utils::createMarker ( SUFFIX_MARKER_TYPE  id,
SUFFIX_MARKER_TYPE  offset,
SUFFIX_MARKER_TYPE  length 
)
static

Creates a marker from given data.

Parameters
idsentence id
offsetoffset
lengthexample length
Returns
generated marker
SUFFIX_MARKER_TYPE Utils::getIdFromMarker ( SUFFIX_MARKER_TYPE  marker)
static

Retrieves sentence id from a marker.

Parameters
markerinput marker
Returns
sentence id

Here is the caller graph for this function:

SUFFIX_MARKER_TYPE Utils::getLengthFromMarker ( SUFFIX_MARKER_TYPE  marker)
static

Retrieves example length from a marker.

Parameters
markerinput marker
Returns
example length

Here is the caller graph for this function:

double Utils::getLogarithmicOverlay ( const std::vector< Interval > &  intervalList,
SUFFIX_MARKER_TYPE  sentenceSize,
double  k 
)
static

Computes overlay score based on a list of non-intersecting intervals.

Parameters
intervalListlist of the intervals
sentenceSizethe total size of the sentence (or pattern)
ksignificance factor. When set to 1, the significance is neutral.
Returns
score

Here is the call graph for this function:

Here is the caller graph for this function:

double Utils::getLogarithmicOverlay ( const std::vector< MatchedPatternFragment > &  fragmentList,
SUFFIX_MARKER_TYPE  patternSize,
double  k 
)
static

Computes overlay score based on a list of non-intersecting fragments.

Parameters
intervalListlist of the intervals
sentenceSizethe total size of the sentence (or pattern)
ksignificance factor. When set to 1, the significance is neutral.
Returns
score

Here is the call graph for this function:

SUFFIX_MARKER_TYPE Utils::getOffsetFromMarker ( SUFFIX_MARKER_TYPE  marker)
static

Retrieves offset from a marker.

Parameters
markerinput marker
Returns
offset

Here is the caller graph for this function:

sauchar_t * Utils::indexVectorToSaucharArray ( const std::vector< INDEX_CHARACTER_TYPE > &  input)
static

Converts a vector of index characters to higher resolution array.

Parameters
inputvector of index characters
Returns
array of smaller parts of characters

Here is the caller graph for this function:

std::vector< sauchar_t > Utils::indexVectorToSaucharVector ( const std::vector< INDEX_CHARACTER_TYPE > &  input)
static

Converts a vector of index characters to higher resolution vector.

Parameters
inputvector of index characters
Returns
vector of smaller parts of characters

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
void Utils::printVector ( const std::vector< T > &  vector)
static

Prints a given vector to standard output.

Parameters
vectorvector to be printed
INDEX_CHARACTER_TYPE Utils::readIndexCharacter ( std::ifstream &  file)
static

Reads an index character from a binary file. Reading restores the order of the bytes in the original character, which was written to the file.

Parameters
filefile to read the character from
Returns
read character

Here is the caller graph for this function:

SUFFIX_MARKER_TYPE Utils::readMarker ( std::ifstream &  file)
static

Reads a marker from a binary file. Reading restores the order of the bytes in the original marker, which was written to the file.

Parameters
filefile to read the marker from
Returns
read marker

Here is the caller graph for this function:

void Utils::writeIndexCharacter ( std::ofstream &  file,
INDEX_CHARACTER_TYPE  character 
)
static

Writes an index character to a binary file. The character is written to the file as bytes, not necessarily in the order in which they come in the character.

Parameters
filefile to write the character to
charactercharacter to write
void Utils::writeMarker ( std::ofstream &  file,
SUFFIX_MARKER_TYPE  marker 
)
static

Writes a marker to a binary file. The marker is written to the file as bytes, not necessarily in the order in which they come in the marker.

Parameters
filefile to write the marker to
markermarker to write

Member Data Documentation

SUFFIX_MARKER_TYPE Utils::maxSentenceSize
static
Initial value:
=
pow(2, SUFFIX_MARKER_SENTENCE_BYTES*8)

Field holding the maximum sentence size allowed in the index.


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