From eea9c5c03f004e3facd74f004ded0e3801e72ab2 Mon Sep 17 00:00:00 2001 From: nvalimak Date: Tue, 10 Mar 2009 19:09:33 +0000 Subject: [PATCH] Added support for char arrays git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@238 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- libcds/src/static_sequence/wt_coder_binary.cpp | 7 +++++++ libcds/src/static_sequence/wt_coder_binary.h | 1 + 2 files changed, 8 insertions(+) diff --git a/libcds/src/static_sequence/wt_coder_binary.cpp b/libcds/src/static_sequence/wt_coder_binary.cpp index f8cc209..e9f37dc 100644 --- a/libcds/src/static_sequence/wt_coder_binary.cpp +++ b/libcds/src/static_sequence/wt_coder_binary.cpp @@ -28,6 +28,13 @@ wt_coder_binary::wt_coder_binary(uint * seq, uint n, alphabet_mapper * am) { h=bits(max_v); } +wt_coder_binary::wt_coder_binary(uchar * seq, uint n, alphabet_mapper * am) { + uint max_v = 0; + for(uint i=0;imap((uint)seq[i]),max_v); + h=bits(max_v); +} + wt_coder_binary::wt_coder_binary() {} wt_coder_binary::~wt_coder_binary() {} diff --git a/libcds/src/static_sequence/wt_coder_binary.h b/libcds/src/static_sequence/wt_coder_binary.h index 2b87854..850daf2 100644 --- a/libcds/src/static_sequence/wt_coder_binary.h +++ b/libcds/src/static_sequence/wt_coder_binary.h @@ -36,6 +36,7 @@ class wt_coder_binary: public wt_coder { /** Buils a wt_coder_binary using the sequence of length n and the alphabet_mapper * to determine the length of the binary codes */ wt_coder_binary(uint * seq, uint n, alphabet_mapper * am); + wt_coder_binary(uchar * seq, uint n, alphabet_mapper * am); virtual ~wt_coder_binary(); virtual bool is_set(uint symbol, uint l); virtual bool done(uint symbol, uint l); -- 2.17.1