Backport changes from the grammar branch
authorkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 30 Apr 2010 08:43:46 +0000 (08:43 +0000)
committerkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 30 Apr 2010 08:43:46 +0000 (08:43 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@827 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

39 files changed:
XMLTree.cpp
XMLTree.h
XMLTreeBuilder.cpp
XMLTreeBuilder.h
basics.h
bp.c
bp.h
bpcore.c
libcds/Makefile
libcds/src/basics.h
libcds/src/coders/huffman_codes.cpp
libcds/src/static_bitsequence/sdarray.cpp
libcds/src/static_bitsequence/static_bitsequence.h
libcds/src/static_bitsequence/static_bitsequence_brw32.cpp
libcds/src/static_bitsequence/static_bitsequence_rrr02.cpp
libcds/src/static_bitsequence/static_bitsequence_rrr02.h
libcds/src/static_bitsequence/static_bitsequence_rrr02_light.cpp
libcds/src/static_bitsequence/static_bitsequence_rrr02_light.h
libcds/src/static_bitsequence/table_offset.h
libcds/src/static_sequence/static_sequence.cpp
libcds/src/static_sequence/static_sequence.h
libcds/src/static_sequence/static_sequence_bs.cpp
libcds/src/static_sequence/static_sequence_gmr.cpp
libcds/src/static_sequence/static_sequence_gmr.h
libcds/src/static_sequence/static_sequence_gmr_chunk.cpp
libcds/src/static_sequence/static_sequence_gmr_chunk.h
libcds/src/static_sequence/static_sequence_wvtree.h
libcds/src/static_sequence/static_sequence_wvtree_noptrs.cpp
libcds/src/static_sequence/static_sequence_wvtree_noptrs.h
libcds/src/static_sequence/wt_coder.h
libcds/src/static_sequence/wt_coder_binary.cpp
libcds/src/static_sequence/wt_node_internal.h
libcds/src/utils/alphabet_mapper.h
libcds/src/utils/alphabet_mapper_cont.cpp
libcds/src/utils/alphabet_mapper_cont.h
libcds/src/utils/alphabet_mapper_none.h
libcds/tests/static_sequence_wvtree_test.cpp
makefile
timings.h

index db9814c..2ebb5a1 100644 (file)
@@ -1,9 +1,12 @@
 #include "basics.h"\r
-//#include <cstring>\r
-#include <stack>\r
 #include "XMLTree.h"\r
 #include "timings.h"\r
 #include <errno.h>\r
+using std::cout;\r
+using std::endl;\r
+using std::min;\r
+using std::string;\r
+\r
 // functions to convert tag positions to the corresponding tree node and viceversa. \r
 // These are implemented in order to be able to change the tree and Tags representations, \r
 // without affecting the code so much.\r
@@ -255,7 +258,7 @@ XMLTree *XMLTree::Load(int fd, bool load_tc,int sample_factor)
     XMLTree *XML_Tree;\r
     int i;\r
 \r
-\r
+    buffer[1023] = '\0';\r
 \r
     fp = fdopen(fd, "r");\r
 \r
@@ -269,23 +272,21 @@ XMLTree *XMLTree::Load(int fd, bool load_tc,int sample_factor)
     PRINTTIME("Loading parenthesis struct", Loading);\r
     STARTTIMER();\r
 \r
-    XML_Tree->TagName = new vector<string>();\r
-    XML_Tree->tIdMap = new std::unordered_map<string,int>();\r
-    \r
-    string s;\r
+    XML_Tree->TagName = new std::vector<std::string>();\r
+    XML_Tree->tIdMap = new std::unordered_map<std::string,int>();\r
+    std::string s;\r
     int ntags;\r
     \r
     // Load the tag names\r
     ufread(&ntags, sizeof(int), 1, fp);\r
 \r
     for (i=0; i<ntags;i++) {\r
-      char * r = fgets(buffer,1023,fp);\r
-       if (r==NULL)\r
+       if (fgets(buffer,1022,fp) != buffer)\r
         throw "Cannot read tag list";\r
-       s = (const char*) buffer;\r
+       s = buffer;\r
        // remove the trailing \n\r
        s.erase(s.size()-1);       \r
-       XML_Tree->TagName->push_back(s);\r
+       XML_Tree->TagName->push_back(s);       \r
        XML_Tree->tIdMap->insert(std::make_pair(s,i));\r
        \r
     };\r
@@ -538,22 +539,6 @@ treeNode XMLTree::NextElement(treeNode x)
   }\r
   else return x;  \r
 }\r
-value XMLTree::CamlFirstElement(value x)\r
-{\r
-  return Val_int(FirstElement(Int_val(x)));\r
-}\r
-value XMLTree::CamlNextElement(value x)\r
-{\r
-  return Val_int(NextElement(Int_val(x)));\r
-}\r
-\r
-extern "C" value caml_cpp_fast_first_element(value xmltree, value node){\r
-  return XMLTREE(xmltree)->CamlFirstElement(node);\r
-}\r
-\r
-extern "C" value caml_cpp_fast_next_element(value xmltree, value node){\r
-  return XMLTREE(xmltree)->CamlNextElement(node);\r
-}\r
 \r
 // LastChild(x): returns the last child of node x.\r
 treeNode XMLTree::LastChild(treeNode x)\r
index ea7b778..6d11d78 100644 (file)
--- a/XMLTree.h
+++ b/XMLTree.h
 \r
 #ifndef XMLTREE_H_\r
 #define XMLTREE_H_\r
-extern "C" {\r
-#define CAML_NAME_SPACE\r
-#include <caml/mlvalues.h>\r
-#include <caml/custom.h>\r
-#define XMLTREE(x) ((XMLTree *)(* (XMLTree**) Data_custom_val(x)))\r
-  //#define XMLTREE(x) ((XMLTree*) (x))\r
-}\r
+\r
+\r
 #include <unordered_set>\r
 #include <unordered_map>\r
 #include <sstream>\r
 #include "TextCollection/TextCollectionBuilder.h"\r
 \r
-#include <cstdio>\r
-#include <cstdlib>\r
-#include <cstring>\r
-\r
-\r
 #undef W\r
 #undef WW\r
 #undef Wminusone\r
@@ -50,7 +40,6 @@ using SXSI::TextCollection;
 using SXSI::TextCollectionBuilder;\r
 \r
 \r
-\r
 // this constant is used to efficiently compute the child operation in the tree\r
 #define OPTD 10\r
 \r
