Path: blob/master/Utilities/cmzstd/lib/dictBuilder/divsufsort.h
5042 views
/*1* divsufsort.h for libdivsufsort-lite2* Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.3*4* Permission is hereby granted, free of charge, to any person5* obtaining a copy of this software and associated documentation6* files (the "Software"), to deal in the Software without7* restriction, including without limitation the rights to use,8* copy, modify, merge, publish, distribute, sublicense, and/or sell9* copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following11* conditions:12*13* The above copyright notice and this permission notice shall be14* included in all copies or substantial portions of the Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,17* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES18* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND19* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT20* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,21* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING22* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR23* OTHER DEALINGS IN THE SOFTWARE.24*/2526#ifndef _DIVSUFSORT_H27#define _DIVSUFSORT_H 12829/*- Prototypes -*/3031/**32* Constructs the suffix array of a given string.33* @param T [0..n-1] The input string.34* @param SA [0..n-1] The output array of suffixes.35* @param n The length of the given string.36* @param openMP enables OpenMP optimization.37* @return 0 if no error occurred, -1 or -2 otherwise.38*/39int40divsufsort(const unsigned char *T, int *SA, int n, int openMP);4142/**43* Constructs the burrows-wheeler transformed string of a given string.44* @param T [0..n-1] The input string.45* @param U [0..n-1] The output string. (can be T)46* @param A [0..n-1] The temporary array. (can be NULL)47* @param n The length of the given string.48* @param num_indexes The length of secondary indexes array. (can be NULL)49* @param indexes The secondary indexes array. (can be NULL)50* @param openMP enables OpenMP optimization.51* @return The primary index if no error occurred, -1 or -2 otherwise.52*/53int54divbwt(const unsigned char *T, unsigned char *U, int *A, int n, unsigned char * num_indexes, int * indexes, int openMP);5556#endif /* _DIVSUFSORT_H */575859