int main() { testCompactHuffmanPar(); return 0; #if 0 ::libmaus::wavelet::ImpHuffmanWaveletTree::unique_ptr_type IMP(new ::libmaus::wavelet::ImpHuffmanWaveletTree(std::cin)); ::libmaus::autoarray::AutoArray<uint32_t>::unique_ptr_type Z(new ::libmaus::autoarray::AutoArray<uint32_t>(64)); ::libmaus::lf::LFZeroImp L(IMP,Z,0); #endif #if 0 LFZeroTemplate ( wt_ptr_type & rW, z_array_ptr_type & rZ, uint64_t const rp0rank ) #endif // testImpExternalWaveletGenerator(); testHuffmanWavelet(); testHuffmanWaveletSer(); #if 0 srand(time(0)); uint64_t const b = 5; ::libmaus::util::TempFileNameGenerator tmpgen(std::string("tmp"),3); ::libmaus::wavelet::ExternalWaveletGenerator ex(b,tmpgen); std::vector < uint64_t > V; for ( uint64_t i = 0; i < 381842; ++i ) { uint64_t const v = rand() % (1ull<<b); // uint64_t const v = i % (1ull<<b); ex.putSymbol(v); V.push_back(v); } std::string const outfilename = "ex"; uint64_t const n = ex.createFinalStream(outfilename); ::std::ifstream istr(outfilename.c_str(), std::ios::binary); ::libmaus::wavelet::WaveletTree < ::libmaus::rank::ERank222B, uint64_t > WT(istr); std::cerr << "Checking..."; for ( uint64_t i = 0; i < n; ++i ) assert ( WT[i] == V[i] ); std::cerr << "done." << std::endl; if ( n < 256 ) { for ( uint64_t i = 0; i < n; ++i ) std::cerr << WT[i] << ";"; std::cerr << std::endl; } #endif }
#define ABX(x) ((6 << 16) | x) #define ABY(x) ((7 << 16) | x) #define IND(x) ((8 << 16) | x) #define INX(x) ((9 << 16) | x) #define INY(x) ((10 << 16) | x) #define IMP(x) ((11 << 16) | x) typedef struct { char *name; int type; /* 1 for read, 2 for write, 3 for r then write. */ int32 modes[10]; } OPS; #define NUMOPS 56 static OPS optable[NUMOPS] = { { "BRK", 0, { IMP(0x00), -1 } }, { "RTI", 0, { IMP(0x40), -1 } }, { "RTS", 0, { IMP(0x60), -1 } }, { "PHA", 2, { IMP(0x48), -1 } }, { "PHP", 2, { IMP(0x08), -1 } }, { "PLA", 1, { IMP(0x68), -1 } }, { "PLP", 1, { IMP(0x28), -1 } }, { "JMP", 0, { ABS(0x4C), IND(0x6C), -1 } }, { "JSR", 0, { ABS(0x20), -1 } }, { "TAX", 0, { IMP(0xAA), -1 } }, { "TXA", 0, { IMP(0x8A), -1 } }, { "TAY", 0, { IMP(0xA8), -1 } }, { "TYA", 0, { IMP(0x98), -1 } }, { "TSX", 0, { IMP(0xBA), -1 } }, { "TXS", 0, { IMP(0x9A), -1 } }, { "DEX", 0, { IMP(0xCA), -1 } },