Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to boost trsort on some files #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/divsufsort_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ sssort(const sauchar_t *Td, const saidx_t *PA,
saidx_t depth, saidx_t n, saint_t lastsuffix);
/* trsort.c */
void
trsort(saidx_t *ISA, saidx_t *SA, saidx_t n, saidx_t depth);
trsort(saidx_t *ISA, saidx_t *SA, saidx_t n, saidx_t depth, saidx_t *buf, saidx_t bufsize);


#ifdef __cplusplus
Expand Down
5 changes: 3 additions & 2 deletions lib/divsufsort.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ sort_typeBstar(const sauchar_t *T, saidx_t *SA,
}

/* Construct the inverse suffix array of type B* suffixes using trsort. */
trsort(ISAb, SA, m, 1);
buf = ISAb + m, bufsize = n - (2 * m);
trsort(ISAb, SA, m, 1, buf, bufsize);

/* Set the sorted order of tyoe B* suffixes. */
/* Set the sorted order of type B* suffixes. */
for(i = n - 1, j = m, c0 = T[n - 1]; 0 <= i;) {
for(--i, c1 = c0; (0 <= i) && ((c0 = T[i]) >= c1); --i, c1 = c0) { }
if(0 <= i) {
Expand Down
Loading