Commit 2737712f authored by jkvis's avatar jkvis
Browse files

Added utility functions to the library interface

parent bf7c60c6
......@@ -36,7 +36,7 @@ clean_all: clean
$(MAKE) -C tests clean
ar rcs $@ $<
ar rcs $@ $^
$(LIBS): libs
$(MAKE) -C $@ all CFLAGS="$(CFLAGS)"
......@@ -20,6 +20,8 @@ static int const GESA_KEEP_STRINGS = 0;
static int const GESA_DESTROY_STRINGS = 1;
// Generalized Enhanced Suffix Array (GESA)
// is an Enhanced Suffix Array of n strings
typedef struct
size_t n; // the number of strings
......@@ -63,7 +65,7 @@ void GESA_serialize(GESA const* const gesa,
int GESA_deserialize(GESA* const gesa,
FILE* stream);
// Calculates the longest common substring
// Calculates the Longest Common Substring (LCS)
GESA_index_t GESA_lcs(GESA_index_t* document,
GESA_index_t* index,
GESA const* const gesa);
......@@ -72,6 +74,20 @@ GESA_index_t GESA_lcs(GESA_index_t* document,
void GESA_print(GESA const* const gesa,
FILE* stream);
// For now, implemented in utils.c
// Calculates the Longest Common Prefix (LCP) array of suffix array
// On success it return 0
int GESA_calculate_lcp(GESA_char_t const* const string,
size_t const length,
GESA_index_t const* const sa,
GESA_index_t* const lcp);
// Calculates the childtab array for a GESA
void GESA_calculate_childtab(GESA const* const gesa,
GESA_index_t* const childtab);
#if defined(__cplusplus)
} // extern "C"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment