Remove broken c++ examples for now
Change-Id: Ia564ca5c3b45aa0179eda4015a6dad8ca5dfe508
diff --git a/examples/dumppmicubed.cc b/examples/dumppmicubed.cc
deleted file mode 100644
index 8c3bf56..0000000
--- a/examples/dumppmicubed.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <typeinfo>
-#include <assert.h>
-#include <memory>
-#include <iostream>
-#include <stdint.h>
-#include "../src/collocatordb.h"
-#include <thread>
-#include <chrono>
-#include <sstream> // for ostringstream
-#include <fstream>
-
-using namespace rocksdb;
-
-
-int main(int argc, char** argv) {
- const int START=1;
- const int STOP=300000;
- uint32_t *array;
- int done = 0;
-
- array = (uint32_t *)malloc(STOP * 20 * sizeof(uint32_t));
- memset(array, 0, STOP * 20 * sizeof(uint32_t));
- FILE* pFile;
- CollocatorDB cdb = CollocatorDB(argv[1], true);
- std::cerr << "Database " << argv[1] << " opened\n";
- #pragma omp parallel for schedule(dynamic, 1)
- for(uint32_t i=START; i< STOP; i++) {
- std::vector<rocksdb::Collocator> cs = cdb.get_collocators(i, STOP);
- int j=0;
- for (rocksdb::Collocator c : cs) {
- if(c.w2 != i) {
- array[i*20+j] = (uint32_t) c.w2;
- if(++j >=20)
- break;
- }
- }
- if(done++ % 100 == 0) {
- std::cerr <<"\r\033[2K"<<std::flush;
- std::cerr << "done: " << done * 100.0 / (STOP-START) << "%" << " (todo: " << STOP-START-done << ")" << std::flush;
- }
- }
- pFile = fopen("file.binary", "wb");
- fwrite(array, sizeof(uint32_t), STOP*20, pFile);
- fclose(pFile);
- std::cout << std::flush;
-}
diff --git a/examples/testcdb.cc b/examples/testcdb.cc
deleted file mode 100644
index 64e9304..0000000
--- a/examples/testcdb.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-#include <typeinfo>
-#include <assert.h>
-#include <memory>
-#include <iostream>
-#include <stdint.h>
-#include "../src/collocatordb.h"
-using namespace rocksdb;
-
-void dumpDb(Collocators& counters) {
- auto it = std::unique_ptr<CollocatorIterator>(counters.SeekIterator(1000,0,0));
- for (; it->isValid(); it->Next()) {
- uint64_t value = it->intValue();
- uint64_t key = it->intKey();
- std::cout << "w1:" << W1(key) << ", w2:" << W2(key) << ", dist:" << (int32_t) DIST(key) << " - count:" << value << std::endl;
- }
- std::cout << "ready dumping\n";
- }
-
- void testCollocators(Collocators& counters) {
- counters.inc(100,200,5);
- counters.inc(1000,2000,-5);
- counters.inc(1000,2000,5);
- counters.inc(1000,2500,-3);
- counters.inc(1000,2500,4);
- counters.inc(1000,2900,3);
-
- counters.inc(1001,2900,3);
-
- for(int i=0; i<10000; i++)
- counters.inc(rand()%1010,rand()%1010,rand()%10-5);
-
- // dumpDb(db);
-
- counters.inc(100,200,5);
- counters.inc(1000,2000,5);
- counters.inc(1000,2500,4);
- counters.inc(1000,2900,3);
-
- counters.inc(1001,2900,3);
-
- dumpDb(counters);
- std::cout << "ready testing\n";
- }
-
-
-int main() {
- Collocators counters = "/tmp/cdb";
- std::cout << "testing now\n";
- testCollocators(counters);
- std::cout << "ready running\n";
- return 0;
-}