if (!(XML_Tree->indexing_empty_texts)) XML_Tree->EBVector = static_bitsequence_rrr02::load(fp);\r
\r
// loads the tags\r
- XML_Tree->Tags = static_sequence_wvtree::load(fp);\r
+ XML_Tree->Tags = static_sequence::load(fp);\r
\r
// loads the texts \r
XML_Tree->Text->Load(fp,sample_rate_text);\r
free(TagName);\r
\r
if (!indexing_empty_texts) {\r
- EBVector->~static_bitsequence_rrr02();\r
+ //EBVector->~static_bitsequence_rrr02();\r
delete EBVector;\r
EBVector = NULL;\r
}\r
\r
- Tags->~static_sequence_wvtree();\r
+ //Tags->~static_sequence_wvtree();\r
delete Tags;\r
Tags = NULL;\r
\r
- Text->~TextCollection();\r
+ //Text->~TextCollection();\r
delete Text;\r
Text = NULL;\r
\r
initialized = true;\r
finished = false;\r
npar = 0;\r
- ntagnames = 0;\r
- \r
+ parArraySize = 1;\r
+ ntagnames = 0; \r
+ \r
indexing_empty_texts = empty_texts;\r
\r
- par_aux = (pb *)malloc(sizeof(pb));\r
+ par_aux = (pb *)malloc(sizeof(pb)*parArraySize);\r
if (!par_aux) {\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT;\r
}\r
\r
// creates the data structure for the tree topology\r
- Par = (bp *)malloc(sizeof(bp)); \r
+ Par = (bp *)malloc(sizeof(bp));\r
bp_construct(Par, npar, par_aux, OPT_DEGREE|0); \r
// creates structure for tags\r
- alphabet_mapper * am = new alphabet_mapper_none();\r
- static_bitsequence_builder * bmb = new static_bitsequence_builder_rrr02(32); \r
- wt_coder * wtc = new wt_coder_huff((uint *)tags_aux,npar-1,am);\r
- Tags = new static_sequence_wvtree((uint *) tags_aux, (uint) npar-1, wtc, bmb, am);\r
+ static_bitsequence_builder * bmb = new static_bitsequence_builder_brw32(20);\r
+ static_permutation_builder * pmb = new static_permutation_builder_mrrr(PERM_SAMPLE, bmb);\r
+ static_sequence_builder * ssb = new static_sequence_builder_gmr_chunk(bmb, pmb);\r
\r
+ Tags = new static_sequence_gmr((uint *) tags_aux, (uint) npar-1,2*ntagnames, bmb, ssb);\r
+ \r
+ delete bmb;\r
+ delete pmb;\r
+ delete ssb;\r
// makes the text collection static\r
Text->MakeStatic();\r
\r
}\r
\r
// inserts a new opening parentheses in the bit sequence\r
- par_aux = (pb *)realloc(par_aux, sizeof(pb)*(1+npar/(8*sizeof(pb))));\r
+ if (sizeof(pb)*8*parArraySize == npar) { // no space left for the new parenthesis\r
+ par_aux = (pb *)realloc(par_aux, sizeof(pb)*2*parArraySize);\r
+ parArraySize *= 2;\r
+ }\r
+ \r
if (!par_aux) {\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT; \r
}\r
\r
// inserts a new closing parentheses in the bit sequence\r
- par_aux = (pb *)realloc(par_aux, sizeof(pb)*(1+npar/(8*sizeof(pb))));\r
+ if (sizeof(pb)*8*parArraySize == npar) { // no space left for the new parenthesis\r
+ par_aux = (pb *)realloc(par_aux, sizeof(pb)*2*parArraySize);\r
+ parArraySize *= 2;\r
+ }\r
+ \r
if (!par_aux) {\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT; \r
\r
#define NULLT -1\r
\r
+#define PERM_SAMPLE 10\r
+\r
// sets bit p in e\r
#define bitset(e,p) ((e)[(p)/W] |= (1<<((p)%W)))\r
// cleans bit p in e\r
static_bitsequence_rrr02 *EBVector; \r
\r
/** Tag sequence represented with a data structure for rank and select */\r
- static_sequence_wvtree *Tags;\r
+ static_sequence *Tags;\r
\r
/** The texts in the XML document */\r
TextCollection *Text;\r
pb *par_aux;\r
TagType *tags_aux;\r
int npar;\r
+ int parArraySize;\r
int ntagnames;\r
unsigned int *empty_texts_aux;\r
\r
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = libcds
-PROJECT_NUMBER = 1.0
+PROJECT_NUMBER = 0.8
OUTPUT_DIRECTORY = docs/
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
-all: libcompact tests
+all: clean libcompact tests
doc:
- doxygen
+ @echo " [DOC] Generating documentation"
+ @doxygen
libcompact:
- make -C src
+ @echo " [MSG] Entering directory src"
+ @make --no-print-directory -C src
tests: libcompact
- make -C tests
+ @echo " [MSG] Entering directory tests"
+ @make --no-print-directory -C tests
clean:
- make -C src clean
- make -C tests clean
- rm -rf docs/*
- touch docs/delete_me
- rm -f lib/*
- touch lib/delete_me
- rm -f includes/*
- touch includes/delete_me
+ @echo " [MSG] Entering directory src"
+ @make --no-print-directory -C src clean
+ @echo " [MSG] Entering directory tests"
+ @make --no-print-directory -C tests clean
+ @echo " [CLN] Cleaning docs folder"
+ @rm -rf docs/*
+ @touch docs/delete_me
+ @echo " [CLN] Cleaning lib folder"
+ @rm -f lib/*
+ @touch lib/delete_me
+ @echo " [CLN] Cleaning includes folder"
+ @rm -f includes/*
+ @touch includes/delete_me
CPP=g++
-CPPFLAGS=-g3 -Wall
-#CPPFLAGS=-O9 -Wall -DNDEBUG -pedantic
+#CPPFLAGS=-g3 -Wall
+CPPFLAGS=-O9 -w -DNDEBUG
INCL=-I../includes/
CODERS_DIR=coders
CODERS_OBJECTS=$(CODERS_DIR)/huff.o $(CODERS_DIR)/huffman_codes.o
+STATIC_PERMUTATION_DIR=static_permutation
+STATIC_PERMUTATION_OBJECTS=$(STATIC_PERMUTATION_DIR)/perm.o $(STATIC_PERMUTATION_DIR)/static_permutation.o $(STATIC_PERMUTATION_DIR)/static_permutation_mrrr.o $(STATIC_PERMUTATION_DIR)/static_permutation_builder_mrrr.o
+
STATIC_BITSEQUENCE_DIR=static_bitsequence
-STATIC_BITSEQUENCE_OBJECTS=$(STATIC_BITSEQUENCE_DIR)/static_bitsequence.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_naive.o $(STATIC_BITSEQUENCE_DIR)/table_offset.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_rrr02.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_brw32.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_builder_rrr02.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_builder_brw32.o
+STATIC_BITSEQUENCE_OBJECTS=$(STATIC_BITSEQUENCE_DIR)/static_bitsequence.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_naive.o $(STATIC_BITSEQUENCE_DIR)/table_offset.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_rrr02.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_brw32.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_builder_rrr02.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_builder_brw32.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_rrr02_light.o $(STATIC_BITSEQUENCE_DIR)/static_bitsequence_builder_rrr02_light.o
STATIC_SEQUENCE_DIR=static_sequence
-STATIC_SEQUENCE_OBJECTS=$(STATIC_SEQUENCE_DIR)/static_sequence.o $(STATIC_SEQUENCE_DIR)/static_sequence_wvtree.o $(STATIC_SEQUENCE_DIR)/wt_coder_binary.o $(STATIC_SEQUENCE_DIR)/wt_coder_huff.o $(STATIC_SEQUENCE_DIR)/wt_node_internal.o $(STATIC_SEQUENCE_DIR)/wt_node_leaf.o $(STATIC_SEQUENCE_DIR)/wt_coder.o $(STATIC_SEQUENCE_DIR)/wt_node.o
+STATIC_SEQUENCE_OBJECTS=$(STATIC_SEQUENCE_DIR)/static_sequence.o $(STATIC_SEQUENCE_DIR)/static_sequence_wvtree.o $(STATIC_SEQUENCE_DIR)/wt_coder_binary.o $(STATIC_SEQUENCE_DIR)/wt_coder_huff.o $(STATIC_SEQUENCE_DIR)/wt_node_internal.o $(STATIC_SEQUENCE_DIR)/wt_node_leaf.o $(STATIC_SEQUENCE_DIR)/wt_coder.o $(STATIC_SEQUENCE_DIR)/wt_node.o $(STATIC_SEQUENCE_DIR)/static_sequence_gmr_chunk.o $(STATIC_SEQUENCE_DIR)/static_sequence_builder_gmr_chunk.o $(STATIC_SEQUENCE_DIR)/static_sequence_gmr.o $(STATIC_SEQUENCE_DIR)/static_sequence_builder_wvtree.o $(STATIC_SEQUENCE_DIR)/static_sequence_builder_gmr.o $(STATIC_SEQUENCE_DIR)/static_sequence_wvtree_noptrs.o $(STATIC_SEQUENCE_DIR)/static_sequence_builder_wvtree_noptrs.o
UTILS_DIR=utils
-UTILS_OBJECTS=$(UTILS_DIR)/alphabet_mapper_none.o $(UTILS_DIR)/alphabet_mapper.o
+UTILS_OBJECTS=$(UTILS_DIR)/alphabet_mapper_none.o $(UTILS_DIR)/alphabet_mapper.o $(UTILS_DIR)/alphabet_mapper_cont.o
%.o: %.cpp
- $(CPP) $(CPPFLAGS) $(INCL) -c $< -o $@
+ @echo " [C++] Compiling $<"
+ @$(CPP) $(CPPFLAGS) $(INCL) -c $< -o $@
all: lib
clean:
- rm -f $(CODERS_OBJECTS) $(STATIC_BITSEQUENCE_OBJECTS) $(STATIC_SEQUENCE_OBJECTS) $(UTILS_OBJECTS)
+ @echo " [CLN] Removing object files"
+ @rm -f $(CODERS_OBJECTS) $(STATIC_BITSEQUENCE_OBJECTS) $(STATIC_SEQUENCE_OBJECTS) $(UTILS_OBJECTS) $(STATIC_PERMUTATION_OBJECTS)
-lib: pre $(CODERS_OBJECTS) $(STATIC_BITSEQUENCE_OBJECTS) $(STATIC_SEQUENCE_OBJECTS) $(UTILS_OBJECTS)
- ar vrcs ../lib/libcds.a $(CODERS_OBJECTS) $(STATIC_BITSEQUENCE_OBJECTS) $(STATIC_SEQUENCE_OBJECTS) $(UTILS_OBJECTS)
+lib: pre $(CODERS_OBJECTS) $(STATIC_BITSEQUENCE_OBJECTS) $(STATIC_SEQUENCE_OBJECTS) $(UTILS_OBJECTS) $(STATIC_PERMUTATION_OBJECTS)
+ @echo " [LIB] Packing the object files"
+ @ar rcs ../lib/libcds.a $(CODERS_OBJECTS) $(STATIC_BITSEQUENCE_OBJECTS) $(STATIC_SEQUENCE_OBJECTS) $(UTILS_OBJECTS) $(STATIC_PERMUTATION_OBJECTS)
pre:
- cp basics.h ../includes/
- cp */*.h ../includes/
+ @echo " [HDR] Populating the includes folder"
+ @cp basics.h ../includes/
+ @cp */*.h ../includes/
/* basics.h
- * Copyright (C) 2008, Rodrigo Gonzalez & Francisco Claude, all rights reserved.
+ * Copyright (C) 2005, Rodrigo Gonzalez, all rights reserved.
*
* Some preliminary stuff
*
#ifndef _BASICS_H
#define _BASICS_H
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <sys/times.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <iostream>
#include <iostream>
using namespace std;
#include <cstdlib>
#define bitclean(e,p) ((e)[(p)/W] &= ~(1<<((p)%W)))
/** uints required to represent e integers of n bits each */
-#define uint_len(e,n) (((e)*(n))/W+(((e)*(n))%W > 0))
+//#define uint_len(e,n) (((e)*(n))/W+(((e)*(n))%W > 0))
+inline uint uint_len(uint e, uint n) {
+ return ((unsigned long long)e*n/W+((unsigned long long)e*n%W>0));
+}
/** Retrieve a given index from array A where every value uses len bits
* @param A Array
+/* huff.cpp
+ Copyright (C) 2008, Gonzalo Navarro, all rights reserved.
+ Canonical Huffman
+
+ 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
+
+*/
// implements canonical Huffman
#include <huff.h>
*/
void saveHuff (THuff H, FILE *f)
- { uint *symb = (uint*)malloc((H.lim+1)*sizeof(uint));
+ { uint *symb = new uint[H.lim+1];
uint i;
+ for(i=0;i<(H.lim+1);i++) symb[i] = 0;
for (i=0;i<=H.max;i++)
- if (H.s.spos[i] != (uint)~0) symb[H.s.spos[i]] = i;
+ if (H.s.spos[i] != (uint)~0) symb[H.s.spos[i]] = i;
uint l=fwrite (&H.max,sizeof(uint),1,f);
l += fwrite (&H.lim,sizeof(uint),1,f);
l += fwrite (&H.depth,sizeof(uint),1,f);
l += fwrite (symb,sizeof(uint),H.lim+1,f);
l += fwrite (H.num,sizeof(uint),H.depth+1,f);
- free (symb);
+ delete [] (symb);
}
uint sizeHuff (THuff H)
}
return H;
}
-
-
+/* huff.h
+ Copyright (C) 2008, Gonzalo Navarro, all rights reserved.
-// implements canonical Huffman
+ Canonical Huffman
+
+ 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
+
+*/
#ifndef HUFFINCLUDED
#define HUFFINCLUDED
ulong total; // total length to achieve, in bits
} THuff;
- // Creates Huffman encoder given symbols 0..lim with frequencies
- // freq[i], ready for compression
+/** Creates Huffman encoder given symbols 0..lim with frequencies
+ * freq[i], ready for compression
+ *
+ * @author Gonzalo Navarro
+ */
THuff createHuff (uint *freq, uint lim);
- // Encodes symb using H, over stream[ptr...lim] (ptr and lim are
- // bit positions of stream). Returns the new ptr.
-
+/** Encodes symb using H, over stream[ptr...lim] (ptr and lim are
+ * bit positions of stream). Returns the new ptr.
+ *
+ * @author Gonzalo Navarro
+ */
ulong encodeHuff (THuff H, uint symb, uint *stream, ulong ptr);
- // Decodes *symb using H, over stream[ptr...lim] (ptr and lim are
- // bit positions of stream). Returns the new ptr.
-
+/** Decodes *symb using H, over stream[ptr...lim] (ptr and lim are
+ * bit positions of stream). Returns the new ptr.
+ *
+ * @author Gonzalo Navarro
+ */
ulong decodeHuff (THuff H, uint *symb, uint *stream, ulong ptr);
- // Writes H in file f
-
+/** Writes H in file f
+ *
+ * @author Gonzalo Navarro
+ */
void saveHuff (THuff H, FILE *f);
- // Size of H written on file
-
+/** Size of H written on file
+ *
+ * @author Gonzalo Navarro
+ */
uint sizeHuff (THuff H);
- // Frees H
-
+/** Frees H
+ *
+ * @author Gonzalo Navarro
+ */
void freeHuff (THuff H);
- // Loads H from file f, prepared for encoding or decoding depending
- // on enc
-
+/** Loads H from file f, prepared for encoding or decoding depending
+ * on enc
+ *
+ * @author Gonzalo Navarro
+ */
THuff loadHuff (FILE *f, int enc);
#endif
+/* huffman_codes.cpp
+ Copyright (C) 2008, Francisco Claude, all rights reserved.
+
+ Wrapper for huff written by Gonzalo Navarro
+
+ 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 <huffman_codes.h>
ret->huff_table = loadHuff(fp,1);
return ret;
}
-
-
+/* huffman_codes.h
+ Copyright (C) 2008, Francisco Claude, all rights reserved.
+
+ Wrapper for huff written by Gonzalo Navarro
+
+ 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
+
+*/
#ifndef HUFFMAN_CODES_H
#define HUFFMAN_CODES_H
#include <basics.h>
#include <huff.h>
+/** Wrapper for the canonical huffman implementation of Gonzalo Navarro.
+ *
+ * @author Francisco Claude
+ */
class huffman_codes {
public:
+ /** Creates the codes for the sequence seq of length n */
huffman_codes(uint * seq, uint n);
~huffman_codes();
+ /** Encodes symb into stream at bit-position pos, return the ending position (bits) */
ulong encode(uint symb, uint * stream, ulong pos);
+
+ /** decodes into symb from stream at bit-position pos, returns the new position */
ulong decode(uint * symb, uint * stream, ulong pos);
+
+ /** Returns the maximum length of a code */
uint max_length();
+
+ /** Returns the size of the table */
uint size();
+
+ /** Saves the coder to a file */
uint save(FILE *fp);
+
+ /** Loads a coder from a file */
static huffman_codes * load(FILE *fp);
protected:
switch(r) {
case RRR02_HDR: return static_bitsequence_rrr02::load(fp);
case BRW32_HDR: return static_bitsequence_brw32::load(fp);
+ case RRR02_LIGHT_HDR: return static_bitsequence_rrr02_light::load(fp);
}
return NULL;
}
-
#define RRR02_HDR 2
#define BRW32_HDR 3
+#define RRR02_LIGHT_HDR 4
#include <basics.h>
#include <iostream>
};
-#include "static_bitsequence_rrr02.h"
-#include "static_bitsequence_naive.h"
-#include "static_bitsequence_brw32.h"
+#include <static_bitsequence_rrr02.h>
+#include <static_bitsequence_rrr02_light.h>
+#include <static_bitsequence_naive.h>
+#include <static_bitsequence_brw32.h>
#endif /* _STATIC_BITSEQUENCE_H */
-
static_bitsequence_brw32::static_bitsequence_brw32(){
data=NULL;
- this->owner = true;
+// this->owner = true;
this->n=0;
this->factor=0;
}
data[i] = bitarray[i];
for(uint i=uint_len(_n,1);i<_n/W+1;i++)
data[i] = 0;
- this->owner = true;
+ //this->owner = true;
this->n=_n;
uint lgn=bits(n-1);
this->factor=_factor;
static_bitsequence_brw32::~static_bitsequence_brw32() {
delete [] Rs;
- if (owner) delete [] data;
+ delete [] data;
}
//Metodo que realiza la busqueda d
ret->data = new uint[ret->n/W+1];
if (!ret->data) return NULL;
if (fread (ret->data,sizeof(uint),ret->n/W+1,f) != ret->n/W+1) return NULL;
- ret->owner = true;
ret->Rs= new uint[ret->n/ret->s+1];
if (!ret->Rs) return NULL;
if (fread (ret->Rs,sizeof(uint),ret->n/ret->s+1,f) != ret->n/ret->s+1) return NULL;
}
uint static_bitsequence_brw32::SpaceRequirementInBits() {
- return (owner?n:0)+(n/s)*sizeof(uint)*8 +sizeof(static_bitsequence_brw32)*8;
+ return uint_len(n,1)*sizeof(uint)*8+(n/s)*sizeof(uint)*8 +sizeof(static_bitsequence_brw32)*8;
}
uint static_bitsequence_brw32::size() {
- return SpaceRequirementInBits()/8;
+ return sizeof(static_bitsequence_brw32)+SpaceRequirementInBits()/8;
}
uint static_bitsequence_brw32::SpaceRequirement() {
- return (owner?n:0)/8+(n/s)*sizeof(uint)+sizeof(static_bitsequence_brw32);
+ return n/8+(n/s)*sizeof(uint)+sizeof(static_bitsequence_brw32);
}
uint static_bitsequence_brw32::prev2(uint start) {
}
return left-1;
}
+
+uint static_bitsequence_brw32::select0(uint x) {
+ // returns i such that x=rank_0(i) && rank_0(i-1)<x or n if that i not exist
+ // first binary search over first level rank structure
+ // then sequential search using popcount over a int
+ // then sequential search using popcount over a char
+ // then sequential search bit a bit
+
+ //binary search over first level rank structure
+ if(x==0) return 0;
+ uint l=0, r=n/s;
+ uint mid=(l+r)/2;
+ uint rankmid = mid*factor*W-Rs[mid];
+ while (l<=r) {
+ if (rankmid<x)
+ l = mid+1;
+ else
+ r = mid-1;
+ mid = (l+r)/2;
+ rankmid = mid*factor*W-Rs[mid];
+ }
+ //sequential search using popcount over a int
+ uint left;
+ left=mid*factor;
+ x-=rankmid;
+ uint j=data[left];
+ uint zeros = W-popcount(j);
+ while (zeros < x) {
+ x-=zeros;left++;
+ if (left > integers) return n;
+ j = data[left];
+ zeros = W-popcount(j);
+ }
+ //sequential search using popcount over a char
+ left=left*b;
+ rankmid = 8-popcount8(j);
+ if (rankmid < x) {
+ j=j>>8;
+ x-=rankmid;
+ left+=8;
+ rankmid = 8-popcount8(j);
+ if (rankmid < x) {
+ j=j>>8;
+ x-=rankmid;
+ left+=8;
+ rankmid = 8-popcount8(j);
+ if (rankmid < x) {
+ j=j>>8;
+ x-=rankmid;
+ left+=8;
+ }
+ }
+ }
+
+ // then sequential search bit a bit
+ while (x>0) {
+ if (j%2 == 0 ) x--;
+ j=j>>1;
+ left++;
+ }
+ left--;
+ if (left > n) return n;
+ else return left;
+}
class static_bitsequence_brw32 : public static_bitsequence {
private:
uint *data;
- bool owner;
+ //bool owner;
uint n,integers;
uint factor,b,s;
uint *Rs; //superblock array
uint prev(uint start); // gives the largest index i<=start such that IsBitSet(i)=true
uint prev2(uint start); // gives the largest index i<=start such that IsBitSet(i)=true
uint next(uint start); // gives the smallest index i>=start such that IsBitSet(i)=true
+ virtual uint select0(uint x); // gives the position of the x:th 1.
virtual uint select1(uint x); // gives the position of the x:th 1.
uint SpaceRequirementInBits();
uint SpaceRequirement();
};
#endif
-
class static_bitsequence_builder {
public:
virtual ~static_bitsequence_builder() {}
+ /** Builds a static_bitsequence for the bitmap bitsequence of length len */
virtual static_bitsequence * build(uint * bitsequence, uint len)=0;
};
#include <static_bitsequence_builder_rrr02.h>
+#include <static_bitsequence_builder_rrr02_light.h>
#include <static_bitsequence_builder_brw32.h>
#endif /* _STATIC_BITSEQUENCE_BUILDER_H */
+/* static_bitsequence_builder_brw32.cpp
+ * Copyright (C) 2008, Francisco Claude, all rights reserved.
+ *
+ * static_bitsequence_builder_brw32 definition
+ *
+ * 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 <static_bitsequence_builder_brw32.h>
/* static_bitsequence_builder_brw32.h
* Copyright (C) 2008, Francisco Claude, all rights reserved.
*
- * static_bitsequence_builder definition
+ * static_bitsequence_builder_brw32 definition
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
class static_bitsequence_builder_brw32 : public static_bitsequence_builder {
public:
+ /** Defines the sample rate used to build the bitmaps (brw32) */
static_bitsequence_builder_brw32(uint sampling);
virtual ~static_bitsequence_builder_brw32() {}
virtual static_bitsequence * build(uint * bitsequence, uint len);
+/* static_bitsequence_builder_rrr02.cpp
+ * Copyright (C) 2008, Francisco Claude, all rights reserved.
+ *
+ * static_bitsequence_builder_rrr02 definition
+ *
+ * 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 <static_bitsequence_builder_rrr02.h>
/* static_bitsequence_builder_rrr02.h
* Copyright (C) 2008, Francisco Claude, all rights reserved.
*
- * static_bitsequence_builder definition
+ * static_bitsequence_builder_rrr02 definition
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
class static_bitsequence_builder_rrr02 : public static_bitsequence_builder {
public:
+ /** Defines the sample rate used to build the bitmaps (rrr02) */
static_bitsequence_builder_rrr02(uint sampling);
virtual ~static_bitsequence_builder_rrr02() {}
virtual static_bitsequence * build(uint * bitsequence, uint len);
}
int static_bitsequence_naive::save(FILE * fp) { return -1; }
-
*
*/
-#include "static_bitsequence_rrr02.h"
+#include <static_bitsequence_rrr02.h>
table_offset * static_bitsequence_rrr02::E = NULL;
ret->create_sampling(ret->sample_rate);
return ret;
}
-
};
#endif /* _STATIC_BITSEQUENCE_RRR02_H */
-
-
class table_offset {
public:
+ /** builds a universal table, designed for u<=15 */
table_offset(uint u);
~table_offset();
};
#endif
-
static_sequence::~static_sequence() {}
uint static_sequence::length() { return len; }
+uint static_sequence::count(uint s) {
+ return rank(s,len-1);
+}
+
static_sequence * static_sequence::load(FILE * fp) {
uint rd;
if(fread(&rd,sizeof(uint),1,fp)!=1) return NULL;
fseek(fp,-sizeof(uint),SEEK_CUR);
switch(rd) {
case WVTREE_HDR: return static_sequence_wvtree::load(fp);
+ case GMR_CHUNK_HDR: return static_sequence_gmr_chunk::load(fp);
+ case GMR_HDR: return static_sequence_gmr::load(fp);
+ case WVTREE_NOPTRS_HDR: return static_sequence_wvtree_noptrs::load(fp);
}
return NULL;
}
#include <iostream>
#define WVTREE_HDR 2
+#define GMR_CHUNK_HDR 3
+#define GMR_HDR 4
+#define WVTREE_NOPTRS_HDR 5
using namespace std;
virtual uint length();
/** Returns how many cs are in the sequence */
- virtual uint count(uint c)=0;
+ virtual uint count(uint c);
/** Returns the size of the structure in bytes */
virtual uint size()=0;
};
#include <static_sequence_wvtree.h>
+#include <static_sequence_gmr_chunk.h>
+#include <static_sequence_wvtree_noptrs.h>
+#include <static_sequence_gmr.h>
#endif /* _STATIC_SEQUENCE_H */
-
+/* static_sequence_gmr_chunk.cpp
+ * Copyright (C) 2008, Francisco Claude, all rights reserved.
+ *
+ * gmr_chunk
+ *
+ * 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 "static_sequence_gmr_chunk.h"
static_sequence_gmr_chunk::static_sequence_gmr_chunk(uint * sequence, uint chunk_length, static_bitsequence_builder *bmb, static_permutation_builder *pmb) {
sigma = 0;
for(uint i=0;i<chunk_length;i++) {
sigma = max(sigma,sequence[i]);
- }
- uint * X_bitmap = new uint[(1+chunk_length+sigma)/W+1];
+ }sigma++;
+ uint * X_bitmap = new uint[uint_len(1+chunk_length+sigma,1)];
assert(X_bitmap!=NULL);
- for(uint i=0;i<(1+sigma+chunk_length)/W+1;i++) X_bitmap[i]=0;
+ for(uint i=0;i<uint_len(1+chunk_length+sigma,1);i++) X_bitmap[i]=0;
uint pi_blen = bits(chunk_length-1);
- uint * pi = new uint[pi_blen*chunk_length/W+1];
+ uint * pi = new uint[uint_len(pi_blen,chunk_length)];
assert(pi!=NULL);
- for(uint i=0;i<pi_blen*chunk_length/W+1;i++) pi[i] = 0;
+ for(uint i=0;i<uint_len(pi_blen,chunk_length);i++) pi[i] = 0;
uint X_pos = 0;
- uint * counter = new uint[sigma+1];
- for(uint c=0;c<=sigma;c++) counter[c]=0;
+ uint * counter = new uint[sigma+2];
+ for(uint c=0;c<=sigma+1;c++) counter[c]=0;
for(uint i=0;i<chunk_length;i++) counter[sequence[i]+1]++;
for(uint c=0;c<sigma;c++) {
}
X_pos++;
for(uint i=0;i<chunk_length;i++) {
- bitput(pi, pi_blen*counter[sequence[i]], pi_blen, (uint)i);
+ set_field(pi, pi_blen,counter[sequence[i]], i);
counter[sequence[i]]++;
}
- this->X = new BitRankW32Int(X_bitmap, X_pos, true,20);
+ //cout << "pi_blen=" << pi_blen << endl;
+ this->X = bmb->build(X_bitmap,X_pos); //new BitRankW32Int(X_bitmap, X_pos, true,20);
assert(X!=NULL);
- this->permutation = createPerm(pi, chunk_length, t);
+ delete [] X_bitmap;
+ //cout << "a" << endl; cout.flush();
+ this->permutation = pmb->build(pi,chunk_length); //createPerm(pi, chunk_length, t);
+ //cout << "a" << endl; cout.flush();
assert(permutation!=NULL);
this->sigma = sigma;
- this->chunk_length = chunk_length;
+ this->len = chunk_length;
delete [] counter;
}
+static_sequence_gmr_chunk::static_sequence_gmr_chunk() {
+}
static_sequence_gmr_chunk::~static_sequence_gmr_chunk() {
delete X;
}
-uint static_sequence_gmr_chunk::caccess(uint j) {
- uint invPerm = inversePerm(permutation, j);
+uint static_sequence_gmr_chunk::access(uint j) {
+ uint invPerm = permutation->rev_pi(j); //inversePerm(permutation, j);
+ //cout << "invPerm=" << invPerm << endl;
uint rank_pos = X->select1(invPerm+1);
- uint ret = rank_pos - X->rank(rank_pos);// - 1;
+ //cout << "rank_pos=" << rank_pos << endl;
+ uint ret = rank_pos - X->rank1(rank_pos);// - 1;
+ //cout << "ret = " << ret << endl;
return ret;
}
-uint static_sequence_gmr_chunk::cselect(uint i, uint j) {
+uint static_sequence_gmr_chunk::select(uint i, uint j) {
uint pos = X->select0(i+1) + j - i -1;
- return getelemPerm(permutation, pos);
+ /*cout << "pos=" << pos << endl;
+ cout << "pos'=" << X->rank1(X->select0(i+1)+j) << endl;
+ cout << "perm_pos=" << permutation->pi(pos) << endl;*/
+ return permutation->pi(pos); //getelemPerm(permutation, pos);
}
-uint static_sequence_gmr_chunk::crank(uint i, uint j) {
+uint static_sequence_gmr_chunk::rank(uint i, uint j) {
uint ini = X->select0(i+1)-i;
uint ini_o = ini;
uint fin = X->select0(i+2);
if(fin<i+2) return 0;
fin = fin-(i+2);
if(fin<ini) return 0;
- if(getelemPerm(permutation,ini) > j) return 0;
- if(getelemPerm(permutation,ini) == j) return 1;
+ if(permutation->pi(ini) > j) return 0;
+ if(permutation->pi(ini) == j) return 1;
if(ini==fin) return 1;
while(ini < fin-1) {
uint med = (ini+fin)/2;
- uint elem = getelemPerm(permutation, med);
+ uint elem = permutation->pi(med); //getelemPerm(permutation, med);
if(elem >= j) fin = med;
else ini = med;
}
- while(fin>ini_o && getelemPerm(permutation, fin)>j) fin--;
+ while(fin>ini_o && permutation->pi(fin)>j) fin--;
return fin-ini_o+1;
}
uint static_sequence_gmr_chunk::size() {
- return sizeof(BitRankW32Int*)+sizeof(perm*)+(X->SpaceRequirementInBits()/8+sizeofPerm(permutation));
+ return sizeof(static_sequence_gmr_chunk)+permutation->size()+X->size();
+}
+
+uint static_sequence_gmr_chunk::save(FILE *fp) {
+ uint wr = GMR_CHUNK_HDR;
+ wr = fwrite(&wr,sizeof(uint),1,fp);
+ wr += fwrite(&len,sizeof(uint),1,fp);
+ wr += fwrite(&sigma,sizeof(uint),1,fp);
+ if(wr!=3) return 1;
+ if(X->save(fp)) return 1;
+ if(permutation->save(fp)) return 1;
+ return 0;
+}
+
+static_sequence_gmr_chunk * static_sequence_gmr_chunk::load(FILE *fp) {
+ uint rd;
+ if(fread(&rd,sizeof(uint),1,fp)!=1) return NULL;
+ if(rd!=GMR_CHUNK_HDR) return NULL;
+ static_sequence_gmr_chunk * ret = new static_sequence_gmr_chunk();
+ rd = fread(&ret->len,sizeof(uint),1,fp);
+ rd += fread(&ret->sigma,sizeof(uint),1,fp);
+ ret->X = static_bitsequence::load(fp);
+ ret->permutation = static_permutation::load(fp);
+ if(rd!=2 || ret->X==NULL || ret->permutation==NULL) {
+ /*cout << "rd=" << rd << endl;
+ cout << "X =" << ret->X << endl;
+ cout << "P =" << ret->permutation << endl;*/
+ delete ret;
+ return NULL;
+ }
+ return ret;
}
+/* static_sequence_gmr_chunk.h
+ * Copyright (C) 2008, Francisco Claude, all rights reserved.
+ *
+ * gmr_chunk
+ *
+ * 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
+ *
+ */
#ifndef _STATIC_SEQUENCE_GMR_CHUNK_H
#define _STATIC_SEQUENCE_GMR_CHUNK_H
#include <basics.h>
+#include <static_sequence.h>
#include <static_bitsequence.h>
#include <static_bitsequence_builder.h>
#include <static_permutation.h>
+#include <static_permutation_builder.h>
#include <cassert>
#include <iostream>
virtual uint rank(uint i, uint j);
virtual uint size();
virtual uint save(FILE *fp);
- static_sequence_gmr_chunk * load(FILE *fp);
+ static static_sequence_gmr_chunk * load(FILE *fp);
protected:
/** Bitmap */
static_bitsequence * X;
/** Permutation */
- static_permutation permutation;
+ static_permutation * permutation;
/** Size of the alphabet */
uint sigma;
/** Length of the chunk */
- uint chunk_length;
+ //uint chunk_length;
+ static_sequence_gmr_chunk();
};
#endif
-/* static_sequence_wvtree.h
+/* static_sequence_wvtree.cpp
* Copyright (C) 2008, Francisco Claude, all rights reserved.
*
* static_sequence_wvtree definition
for(uint i=0;i<n;i++)
symbols[i] = am->map(symbols[i]);
this->am = am;
+ am->use();
this->c=c;
+ c->use();
root = new wt_node_internal(symbols, n, 0, c, bmb);
for(uint i=0;i<n;i++)
symbols[i] = am->unmap(symbols[i]);
static_sequence_wvtree::~static_sequence_wvtree() {
delete root;
- delete am;
- delete c;
+ am->unuse();
+ c->unuse();
}
uint static_sequence_wvtree::rank(uint symbol, uint pos) {
static_sequence_wvtree * ret = new static_sequence_wvtree();
if(fread(&ret->n,sizeof(uint),1,fp)!=1) return NULL;
ret->c = wt_coder::load(fp);
+ ret->c->use();
ret->am = alphabet_mapper::load(fp);
+ ret->am->use();
ret->root = wt_node::load(fp);
return ret;
}
#include <wt_coder.h>
+wt_coder::wt_coder() {
+ user_count=0;
+}
+
+void wt_coder::use() {
+ user_count++;
+}
+
+void wt_coder::unuse() {
+ user_count--;
+ if(user_count==0) delete this;
+}
+
wt_coder * wt_coder::load(FILE *fp) {
uint rd;
if(fread(&rd,sizeof(uint),1,fp)!=1) return NULL;
*/
class wt_coder {
public:
+ wt_coder();
+ virtual void use();
+ virtual void unuse();
virtual ~wt_coder() {};
/** Tells if at level l the symbol is represented by a one or a zero */
virtual bool is_set(uint symbol, uint l)=0;
virtual uint save(FILE *fp)=0;
/** Loads a coder from a file, returns NULL in case of error */
static wt_coder * load(FILE *fp);
+ protected:
+ uint user_count;
};
#include <wt_coder_huff.h>
}
bool wt_coder_binary::done(uint symbol, uint l) {
- if(l==h-1) return true;
+ if(l==h) return true;
return false;
}
}
}
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);
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);
wt_node_leaf::~wt_node_leaf() {}
uint wt_node_leaf::rank(uint symbol, uint pos, uint l, wt_coder * c) {
- assert(symbol==this->symbol);
+ if(symbol!=this->symbol) return 0;
pos++;
- assert(pos<=count);
return pos;
}
uint wt_node_leaf::select(uint symbol, uint pos, uint l, wt_coder * c) {
- assert(symbol==this->symbol);
- assert(pos<=count && pos>0);
+ if(symbol!=this->symbol) return (uint)-1;
+ if(pos==0 || pos>count) return (uint)-1;
return pos;
}
uint wt_node_leaf::access(uint pos) {
- assert(pos<count);
return symbol;
}
#include <alphabet_mapper.h>
+alphabet_mapper::alphabet_mapper() {
+ user_count=0;
+}
+
+void alphabet_mapper::use() {
+ user_count++;
+}
+
+void alphabet_mapper::unuse() {
+ user_count--;
+ if(user_count==0)
+ delete this;
+}
+
alphabet_mapper * alphabet_mapper::load(FILE *fp) {
uint rd;
if(fread(&rd,sizeof(uint),1,fp)!=1) return NULL;
fseek(fp,-1*sizeof(uint),SEEK_CUR);
switch(rd) {
case ALPHABET_MAPPER_NONE_HDR: return alphabet_mapper_none::load(fp);
+ case ALPHABET_MAPPER_CONT_HDR: return alphabet_mapper_cont::load(fp);
}
return NULL;
}
#include <iostream>
#define ALPHABET_MAPPER_NONE_HDR 2
+#define ALPHABET_MAPPER_CONT_HDR 3
using namespace std;
*/
class alphabet_mapper {
public:
+ alphabet_mapper();
virtual ~alphabet_mapper() {}
+ /** Maps the symbol */
virtual uint map(uint s)=0;
+ /** Unmaps the symbol */
virtual uint unmap(uint s)=0;
+ /** Returns the size of the mapper */
virtual uint size()=0;
+ /** Saves the mapper to a file */
virtual uint save(FILE *fp)=0;
+ /** Loads the mapper from a file */
static alphabet_mapper * load(FILE * fp);
+ virtual void use();
+ virtual void unuse();
+ protected:
+ uint user_count;
};
#include <alphabet_mapper_none.h>
+#include <alphabet_mapper_cont.h>
#endif /* _ALPHABET_MAPPER_H */
-
+/* alphabet_mapper_none.cpp
+ * Copyright (C) 2008, Francisco Claude, all rights reserved.
+ *
+ * alphabet_mapper definition
+ *
+ * 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 <alphabet_mapper_none.h>
alphabet_mapper_none::alphabet_mapper_none() { }
if(rd!=ALPHABET_MAPPER_NONE_HDR) return NULL;
return new alphabet_mapper_none();
}
-
CPP=g++
#CPPFLAGS=-g3 -Wall -I../includes/
-CPPFLAGS=-O9 -Wall -DNDEBUG -I../includes/
+CPPFLAGS=-O9 -w -DNDEBUG -I../includes/
+
+OBJECTS=make_bitmap.o static_bitsequence_tester.o static_sequence_tester.o static_sequence_wvtree_test.o static_sequence_gmr_test.o static_sequence_gmr_chunk_test.o static_sequence_wvtree_noptrs_test.o static_bitsequence_test.o text_to_int.o
+BIN=make_bitmap static_sequence_wvtree_test static_sequence_gmr_test static_sequence_gmr_chunk_test static_sequence_wvtree_noptrs_test static_bitsequence_test text_to_int
-OBJECTS=test_naive.o test_rrr02.o test_brw32.o make_bitmap.o test_wvtree01.o test_wvtree02.o
-BIN=test_naive test_rrr02 test_brw32 make_bitmap test_wvtree01 test_wvtree02
LIB=../lib/libcds.a
%.o: %.cpp
- $(CPP) $(CPPFLAGS) -c $< -o $@
+ @echo " [C++] Compiling $<"
+ @$(CPP) $(CPPFLAGS) -c $< -o $@
all: $(OBJECTS) $(BIN)
-test_naive:
- $(CPP) $(CPPFLAGS) -o test_naive test_naive.o $(LIB)
+static_bitsequence_test:
+ @echo " [C++] Building static_bitsequence_test"
+ @$(CPP) $(CPPFLAGS) -o static_bitsequence_test static_bitsequence_test.o static_bitsequence_tester.o $(LIB)
+
+make_bitmap:
+ @echo " [C++] Building make_bitmap"
+ @$(CPP) $(CPPFLAGS) -o make_bitmap make_bitmap.o $(LIB)
-test_rrr02:
- $(CPP) $(CPPFLAGS) -o test_rrr02 test_rrr02.o $(LIB)
+text_to_int:
+ @echo " [C++] Building text_to_int"
+ @$(CPP) $(CPPFLAGS) -o text_to_int text_to_int.o $(LIB)
-test_brw32:
- $(CPP) $(CPPFLAGS) -o test_brw32 test_brw32.o $(LIB)
+static_sequence_wvtree_test:
+ @echo " [C++] Building static_sequence_wvtree_test"
+ @$(CPP) $(CPPFLAGS) -o static_sequence_wvtree_test static_sequence_wvtree_test.o static_sequence_tester.o $(LIB)
-make_bitmap:
- $(CPP) $(CPPFLAGS) -o make_bitmap make_bitmap.o $(LIB)
+static_sequence_gmr_test:
+ @echo " [C++] Building static_sequence_gmr_test"
+ @$(CPP) $(CPPFLAGS) -o static_sequence_gmr_test static_sequence_gmr_test.o static_sequence_tester.o $(LIB)
-test_wvtree01:
- $(CPP) $(CPPFLAGS) -o test_wvtree01 test_wvtree01.o $(LIB)
+static_sequence_wvtree_noptrs_test:
+ @echo " [C++] Building static_sequence_wvtree_noptrs_test"
+ @$(CPP) $(CPPFLAGS) -o static_sequence_wvtree_noptrs_test static_sequence_wvtree_noptrs_test.o static_sequence_tester.o $(LIB)
-test_wvtree02:
- $(CPP) $(CPPFLAGS) -o test_wvtree02 test_wvtree02.o $(LIB)
+static_sequence_gmr_chunk_test:
+ @echo " [C++] Building static_sequence_gmr_chunk_test"
+ @$(CPP) $(CPPFLAGS) -o static_sequence_gmr_chunk_test static_sequence_gmr_chunk_test.o static_sequence_tester.o $(LIB)
clean:
- rm -f $(OBJECTS) $(BIN)
+ @echo " [CLN] Cleaning object files"
+ @rm -f $(OBJECTS) $(BIN)
+/* make_bitmap.cpp
+ * Copyright (C) 2008, Francisco Claude, all rights reserved.
+ *
+ * make_bitmap
+ *
+ * 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 <iostream>
#include <cstring>
unsigned char openTag[]="A", closeTag[]="/A", filename[]="testXML", text[]="Hello World";\r
treeNode x;\r
\r
- n = 49999;\r
+ n = 99999;\r
\r
X = new XMLTree();\r
\r