@@ -96,7 +85,7 @@ typedef struct {
 \r
 \r
 typedef std::unordered_set<int> TagIdSet;\r
-typedef std::unordered_map<string,int> TagIdMap;\r
+typedef std::unordered_map<std::string,int> TagIdMap;\r
 typedef TagIdMap::const_iterator TagIdMapIT;\r
 \r
 #define REGISTER_TAG(v,h,t) do { (h)->insert(std::make_pair((t),(v)->size()));\\r
@@ -123,7 +112,7 @@ class XMLTree {
    bp *Par;\r
  \r
    /** Mapping from tag identifer to tag name */  \r
-   vector<string> *TagName;\r
+   std::vector<std::string> *TagName;\r
    TagIdMap * tIdMap;\r
   \r
    /** Bit vector indicating with a 1 the positions of the non-empty texts. */\r
@@ -142,7 +131,7 @@ class XMLTree {
    \r
    FILE* stream;\r
    int   stream_fd; \r
-   string * buffer;\r
+   std::string * buffer;\r
    void myfputs(const char* s, FILE * fp){\r
      buffer->append(s);\r
      if (buffer->size() >= 100000){\r
@@ -181,7 +170,7 @@ class XMLTree {
    XMLTree(){ buffer = 0;};\r
 \r
    // non const pointer are freed by this method.\r
-  XMLTree( pb * const par, uint npar,  vector<string> * const TN,  TagIdMap * const tim, uint *empty_texts_bmp, TagType *tags,\r
+   XMLTree( pb * const par, uint npar,  std::vector<std::string> * const TN,  TagIdMap * const tim, uint *empty_texts_bmp, TagType *tags,\r
           TextCollection * const TC, bool dis_tc);\r
 \r
 public: \r
@@ -271,7 +260,7 @@ public:
     *    if none.\r
     */\r
    treeNode FirstElement(treeNode x);\r
-   value CamlFirstElement(value x);\r
+\r
    /** LastChild(x): returns the last child of node x.  */\r
    treeNode LastChild(treeNode x);\r
    \r
@@ -284,7 +273,7 @@ public:
     *    if none.\r
     */\r
    treeNode NextElement(treeNode x);\r
-   value CamlNextElement(value x);\r
+\r
    /** PrevSibling(x): returns the previous sibling of node x, assuming it \r
     * exists. */\r
 \r
@@ -511,8 +500,6 @@ public:
 \r
 };\r
 \r
-extern "C" value caml_cpp_fast_first_element(value xmltree, value node);\r
-extern "C" value caml_cpp_fast_next_element(value xmltree, value node);\r
 \r
 \r
 \r
index 595ca79..9f7d060 100644 (file)
@@ -1,6 +1,7 @@
 #include "basics.h"\r
 #include "XMLTreeBuilder.h"\r
 #include "timings.h"\r
+using std::string;\r
 \r
 XMLTreeBuilder::~XMLTreeBuilder(){\r
   \r
index 7dc08a1..055eeda 100644 (file)
 #ifndef XMLTREEBUILDER_H_\r
 #define XMLTREEBUILDER_H_\r
 \r
-#include <cstdlib>\r
-#include <cstdio>\r
-#include <cstring>\r
-#include <unordered_map>\r
 #include "TextCollection/TextCollectionBuilder.h"\r
 #undef W\r
 #undef WW\r
 \r
 \r
 #include "XMLTree.h"\r
-#include "bp.h"\r
-#include <static_bitsequence.h>\r
-#include <alphabet_mapper.h>\r
-#include <static_sequence.h>\r
 \r
 using SXSI::TextCollection;\r
 using SXSI::TextCollectionBuilder;\r
@@ -58,7 +50,7 @@ class XMLTreeBuilder {
    int npar;\r
 \r
    /** Mapping from tag identifer to tag name */  \r
-   vector<string> *TagName;\r
+   std::vector<std::string> *TagName;\r
    TagIdMap * tIdMap;\r
    /** Array containing the sequence of tags */\r
    TagType *tags_aux;\r
@@ -69,7 +61,7 @@ class XMLTreeBuilder {
    \r
    /** The texts in the XML document (cached for faster display) */\r
 \r
-   vector<string> *CachedText;\r
+   std::vector<std::string> *CachedText;\r
 \r
    unsigned int *empty_texts_aux;\r
    int eta_size;\r
@@ -101,12 +93,12 @@ public:
    /** NewOpenTag(tagname): indicates the event of finding a new opening tag \r
     * in the document. Tag name is given. Returns a non-zero value upon \r
     * success, and returns NULLT in case of error. */\r
-   int NewOpenTag(string tagname);\r
+   int NewOpenTag(std::string tagname);\r
    \r
    /** NewClosingTag(tagname): indicates the event of finding a new closing tag\r
     *  in the document. Tag name is given. Returns a non-zero value upon \r
     *  success, and returns NULLT in case of error. */\r
-   int NewClosingTag(string tagname);\r
+   int NewClosingTag(std::string tagname);\r
  \r
    /** NewText(s): indicates the event of finding a new text s in \r
     * the document. The new text is inserted within the text collection. \r
@@ -115,7 +107,7 @@ public:
     * the string the sequence '\0x01\0x00' is inserted in the TextCollection\r
     * It is ok to do so since a non printable character cannot occur in an XML document\r
     */\r
-   int NewText(string text);\r
+   int NewText(std::string text);\r
 \r
 \r
 };\r
index 7449c11..97cbec1 100644 (file)
--- a/basics.h
+++ b/basics.h
@@ -1,21 +1,21 @@
-#ifndef BASICS_H\r
-#define BASICS_H\r
+#ifndef BASICS_H_\r
+#define BASICS_H_\r
+\r
 \r
-#include <string>\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
-#include <string.h> // for memset\r
+//#include <string.h> // for memset\r
 #include <sys/types.h>\r
 #include <unistd.h>\r
 #include <errno.h>\r
-\r
+#define B_ERROR(msg) do { fprintf(stderr,"%s\n", msg); exit(1); } while (0)\r
 \r
 inline void ufread(void *ptr, size_t size, size_t nmemb, FILE *stream)\r
  {\r
     size_t res;\r
     res = fread(ptr,size,nmemb,stream);\r
     if (res < nmemb)\r
-      throw ("ufread I/O error" );\r
+      B_ERROR ("ufread I/O error" );\r
     return;\r
  }\r
 \r
@@ -24,7 +24,7 @@ inline void ufwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
     size_t res;\r
     res = fwrite(ptr,size,nmemb,stream);\r
     if (res < nmemb)\r
-       throw "ufwrite I/O error";\r
+      B_ERROR("ufwrite I/O error");\r
     return;\r
  }\r
 \r
@@ -33,7 +33,7 @@ inline void *urealloc(void *ptr, size_t size)
     void *dest = realloc(ptr,size);\r
     //don't fail if we requested size 0\r
     if (dest == NULL && size > 0 )\r
-       throw std::bad_alloc();\r
+      B_ERROR("urealoc error");\r
     return dest;\r
  }\r
 // realloc and set to 0\r
@@ -45,10 +45,12 @@ inline void *urecalloc(void *ptr, size_t o_size, size_t n_size)
     void *dest = realloc(ptr,n_size);\r
     //don't fail if we requested size 0\r
     if (dest == NULL && n_size > 0 )\r
-      throw std::bad_alloc();\r
+      B_ERROR("urecalloc error");\r
     // Initialize the new area with 0\r
     void * n_area_start = &(((char*) dest)[o_size]);\r
-    memset(n_area_start,0, n_size - o_size);\r
+    // memset(n_area_start,0, n_size - o_size);\r
+    for(size_t i = 0; i < n_size - o_size;i++)\r
+      ((char *) n_area_start)[i] = 0;\r
     return dest;\r
  }\r
 \r
@@ -57,7 +59,7 @@ inline void *ucalloc(size_t nmemb, size_t size)
     void * dest = calloc(nmemb,size);\r
     //don't fail if we requested size 0\r
     if (dest == NULL && nmemb > 0 && size > 0 )\r
-       throw std::bad_alloc();\r
+      B_ERROR("ucalloc error");\r
     return dest;\r
  }\r
 \r
@@ -65,7 +67,7 @@ inline void *umalloc(size_t size)
  {\r
     void * dest = malloc(size);\r
     if (dest == NULL && size > 0)\r
-       throw std::bad_alloc();\r
+      B_ERROR("umaloc error");\r
     return dest;\r
  }\r
 \r
diff --git a/bp.c b/bp.c
index 6b7e296..1745621 100644 (file)
--- a/bp.c
+++ b/bp.c
@@ -1,4 +1,7 @@
 #include "bp.h"\r
+#include <algorithm>\r
+using std::min;\r
+using std::max;\r
 \r
 //#define CHECK\r
 #define RANDOM\r
@@ -93,14 +96,16 @@ int degtbl2[(2*ETW+1)*(1<<ETW)];
 int childtbl[(ETW)*(1<<ETW)];\r
 int childtbl2[2*ETW+1][ETW][(1<<ETW)];\r
 int depthtbl[(2*ETW+1)*(1<<ETW)];\r
-\r
+int inited = 0;\r
 void make_matchtbl(void)\r
 {\r
   int i,j,x,r;\r
   int m,M;\r
   pb buf[1];\r
   int deg;\r
-\r
+  if (inited)\r
+    return;\r
+  inited = 1;\r
   for (x = 0; x < (1<<ETW); x++) {\r
     setbits(buf,0,ETW,x);\r
     for (r=-ETW; r<=ETW; r++) fwdtbl[((r+ETW)<<ETW)+x] = ETW;\r
diff --git a/bp.h b/bp.h
index c4e05e4..f109026 100644 (file)
--- a/bp.h
+++ b/bp.h
 #define ETW 8   // width of excess lookup table
 #define W1 2    // branching factor
 
-#ifndef min
- #define min(x,y) ((x)<(y)?(x):(y))
-#endif
-#ifndef max
- #define max(x,y) ((x)>(y)?(x):(y))
-#endif
 
 
 typedef struct {
@@ -171,4 +165,5 @@ extern int childtbl[(ETW)*(1<<ETW)];
 extern int depthtbl[(2*ETW+1)*(1<<ETW)];
 extern int childtbl2[2*ETW+1][ETW][(1<<ETW)];
 
+
 #endif 
index 18e9cc9..acb37bf 100644 (file)
--- a/bpcore.c
+++ b/bpcore.c
@@ -1,6 +1,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "bp.h"
+#ifndef min
+ #define min(x,y) ((x)<(y)?(x):(y))
+#endif
+#ifndef max
+ #define max(x,y) ((x)>(y)?(x):(y))
+#endif
 
 #define NOTFOUND -2
 #define CONTINUE -3
index b6a856c..678a108 100644 (file)
@@ -1,5 +1,5 @@
 
-all: clean libcompact tests
+all: clean libcompact 
 
 
 doc:
index 3376902..85bfe22 100644 (file)
@@ -32,7 +32,7 @@
 #include <sys/stat.h>
 #include <iostream>
 #include <iostream>
-using namespace std;
+////using namespace std;
 #include <cstdlib>
 #include <cmath>
 
index e603133..d11458d 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include <huffman_codes.h>
+using std::max;
 
 huffman_codes::huffman_codes(uint * symb, uint n) {
   uint max_v = 0;
index 258162a..4fe52b2 100644 (file)
@@ -1,6 +1,7 @@
 
 #include <sdarray.h>
-
+using std::min;
+using std::max;
 #if 0
 typedef unsigned int qword;
 #define logD 4
index b150974..d8e3f18 100644 (file)
@@ -31,7 +31,7 @@
 #include <iostream>
 
 
-using namespace std;
+//using namespace std;
 
 /** Base class for static bitsequences, contains many abstract functions, so this can't
  *  be instantiated. It includes base implementations for rank0, select0 and select1 based
index f671a72..204ce57 100644 (file)
@@ -23,7 +23,8 @@
 #include <cassert>
 #include <cmath>
 // #include <sys/types.h>
-
+using std::cout;
+using std::endl;
 
 /////////////
 //Rank(B,i)// 
index 47a382e..18396fa 100644 (file)
@@ -20,7 +20,8 @@
  */
 
 #include <static_bitsequence_rrr02.h>
-
+using std::min;
+using std::max;
 table_offset * static_bitsequence_rrr02::E = NULL;
 
 static_bitsequence_rrr02::static_bitsequence_rrr02() {
index 3327672..e50d273 100644 (file)
@@ -31,7 +31,7 @@
 #include <cassert>
 #include <iostream>
 
-using namespace std;
+//using namespace std;
 
 /** Implementation of Raman, Raman and Rao's [1] proposal for rank/select capable
  *  data structures, it achieves space nH_0, O(sample_rate) time for rank and O(log len) 
index f073e69..793b7af 100644 (file)
@@ -20,7 +20,8 @@
  */
 
 #include <static_bitsequence_rrr02_light.h>
-
+using std::min;
+using std::max;
 #define VARS_NEEDED uint C_len = len/BLOCK_SIZE_LIGHT + (len%BLOCK_SIZE_LIGHT!=0);\
 uint C_field_bits = bits(BLOCK_SIZE_LIGHT);\
 uint O_len = uint_len(1,O_bits_len);\
index 15da0a9..2a5d57f 100644 (file)
@@ -31,7 +31,7 @@
 #include <cassert>
 #include <iostream>
 
-using namespace std;
+//using namespace std;
 
 /** Implementation of Raman, Raman and Rao's [1] proposal for rank/select capable
  *  data structures, it achieves space nH_0, O(sample_rate) time for rank and O(log len) 
index 8f7bdeb..aabebba 100644 (file)
@@ -25,7 +25,7 @@
 #include <basics.h>
 #include <iostream>
 
-using namespace std;
+//using namespace std;
 
 /** Universal table required for static_bitsequence_rrr02, Raman, Raman and Rao's [1] 
  *  proposal for rank/select capable data structures, it achieves space nH_0, 
index 9e8c0e4..bd86382 100644 (file)
  */
  
 #include <static_sequence.h>
+using std::max;
+using std::min;
+using std::cout;
+using std::cin;
+using std::endl;
+
 
 static_sequence::static_sequence() {}
 static_sequence::~static_sequence() {}
index 4fa5da4..594a748 100644 (file)
 #include <basics.h>
 #include <iostream>
 #include <vector>
-
+using std::vector;
 #define WVTREE_HDR 2
 #define GMR_CHUNK_HDR 3
 #define GMR_HDR 4
 #define WVTREE_NOPTRS_HDR 5
 #define BS_HDR 6
 
-using namespace std;
+//using namespace std;
 
 /** Base class for static sequences, contains many abstract functions, so this can't
  *  be instantiated. 
index 83f18c7..f04325e 100644 (file)
@@ -1,6 +1,6 @@
 
 #include <static_sequence_bs.h>
-
+using std::max;
 static_sequence_bs::static_sequence_bs(uint * seq, uint n, alphabet_mapper * am, static_bitsequence_builder * bmb) {
        sigma = 0;
        len = n;
index 9203171..d78518f 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include <static_sequence_gmr.h>
-
+using std::max;
 static_sequence_gmr::static_sequence_gmr(uint * sequence, uint n, uint chunk_length, static_bitsequence_builder * bmb, static_sequence_builder * ssb) {
   len = n;
        if(len%chunk_length) len+=chunk_length-len%chunk_length;
index 76e0d65..5159dea 100644 (file)
@@ -30,7 +30,7 @@
 #include <cassert>
 #include <iostream>
 
-using namespace std;
+//using namespace std;
 
 class static_sequence_gmr : public static_sequence {
   public:
index d575e99..5eb105e 100644 (file)
@@ -20,6 +20,7 @@
  */
  
 #include "static_sequence_gmr_chunk.h"
+using std::max;
 
 static_sequence_gmr_chunk::static_sequence_gmr_chunk(uint * sequence, uint chunk_length, static_bitsequence_builder *bmb, static_permutation_builder *pmb) {
   sigma = 0;
index 9c034f5..8e7a11a 100644 (file)
@@ -31,7 +31,7 @@
 #include <cassert>
 #include <iostream>
 
-using namespace std;
+//using namespace std;
 
 /** Implementation of the Chunk of Golynski et al's rank/select
  * data structure [1].
index 5216585..6a112fb 100644 (file)
@@ -32,7 +32,7 @@
 #include <alphabet_mapper.h>
 #include <static_sequence.h>
 
-using namespace std;
+//using namespace std;
 
 /** Wavelet tree implementation using pointers. 
  * 
index 9a4d64c..18ddcbd 100644 (file)
@@ -20,7 +20,8 @@
  */
  
 #include <static_sequence_wvtree_noptrs.h>
-
+using std::min;
+using std::max;
 static_sequence_wvtree_noptrs::static_sequence_wvtree_noptrs(uint * symbols, uint n, static_bitsequence_builder * bmb, alphabet_mapper * am, bool deleteSymbols) {
   this->n=n;
   this->am=am;
index 399f3c2..170cef9 100644 (file)
@@ -30,7 +30,7 @@
 #include <static_sequence.h>
 #include <alphabet_mapper.h>
 
-using namespace std;
+//using namespace std;
 
 class static_sequence_wvtree_noptrs : public static_sequence {
   public:
index 5f6d436..c5dc91e 100644 (file)
@@ -25,7 +25,7 @@
 #include <basics.h>
 #include <iostream>
 
-using namespace std;
+//using namespace std;
 
 #define WT_CODER_HUFF_HDR 2
 #define WT_CODER_BINARY_HDR 3
index e9f37dc..a49efc8 100644 (file)
@@ -20,7 +20,8 @@
  */
  
 #include <wt_coder_binary.h>
-
+using std::min;
+using std::max;
 wt_coder_binary::wt_coder_binary(uint * seq, uint n, alphabet_mapper * am) {
        uint max_v = 0;
   for(uint i=0;i<n;i++)
index d7e41d2..f649de4 100644 (file)
@@ -29,6 +29,7 @@
 #include <static_bitsequence.h>
 #include <static_bitsequence_builder.h>
 #include <cassert>
+using std::vector;
 
 /** Clase for representing internal nodes  
  * 
index faef2ff..9867674 100644 (file)
@@ -28,7 +28,7 @@
 #define ALPHABET_MAPPER_NONE_HDR 2
 #define ALPHABET_MAPPER_CONT_HDR 3
 
-using namespace std;
+//using namespace std;
 
 /** Base class for alphabet mappers
  * 
index f6a9cb5..776899b 100644 (file)
@@ -20,7 +20,7 @@
  */
  
 #include <alphabet_mapper_cont.h>
-
+using std::max;
 alphabet_mapper_cont::alphabet_mapper_cont(uint * seq, uint n, static_bitsequence_builder *bmb) { 
   uint max_v = 0;
   for(uint i=0;i<n;i++)
index 0b323d5..97302de 100644 (file)
@@ -28,7 +28,7 @@
 #include <static_bitsequence.h>
 #include <static_bitsequence_builder.h>
 
-using namespace std;
+//using namespace std;
 
 /** Mapper that doesn't change the value (identity)
  * 
index 8609914..5484451 100644 (file)
@@ -26,7 +26,7 @@
 #include <iostream>
 #include <alphabet_mapper.h>
 
-using namespace std;
+//using namespace std;
 
 /** Mapper that doesn't change the value (identity)
  * 
index 4470f24..6c2820d 100644 (file)
@@ -29,6 +29,7 @@
 #include <static_sequence.h>
 #include <static_sequence_builder.h>
 #include "static_sequence_tester.h"
+using namespace std;
 
 int main(int argc, char ** argv) {
   if(argc!=6) {
index 4eae048..ada8264 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,4 +1,5 @@
-FLAGS =-std=c++0x -O3 -I./libcds/includes/ -I. -fno-PIC\r
+CFLAGS= -g -O0 -I./libcds/includes/ -I.\r
+FLAGS= -std=c++0x $(CFLAGS)\r
 \r
 LIBCDS_A=libcds/lib/libcds.a \r
 OBJECTS_TCO= TextCollection/TextCollection.o TextCollection/TextCollectionBuilder.o TextCollection/TCImplementation.o TextCollection/Tools.o TextCollection/BitRank.o TextCollection/TextStorage.o\r
index 684d4e9..d4c4935 100644 (file)
--- a/timings.h
+++ b/timings.h
@@ -17,10 +17,10 @@ static unsigned int cBuilding = 0;
 
 static struct timeval tmpv1;
 static struct timeval tmpv2;
-static string mem1;
-static string mem2;
+static std::string mem1;
+static std::string mem2;
 
-static void read_procmem(string& memstr) {
+static void read_procmem(std::string& memstr) {
   std::string buf;
   pid_t pid = getpid();
   std::stringstream path;