Home / Function/ constructBWT() — netty Function Reference

constructBWT() — netty Function Reference

Architecture documentation for the constructBWT() function in Bzip2DivSufSort.java from the netty codebase.

Function java Buffer Allocators calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  71936f19_b076_f482_5166_c6ce04a2d94a["constructBWT()"]
  5a60cb70_bf06_95bf_9c73_ed3a4dc24eba["Bzip2DivSufSort"]
  71936f19_b076_f482_5166_c6ce04a2d94a -->|defined in| 5a60cb70_bf06_95bf_9c73_ed3a4dc24eba
  d7e270d3_9d54_aab4_dd8c_b1bfb8a8ff6b["bwt()"]
  d7e270d3_9d54_aab4_dd8c_b1bfb8a8ff6b -->|calls| 71936f19_b076_f482_5166_c6ce04a2d94a
  e627db04_4e9c_0de6_129b_b28a369b0a3a["BUCKET_BSTAR()"]
  71936f19_b076_f482_5166_c6ce04a2d94a -->|calls| e627db04_4e9c_0de6_129b_b28a369b0a3a
  9815fd83_7f39_0bca_3dc5_c8bf594bcb17["BUCKET_B()"]
  71936f19_b076_f482_5166_c6ce04a2d94a -->|calls| 9815fd83_7f39_0bca_3dc5_c8bf594bcb17
  style 71936f19_b076_f482_5166_c6ce04a2d94a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2DivSufSort.java lines 2021–2089

    private int constructBWT(final int[] bucketA, final int[] bucketB) {
        final byte[] T = this.T;
        final int[] SA = this.SA;
        final int n = this.n;

        int i, j, t = 0;
        int s, s1;
        int c0, c1, c2 = 0;
        int orig = -1;

        for (c1 = 254; 0 <= c1; --c1) {
            for (i = bucketB[BUCKET_BSTAR(c1, c1 + 1)], j = bucketA[c1 + 1], t = 0, c2 = -1;
                    i <= j;
                    --j) {
                if (0 <= (s1 = s = SA[j])) {
                    if (--s < 0) {
                        s = n - 1;
                    }
                    if ((c0 = T[s] & 0xff) <= c1) {
                        SA[j] = ~s1;
                        if (0 < s && (T[s - 1] & 0xff) > c0) {
                            s = ~s;
                        }
                        if (c2 == c0) {
                            SA[--t] = s;
                        } else {
                            if (0 <= c2) {
                                bucketB[BUCKET_B(c2, c1)] = t;
                            }
                            SA[t = bucketB[BUCKET_B(c2 = c0, c1)] - 1] = s;
                        }
                    }
                } else {
                    SA[j] = ~s;
                }
            }
        }

        for (i = 0; i < n; ++i) {
            if (0 <= (s1 = s = SA[i])) {
                if (--s < 0) {
                    s = n - 1;
                }
                if ((c0 = T[s] & 0xff) >= (T[s + 1] & 0xff)) {
                    if (0 < s && (T[s - 1] & 0xff) < c0) {
                        s = ~s;
                    }
                    if (c0 == c2) {
                        SA[++t] = s;
                    } else {
                        if (c2 != -1) {
                            bucketA[c2] = t;    // BUGFIX: Original code can write to bucketA[-1]
                        }
                        SA[t = bucketA[c2 = c0] + 1] = s;
                    }
                }
            } else {
                s1 = ~s1;
            }

            if (s1 == 0) {
                SA[i] = T[n - 1];
                orig = i;
            } else {
                SA[i] = T[s1 - 1];
            }
        }
        return orig;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does constructBWT() do?
constructBWT() is a function in the netty codebase, defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2DivSufSort.java.
Where is constructBWT() defined?
constructBWT() is defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2DivSufSort.java at line 2021.
What does constructBWT() call?
constructBWT() calls 2 function(s): BUCKET_B, BUCKET_BSTAR.
What calls constructBWT()?
constructBWT() is called by 1 function(s): bwt.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free