Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
felipelouza committed Jun 4, 2018
1 parent 18aab10 commit b3bd847
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 33 deletions.
3 changes: 1 addition & 2 deletions experiments/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ LIBOBJ = \
DEBUG = 0
STDERR = 0
M64 = 0
LARGE_ALPHABET = 0
##

DEFINES = -DDEBUG=$(DEBUG) -DSTDERR=$(STDERR) -DM64=$(M64) -DLARGE_ALPHABET=$(LARGE_ALPHABET)
DEFINES = -DDEBUG=$(DEBUG) -DSTDERR=$(STDERR) -DM64=$(M64)

CFLAGS += $(DEFINES)

Expand Down
16 changes: 5 additions & 11 deletions experiments/lib/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,11 @@
#define I_MIN INT32_MIN
#endif

#ifndef LARGE_ALPHABET
#define LARGE_ALPHABET 0
#endif

#if M64 && LARGE_ALPHABET //8N bytes for s[0..n-1]
typedef int64_t int_text;
#define PRIdT PRId64
#else //4N bytes for s[0..n-1]
typedef int32_t int_text;
#define PRIdT PRId32
#endif
/*! @brief for integer alphabets define text array
* @constraint sizeof(int_t) >= sizeof(int_text)
*/
typedef int32_t int_text; //4N bytes for s[0..n-1]
#define PRIdT PRId32

/**********************************************************************/

Expand Down
21 changes: 11 additions & 10 deletions gsacak.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*
*/

/******************************************************************************/

#ifndef GSACAK_H
#define GSACAK_H

Expand Down Expand Up @@ -57,17 +59,13 @@
#define I_MIN INT32_MIN
#endif

#ifndef LARGE_ALPHABET
#define LARGE_ALPHABET 0
#endif
/*! @brief for integer alphabets define text array
* @constraint sizeof(int_t) >= sizeof(int_text)
*/
typedef int32_t int_text; //4N bytes for s[0..n-1]
#define PRIdT PRId32

#if M64 && LARGE_ALPHABET //8N bytes for s[0..n-1]
typedef int64_t int_text;
#define PRIdT PRId64
#else //4N bytes for s[0..n-1]
typedef int32_t int_text;
#define PRIdT PRId32
#endif
/******************************************************************************/

/** @brief computes the suffix array of string s[0..n-1]
*
Expand All @@ -83,6 +81,7 @@ int sacak(unsigned char *s, uint_t *SA, uint_t n);
*/
int sacak_int(int_text *s, uint_t *SA, uint_t n, uint_t k);

/******************************************************************************/

/** @brief Computes the suffix array SA (LCP, DA) of T^cat in s[0..n-1]
*
Expand All @@ -109,4 +108,6 @@ int gsacak(unsigned char *s, uint_t *SA, int_t *LCP, int_t *DA, uint_t n);
*/
int gsacak_int(int_text *s, uint_t *SA, int_t *LCP, int_t *DA, uint_t n, uint_t k);

/******************************************************************************/

#endif
22 changes: 12 additions & 10 deletions gsais.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*
*/

/******************************************************************************/

#ifndef GSAIS_H
#define GSAIS_H

Expand Down Expand Up @@ -57,17 +59,14 @@
#define I_MIN INT32_MIN
#endif

#ifndef LARGE_ALPHABET
#define LARGE_ALPHABET 0
#endif

#if M64 && LARGE_ALPHABET //8N bytes for s[0..n-1]
typedef int64_t int_text;
#define PRIdT PRId64
#else //4N bytes for s[0..n-1]
typedef int32_t int_text;
#define PRIdT PRId32
#endif
/*! @brief for integer alphabets define text array
* @constraint sizeof(int_t) >= sizeof(int_text)
*/
typedef int32_t int_text; //4N bytes for s[0..n-1]
#define PRIdT PRId32

/******************************************************************************/

/** @brief computes the suffix array of string s[0..n-1]
*
Expand All @@ -83,6 +82,7 @@ int sais(unsigned char *s, uint_t *SA, uint_t n);
*/
int sais_int(int_text *s, uint_t *SA, uint_t n, uint_t k);

/******************************************************************************/

/** @brief Computes the suffix array SA (LCP, DA) of T^cat in s[0..n-1]
*
Expand All @@ -109,4 +109,6 @@ int gsais(unsigned char *s, uint_t *SA, int_t *LCP, int_t *DA, uint_t n);
*/
int gsais_int(int_text *s, uint_t *SA, int_t *LCP, int_t *DA, uint_t n, uint_t k);

/******************************************************************************/

#endif

0 comments on commit b3bd847

Please sign in to comment.