Comments (1)
This input is not valid BWT string. I attempted to decode it with different algorithm (see below) and it failed as well. libsais uses variation of BWT with sentinel symbol ($) as oppose to variation with cyclic permutation (like in bzip2). This BWT variations are not compatible and behavior of libsais_unbwt is not defined for such inputs.
static void unbwt_mergedTL(unsigned char * T, unsigned int * P, int n, int index)
{
unsigned int bucket[256];
for (int i = 0; i < 256; ++i) { bucket[i] = 0; }
for (int i = 0; i < index; ++i)
{
unsigned char c = T[i];
P[i] = ((bucket[c]++) << 8) | c;
}
for (int i = index; i < n; ++i)
{
unsigned char c = T[i];
P[i + 1] = ((bucket[c]++) << 8) | c;
}
for (unsigned int sum = 1, i = 0; i < 256; ++i)
{
unsigned int tmp = sum; sum += bucket[i]; bucket[i] = tmp;
}
for (int p = 0, i = n - 1; i >= 0; --i)
{
unsigned int u = P[p];
unsigned char c = u & 0xff;
T[i] = c; p = (int)((u >> 8) + bucket[c]);
}
}
from libsais.
Related Issues (15)
- multiple vulnerabilities in bzip3 HOT 5
- feature request: binary BWT HOT 1
- segmentation fault when building the suffix array for some large texts HOT 3
- Makefile missing HOT 3
- strange bug in combination with malloc_count HOT 2
- PLCP and LCP arrays for integer suffix trees HOT 1
- Is SA-IS means using induce sort for suffix array? yuta mori has Open source code of SA-IS HOT 2
- intel compiler: libsais64 doesn't produce correct SuffixArray HOT 3
- Constructing the suffix array of a string set HOT 8
- Overlapping parameters are passed to memcpy HOT 2
- The lib builds has some problem HOT 1
- gnuplot?
- Crash for file size close to 2GB HOT 5
- Feature request? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsais.