X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_sequence%2Fwt_coder_huff.cpp;h=5ba633bc58ba1c7128a45b131ad38304529eaca9;hb=e38bc834442d5369a523ba47d74865e48995ace4;hp=cf831dc8db6cdc9c064aaffd7a4256118486939e;hpb=450ba3c9c74665094fb8f6821d6cc92d2bf23011;p=SXSI%2FXMLTree.git diff --git a/libcds/src/static_sequence/wt_coder_huff.cpp b/libcds/src/static_sequence/wt_coder_huff.cpp index cf831dc..5ba633b 100644 --- a/libcds/src/static_sequence/wt_coder_huff.cpp +++ b/libcds/src/static_sequence/wt_coder_huff.cpp @@ -31,6 +31,16 @@ wt_coder_huff::wt_coder_huff(uint * symbs, uint n, alphabet_mapper * am) { symbs[i] = am->unmap(symbs[i]); } +wt_coder_huff::wt_coder_huff(uchar * symbs, uint n, alphabet_mapper * am) { + for(uint i=0;imap((uint)symbs[i]); + hc = new huffman_codes(symbs, n); + buffer = new uint[hc->max_length()/W+1]; + s_len = 0; last_symbol = (uint)-1; + for(uint i=0;iunmap((uint)symbs[i]); +} + wt_coder_huff::wt_coder_huff() {} wt_coder_huff::~wt_coder_huff() {