1a28cd43dSSascha Wildner /* 2a28cd43dSSascha Wildner * divsufsort.h for libdivsufsort-lite 3a28cd43dSSascha Wildner * Copyright (c) 2003-2008 Yuta Mori All Rights Reserved. 4a28cd43dSSascha Wildner * 5a28cd43dSSascha Wildner * Permission is hereby granted, free of charge, to any person 6a28cd43dSSascha Wildner * obtaining a copy of this software and associated documentation 7a28cd43dSSascha Wildner * files (the "Software"), to deal in the Software without 8a28cd43dSSascha Wildner * restriction, including without limitation the rights to use, 9a28cd43dSSascha Wildner * copy, modify, merge, publish, distribute, sublicense, and/or sell 10a28cd43dSSascha Wildner * copies of the Software, and to permit persons to whom the 11a28cd43dSSascha Wildner * Software is furnished to do so, subject to the following 12a28cd43dSSascha Wildner * conditions: 13a28cd43dSSascha Wildner * 14a28cd43dSSascha Wildner * The above copyright notice and this permission notice shall be 15a28cd43dSSascha Wildner * included in all copies or substantial portions of the Software. 16a28cd43dSSascha Wildner * 17a28cd43dSSascha Wildner * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18a28cd43dSSascha Wildner * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19a28cd43dSSascha Wildner * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20a28cd43dSSascha Wildner * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21a28cd43dSSascha Wildner * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22a28cd43dSSascha Wildner * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23a28cd43dSSascha Wildner * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24a28cd43dSSascha Wildner * OTHER DEALINGS IN THE SOFTWARE. 25a28cd43dSSascha Wildner */ 26a28cd43dSSascha Wildner 27a28cd43dSSascha Wildner #ifndef _DIVSUFSORT_H 28a28cd43dSSascha Wildner #define _DIVSUFSORT_H 1 29a28cd43dSSascha Wildner 30a28cd43dSSascha Wildner #ifdef __cplusplus 31a28cd43dSSascha Wildner extern "C" { 32a28cd43dSSascha Wildner #endif /* __cplusplus */ 33a28cd43dSSascha Wildner 34a28cd43dSSascha Wildner 35a28cd43dSSascha Wildner /*- Prototypes -*/ 36a28cd43dSSascha Wildner 37a28cd43dSSascha Wildner /** 38a28cd43dSSascha Wildner * Constructs the suffix array of a given string. 39a28cd43dSSascha Wildner * @param T [0..n-1] The input string. 40a28cd43dSSascha Wildner * @param SA [0..n-1] The output array of suffixes. 41a28cd43dSSascha Wildner * @param n The length of the given string. 42a28cd43dSSascha Wildner * @param openMP enables OpenMP optimization. 43a28cd43dSSascha Wildner * @return 0 if no error occurred, -1 or -2 otherwise. 44a28cd43dSSascha Wildner */ 45a28cd43dSSascha Wildner int 46a28cd43dSSascha Wildner divsufsort(const unsigned char *T, int *SA, int n, int openMP); 47a28cd43dSSascha Wildner 48a28cd43dSSascha Wildner /** 49a28cd43dSSascha Wildner * Constructs the burrows-wheeler transformed string of a given string. 50a28cd43dSSascha Wildner * @param T [0..n-1] The input string. 51a28cd43dSSascha Wildner * @param U [0..n-1] The output string. (can be T) 52a28cd43dSSascha Wildner * @param A [0..n-1] The temporary array. (can be NULL) 53a28cd43dSSascha Wildner * @param n The length of the given string. 54a28cd43dSSascha Wildner * @param num_indexes The length of secondary indexes array. (can be NULL) 55a28cd43dSSascha Wildner * @param indexes The secondary indexes array. (can be NULL) 56a28cd43dSSascha Wildner * @param openMP enables OpenMP optimization. 57a28cd43dSSascha Wildner * @return The primary index if no error occurred, -1 or -2 otherwise. 58a28cd43dSSascha Wildner */ 59a28cd43dSSascha Wildner int 60a28cd43dSSascha Wildner divbwt(const unsigned char *T, unsigned char *U, int *A, int n, unsigned char * num_indexes, int * indexes, int openMP); 61a28cd43dSSascha Wildner 62a28cd43dSSascha Wildner 63a28cd43dSSascha Wildner #ifdef __cplusplus 64a28cd43dSSascha Wildner } /* extern "C" */ 65a28cd43dSSascha Wildner #endif /* __cplusplus */ 66a28cd43dSSascha Wildner 67a28cd43dSSascha Wildner #endif /* _DIVSUFSORT_H */ 68