Added support for char arrays
[SXSI/XMLTree.git] / libcds / src / static_sequence / wt_coder_binary.cpp
index f8cc209..e9f37dc 100644 (file)
@@ -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;i<n;i++)
+      max_v = max(am->map((uint)seq[i]),max_v);
+  h=bits(max_v);
+}
+
 wt_coder_binary::wt_coder_binary() {}
 
 wt_coder_binary::~wt_coder_binary() {}