Skip to content

Commit 0e20b3c

Browse files
committed
Added ksa.h for ksa.
1 parent 78448f0 commit 0e20b3c

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

C/ksa/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ buildAndPackageLib("ksa32"
44
COMPONENT "ksa32"
55
DESCRIPTION "${PROJECT_DESCRIPTION}\n\n${DESCR}\n\nUses 32-bit integers."
66
CMAKE_EXPORT_NAMESPACE "${PROJECT_NAME}"
7-
PUBLIC_INCLUDES "${CMAKE_CURRENT_LIST_DIR}"
7+
PUBLIC_INCLUDES "${CMAKE_CURRENT_LIST_DIR}/ksa32.h"
88
INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}"
99
)
1010

1111
buildAndPackageLib("ksa64"
1212
COMPONENT "ksa64"
1313
DESCRIPTION "${PROJECT_DESCRIPTION}\n\n${DESCR}\n\nUses 64-bit integers."
1414
CMAKE_EXPORT_NAMESPACE "${PROJECT_NAME}"
15-
PUBLIC_INCLUDES "${CMAKE_CURRENT_LIST_DIR}"
15+
PUBLIC_INCLUDES "${CMAKE_CURRENT_LIST_DIR}/ksa64.h"
1616
INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}"
1717
)
1818

C/ksa/ksa32.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#pragma once
2+
3+
int ksa_bwt(unsigned char *T, int n, int k);
4+
5+
/**
6+
* Recursively construct the suffix array for a string containing multiple
7+
* sentinels. NULL is taken as the sentinel.
8+
*
9+
* @param T NULL terminated input string (there can be multiple NULLs)
10+
* @param SA output suffix array
11+
* @param fs working space available in SA (typically 0 when first called)
12+
* @param n length of T, including the trailing NULL
13+
* @param k size of the alphabet (typically 256 when first called)
14+
* @param cs # bytes per element in T; 1 or sizeof(saint_t) (typically 1 when first called)
15+
*
16+
* @return 0 upon success
17+
*/
18+
int ksa_core(unsigned char const *T, int *SA, int fs, int n, int k, int cs);
19+
20+
/**
21+
* Construct the suffix array for a NULL terminated string possibly containing
22+
* multiple sentinels (NULLs).
23+
*
24+
* @param T[0..n-1] NULL terminated input string
25+
* @param SA[0..n-1] output suffix array
26+
* @param n length of the given string, including NULL
27+
* @param k size of the alphabet including the sentinel; no more than 256
28+
* @return 0 upon success
29+
*/
30+
int ksa_sa(unsigned char const *T, int *SA, int n, int k);

C/ksa/ksa64.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#pragma once
2+
3+
int ksa_bwt64(unsigned char *T, long int n, int k);
4+
5+
/**
6+
* Recursively construct the suffix array for a string containing multiple
7+
* sentinels. NULL is taken as the sentinel.
8+
*
9+
* @param T NULL terminated input string (there can be multiple NULLs)
10+
* @param SA output suffix array
11+
* @param fs working space available in SA (typically 0 when first called)
12+
* @param n length of T, including the trailing NULL
13+
* @param k size of the alphabet (typically 256 when first called)
14+
* @param cs # bytes per element in T; 1 or sizeof(saint_t) (typically 1 when first called)
15+
*
16+
* @return 0 upon success
17+
*/
18+
int ksa_core64(unsigned char const *T, long int *SA, long int fs, long int n, long int k, int cs);
19+
20+
/**
21+
* Construct the suffix array for a NULL terminated string possibly containing
22+
* multiple sentinels (NULLs).
23+
*
24+
* @param T[0..n-1] NULL terminated input string
25+
* @param SA[0..n-1] output suffix array
26+
* @param n length of the given string, including NULL
27+
* @param k size of the alphabet including the sentinel; no more than 256
28+
* @return 0 upon success
29+
*/
30+
int ksa_sa64(unsigned char const *T, long int *SA, long int n, int k);

0 commit comments

Comments
 (0)