Esempio n. 1
0
			ImpHuffmanWaveletTree(stream_type & in)
			:
				// number of symbols
				n(::libmaus2::util::NumberSerialisation::deserialiseNumber(in)),
				// root of huffman tree
				sroot ( ::libmaus2::huffman::HuffmanTreeNode::deserialize(in) ),
				// number of contexts = number of bit vectors
				dicts( ::libmaus2::util::NumberSerialisation::deserialiseNumber(in) ),
				// root of dictionary tree
				root(0),
				//
				enctable(sroot.get()),
				//
				maxdepth(0)
			{
				// std::cerr << "** n=" << n << std::endl;
			
				for ( uint64_t i = 0; i < dicts.size(); ++i )
				{
					rank_ptr_type tdictsi(new rank_type(in));
					dicts [ i ] = UNIQUE_PTR_MOVE(tdictsi);
					dicts [ i ] -> checkSanity();
				}
					
				nodepos = ::libmaus2::util::NumberSerialisation::deserialiseNumberVector<uint64_t>(in);
				::libmaus2::util::NumberSerialisation::deserialiseNumber(in); // index position
				
				init();
			}
Esempio n. 2
0
			ImpHuffmanWaveletTree(stream_type & in, uint64_t & s)
			:
				// number of symbols
				n(::libmaus2::util::NumberSerialisation::deserialiseNumber(in)),
				// root of huffman tree
				sroot ( ::libmaus2::huffman::HuffmanTreeNode::deserialize(in,s) ),
				// number of contexts = number of bit vectors
				dicts( ::libmaus2::util::NumberSerialisation::deserialiseNumber(in) ),
				// root of dictionary tree
				root(0),
				//
				enctable(sroot.get()),
				//
				maxdepth(0)
			{
				s += 2*sizeof(uint64_t);
			
				for ( uint64_t i = 0; i < dicts.size(); ++i )
				{
					rank_ptr_type tdictsi(new rank_type(in,s));
					dicts [ i ] = UNIQUE_PTR_MOVE(tdictsi);
				}
					
				nodepos = ::libmaus2::util::NumberSerialisation::deserialiseNumberVector<uint64_t>(in);
				::libmaus2::util::NumberSerialisation::deserialiseNumber(in); // index position
				
				s += (1+nodepos.size()+1)*sizeof(uint64_t);
				
				init();
			}
			ImpCompactHuffmanWaveletTreeTemplate(stream_type & in)
			:
				// number of symbols
				n(::libmaus2::util::NumberSerialisation::deserialiseNumber(in)),
				// huffman tree
				H(new libmaus2::huffman::HuffmanTree(in)),
				E(new libmaus2::huffman::HuffmanTree::EncodeTable(*H)),
				// number of contexts = number of bit vectors
				dicts( ::libmaus2::util::NumberSerialisation::deserialiseNumber(in) ),
				//
				maxdepth(0)
			{
				// std::cerr << "** n=" << n << std::endl;

				for ( uint64_t i = 0; i < dicts.size(); ++i )
				{
					rank_ptr_type tdictsi(new rank_type(in));
					dicts [ i ] = UNIQUE_PTR_MOVE(tdictsi);
					// dicts [ i ] -> checkSanity();
				}

				nodepos = ::libmaus2::util::NumberSerialisation::deserialiseNumberVector<uint64_t>(in);
				::libmaus2::util::NumberSerialisation::deserialiseNumber(in); // index position

				init();
			}