diff options
author | Geir Storli <geirstorli@yahoo.no> | 2017-06-07 10:24:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-07 10:24:28 +0200 |
commit | 0a218d6229e1deaf3bc14ffb8de0296414431b8f (patch) | |
tree | bb690e1e71fe4a4438edef4368c09d6a393b1a68 /searchlib | |
parent | b9587814e8b69d7f14acd46a0f072836043108b5 (diff) | |
parent | 36680597d67c82716a172350a266501d2f6191c1 (diff) |
Merge pull request #2621 from yahoo/toregge/remove-expgolomb-app
Toregge/remove expgolomb app
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | searchlib/src/apps/expgolomb/.gitignore | 3 | ||||
-rw-r--r-- | searchlib/src/apps/expgolomb/CMakeLists.txt | 9 | ||||
-rw-r--r-- | searchlib/src/apps/expgolomb/expgolomb.cpp | 168 | ||||
-rw-r--r-- | searchlib/src/apps/uniform/.gitignore | 2 | ||||
-rw-r--r-- | searchlib/src/apps/uniform/CMakeLists.txt | 2 |
6 files changed, 1 insertions, 184 deletions
diff --git a/searchlib/CMakeLists.txt b/searchlib/CMakeLists.txt index c15ed681d8f..ec912bf90ab 100644 --- a/searchlib/CMakeLists.txt +++ b/searchlib/CMakeLists.txt @@ -58,7 +58,6 @@ vespa_define_module( APPS src/apps/docstore - src/apps/expgolomb src/apps/fileheaderinspect src/apps/loadattribute src/apps/tests diff --git a/searchlib/src/apps/expgolomb/.gitignore b/searchlib/src/apps/expgolomb/.gitignore deleted file mode 100644 index 0886ab154a2..00000000000 --- a/searchlib/src/apps/expgolomb/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.depend -Makefile -expgolomb diff --git a/searchlib/src/apps/expgolomb/CMakeLists.txt b/searchlib/src/apps/expgolomb/CMakeLists.txt deleted file mode 100644 index 230718907dd..00000000000 --- a/searchlib/src/apps/expgolomb/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(searchlib_expgolomb_app - SOURCES - expgolomb.cpp - OUTPUT_NAME expgolomb - INSTALL bin - DEPENDS - searchlib -) diff --git a/searchlib/src/apps/expgolomb/expgolomb.cpp b/searchlib/src/apps/expgolomb/expgolomb.cpp deleted file mode 100644 index 81aa566305c..00000000000 --- a/searchlib/src/apps/expgolomb/expgolomb.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <vespa/fastos/app.h> -#include <vespa/searchlib/bitcompression/compression.h> -#include <vector> - -class ExpGolombApp : public FastOS_Application -{ - void usage(); - int testExpGolomb64(int kValue); - int testExpGolomb64le(int kValue); - int Main() override; -}; - - - -void -ExpGolombApp::usage() -{ - printf("Usage: expgolomb testeg64 <kValue>]\n"); - fflush(stdout); -} - - -int -ExpGolombApp::testExpGolomb64(int kValue) -{ - std::vector<uint64_t> myrand; - for (int i = 0; i < 10000; ++i) { - uint64_t rval = rand(); - rval <<= 30; - rval |= rand(); - myrand.push_back(rval); - } - for (int i = 0; i < 10000; ++i) { - uint64_t rval = rand(); - rval <<= 30; - rval |= rand(); - uint32_t bits = (rand() & 63); - rval &= ((UINT64_C(1) << bits) - 1); - myrand.push_back(rval); - } - typedef search::bitcompression::EncodeContext64BE EC; - - EC e; - search::ComprFileWriteContext wc(e); - wc.allocComprBuf(32768, 32768); - e.setupWrite(wc); - - int rsize = myrand.size(); - for (int i = 0; i < rsize; ++i) { - e.encodeExpGolomb(myrand[i], kValue); - if (e._valI >= e._valE) - wc.writeComprBuffer(false); - } - e.flush(); - - UC64_DECODECONTEXT(o); - unsigned int length; - uint64_t val64; - UC64BE_SETUPBITS_NS(o, static_cast<const uint64_t *>(wc._comprBuf), 0, EC); - - bool failure = false; - for (int i = 0; i < rsize; ++i) { - UC64BE_DECODEEXPGOLOMB(oVal, oCompr, oPreRead, oCacheInt, - kValue, EC); - if (val64 != myrand[i]) { - printf("FAILURE: TestExpGolomb64, val64=%" - PRIu64 ", myrand[%d]=%" PRIu64 "\n", - val64, i, myrand[i]); - failure = true; - } - } - if (!failure) - printf("SUCCESS: TestExpGolomb64\n"); - return failure ? 1 : 0; -} - -int -ExpGolombApp::testExpGolomb64le(int kValue) -{ - std::vector<uint64_t> myrand; - for (int i = 0; i < 10000; ++i) { - uint64_t rval = rand(); - rval <<= 30; - rval |= rand(); - myrand.push_back(rval); - } - for (int i = 0; i < 10000; ++i) { - uint64_t rval = rand(); - rval <<= 30; - rval |= rand(); - uint32_t bits = (rand() & 63); - rval &= ((UINT64_C(1) << bits) - 1); - myrand.push_back(rval); - } - typedef search::bitcompression::EncodeContext64LE EC; - - EC e; - search::ComprFileWriteContext wc(e); - wc.allocComprBuf(32768, 32768); - e.setupWrite(wc); - - int rsize = myrand.size(); - for (int i = 0; i < rsize; ++i) { - e.encodeExpGolomb(myrand[i], kValue); - if (e._valI >= e._valE) - wc.writeComprBuffer(false); - } - e.flush(); - - UC64_DECODECONTEXT(o); - unsigned int length; - uint64_t val64; - UC64LE_SETUPBITS_NS(o, static_cast<const uint64_t *>(wc._comprBuf), 0, EC); - - bool failure = false; - for (int i = 0; i < rsize; ++i) { - UC64LE_DECODEEXPGOLOMB(oVal, oCompr, oPreRead, oCacheInt, - kValue, EC); - if (val64 != myrand[i]) { - printf("FAILURE: TestExpGolomb64le, val64=%" - PRIu64 ", myrand[%d]=%" PRIu64 "\n", - val64, i, myrand[i]); - failure = true; - } - } - if (!failure) - printf("SUCCESS: TestExpGolomb64le\n"); - return failure ? 1 : 0; -} - - -int -ExpGolombApp::Main() -{ - printf("Hello world\n"); - if (_argc >= 2) { - if (strcmp(_argv[1], "testeg64") == 0) { - if (_argc < 3) { - fprintf(stderr, "Too few arguments\n"); - usage(); - return 1; - } - return testExpGolomb64(atoi(_argv[2])); - } else if (strcmp(_argv[1], "testeg64le") == 0) { - if (_argc < 3) { - fprintf(stderr, "Too few arguments\n"); - usage(); - return 1; - } - return testExpGolomb64le(atoi(_argv[2])); - } else { - fprintf(stderr, "Wrong arguments\n"); - usage(); - return 1; - } - } else { - fprintf(stderr, "Too few arguments\n"); - usage(); - return 1; - } - return 0; -} - -FASTOS_MAIN(ExpGolombApp); - - diff --git a/searchlib/src/apps/uniform/.gitignore b/searchlib/src/apps/uniform/.gitignore index ff18dbaa7fd..d1fbbf62d24 100644 --- a/searchlib/src/apps/uniform/.gitignore +++ b/searchlib/src/apps/uniform/.gitignore @@ -1,3 +1,3 @@ .depend Makefile -uniform +searchlib_uniform_app diff --git a/searchlib/src/apps/uniform/CMakeLists.txt b/searchlib/src/apps/uniform/CMakeLists.txt index 9f9c2139f42..7b835a64e8c 100644 --- a/searchlib/src/apps/uniform/CMakeLists.txt +++ b/searchlib/src/apps/uniform/CMakeLists.txt @@ -2,8 +2,6 @@ vespa_add_executable(searchlib_uniform_app SOURCES uniform.cpp - OUTPUT_NAME uniform - INSTALL bin DEPENDS searchlib ) |