Missing files from the latest version of libcds.googlecode.com
[SXSI/XMLTree.git] / libcds / src / static_sequence / wt_node_internal.cpp
index e741b6f..b4727a3 100644 (file)
@@ -1,7 +1,26 @@
-
+/* wt_node_internal.cpp
+ * Copyright (C) 2008, Francisco Claude, all rights reserved.
+ *
+ * wt_node_internal
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
 #include <wt_node_internal.h>
 
-
 wt_node_internal::wt_node_internal(uint * symbols, uint n, uint l, wt_coder * c, static_bitsequence_builder * bmb) {
        uint * ibitmap = new uint[n/W+1];
        for(uint i=0;i<n/W+1;i++)
@@ -32,7 +51,7 @@ wt_node_internal::wt_node_internal(uint * symbols, uint n, uint l, wt_coder * c,
                }
        }
        if(count_left>0) {
-               if(match_left)
+               if(match_left/* && c->done(left[0],l+1)*/)
                        left_child = new wt_node_leaf(left[0], count_left);
                else
                        left_child = new wt_node_internal(left, count_left, l+1, c, bmb);
@@ -40,7 +59,7 @@ wt_node_internal::wt_node_internal(uint * symbols, uint n, uint l, wt_coder * c,
                left_child = NULL;
        }
        if(count_right>0) {
-               if(match_right)
+               if(match_right/* && c->done(right[0],l+1)*/)
                        right_child = new wt_node_leaf(right[0], count_right);
                else
                        right_child = new wt_node_internal(right, count_right, l+1, c, bmb);