diff --git a/similarity_search/src/space/space_bit_hamming.cc b/similarity_search/src/space/space_bit_hamming.cc deleted file mode 100644 index 72c2d18..0000000 --- a/similarity_search/src/space/space_bit_hamming.cc +++ /dev/null @@ -1,44 +0,0 @@ -///** -// * Non-metric Space Library -// * -// * Main developers: Bilegsaikhan Naidan, Leonid Boytsov, Yury Malkov, Ben Frederickson, David Novak -// * -// * For the complete list of contributors and further details see: -// * https://github.com/searchivarius/NonMetricSpaceLib -// * -// * Copyright (c) 2013-2018 -// * -// * This code is released under the -// * Apache License Version 2.0 http://www.apache.org/licenses/. -// * -// */ -//#include -//#include -//#include -//#include -//#include -// -//#include "space/space_bit_hamming.h" -//#include "permutation_utils.h" -//#include "logging.h" -//#include "distcomp.h" -//#include "read_data.h" -//#include "experimentconf.h" -// -//namespace similarity { -// -//using namespace std; -// -//template -//dist_t SpaceBitHamming::HiddenDistance(const Object* obj1, const Object* obj2) const { -// CHECK(obj1->datalength() > 0); -// CHECK(obj1->datalength() == obj2->datalength()); -// const dist_uint_t* x = reinterpret_cast(obj1->data()); -// const dist_uint_t* y = reinterpret_cast(obj2->data()); -// const size_t length = obj1->datalength() / sizeof(dist_uint_t) -// - 1; // the last integer is an original number of elements -// -// return BitHamming(x, y, length); -//} -// -//} diff --git a/similarity_search/src/space/space_bit_jaccard.cc b/similarity_search/src/space/space_bit_jaccard.cc deleted file mode 100644 index aa0ecad..0000000 --- a/similarity_search/src/space/space_bit_jaccard.cc +++ /dev/null @@ -1,44 +0,0 @@ -///** -// * Non-metric Space Library -// * -// * Main developers: Bilegsaikhan Naidan, Leonid Boytsov, Yury Malkov, Ben Frederickson, David Novak -// * -// * For the complete list of contributors and further details see: -// * https://github.com/searchivarius/NonMetricSpaceLib -// * -// * Copyright (c) 2013-2018 -// * -// * This code is released under the -// * Apache License Version 2.0 http://www.apache.org/licenses/. -// * -// */ -//#include -//#include -//#include -//#include -//#include -// -//#include "space/space_bit_jaccard.h" -//#include "permutation_utils.h" -//#include "logging.h" -//#include "distcomp.h" -//#include "read_data.h" -//#include "experimentconf.h" -// -////namespace similarity { -//// -//////using namespace std; -//// -//////template -//////dist_t SpaceBitJaccard::HiddenDistance(const Object* obj1, const Object* obj2) const { -////// CHECK(obj1->datalength() > 0); -////// CHECK(obj1->datalength() == obj2->datalength()); -////// const dist_uint_t* x = reinterpret_cast(obj1->data()); -////// const dist_uint_t* y = reinterpret_cast(obj2->data()); -////// const size_t length = obj1->datalength() / sizeof(dist_uint_t) -////// - 1; // the last integer is an original number of elements -////// -////// return BitJaccard(x, y, length); -//////} -//// -////} diff --git a/similarity_search/src/space/space_bit_vector.cc b/similarity_search/src/space/space_bit_vector.cc deleted file mode 100644 index 043319d..0000000 --- a/similarity_search/src/space/space_bit_vector.cc +++ /dev/null @@ -1,195 +0,0 @@ -///** -// * Non-metric Space Library -// * -// * Main developers: Bilegsaikhan Naidan, Leonid Boytsov, Yury Malkov, Ben Frederickson, David Novak -// * -// * For the complete list of contributors and further details see: -// * https://github.com/searchivarius/NonMetricSpaceLib -// * -// * Copyright (c) 2013-2018 -// * -// * This code is released under the -// * Apache License Version 2.0 http://www.apache.org/licenses/. -// * -// */ -//#include -//#include -//#include -//#include -//#include -// -//#include "space/space_bit_vector.h" -//#include "permutation_utils.h" -//#include "logging.h" -//#include "distcomp.h" -//#include "read_data.h" -//#include "experimentconf.h" -// -//namespace similarity { -// -//using namespace std; -// -////template -////dist_t SpaceBitVector::HiddenDistance(const Object* obj1, const Object* obj2) const { -//// CHECK(obj1->datalength() > 0); -//// CHECK(obj1->datalength() == obj2->datalength()); -//// const dist_uint_t* x = reinterpret_cast(obj1->data()); -//// const dist_uint_t* y = reinterpret_cast(obj2->data()); -//// const size_t length = obj1->datalength() / sizeof(dist_uint_t) -//// - 1; // the last integer is an original number of elements -//// -//// return BitVector(x, y, length); -////} -// -////template -////void SpaceBitVector::ReadBitMaskVect(std::string line, LabelType& label, std::vector& binVect) const -////{ -//// binVect.clear(); -//// -//// label = Object::extractLabel(line); -//// -//// std::stringstream str(line); -//// -//// str.exceptions(std::ios::badbit); -//// -//// -//// ReplaceSomePunct(line); -//// -//// vector v; -//// -////#if 0 -//// try { -//// unsigned val; -//// -//// while (str >> val) { -//// if (val != 0 && val != 1) { -//// throw runtime_error("Only zeros and ones are allowed"); -//// } -//// v.push_back(val); -//// } -//// } catch (const std::exception &e) { -//// LOG(LIB_ERROR) << "Exception: " << e.what(); -//// PREPARE_RUNTIME_ERR(err) << "Failed to parse the line: '" << line << "'"; -//// LOG(LIB_ERROR) << err.stream().str(); -//// THROW_RUNTIME_ERR(err); -//// } -////#else -//// if (!ReadVecDataEfficiently(line, v)) { -//// PREPARE_RUNTIME_ERR(err) << "Failed to parse the line: '" << line << "'"; -//// LOG(LIB_ERROR) << err.stream().str(); -//// THROW_RUNTIME_ERR(err); -//// } -//// for (auto val : v) { -//// if (val != 0 && val != 1) { -//// PREPARE_RUNTIME_ERR(err) << "Only zeros and ones are allowed, offending line: '" << line << "'"; -//// LOG(LIB_ERROR) << err.stream().str(); -//// THROW_RUNTIME_ERR(err); -//// } -//// } -////#endif -//// Binarize(v, 1, binVect); // Create the binary vector -//// binVect.push_back(v.size()); // Put the number of elements in the end -////} -// -////template -////Object* SpaceBitVector::CreateObjFromBitMaskVect(IdType id, LabelType label, const std::vector& bitMaskVect) const { -//// return new Object(id, label, bitMaskVect.size() * sizeof(dist_uint_t), &bitMaskVect[0]); -////}; -// -///** Standard functions to read/write/create objects */ -// -////template -////unique_ptr SpaceBitVector::OpenReadFileHeader(const string& inpFileName) const { -//// return unique_ptr(new DataFileInputStateVec(inpFileName)); -////} -// -////template -////unique_ptr SpaceBitVector::OpenWriteFileHeader(const ObjectVector& dataset, -//// const string& outFileName) const { -//// return unique_ptr(new DataFileOutputState(outFileName)); -////} -// -////template -////unique_ptr -////SpaceBitVector::CreateObjFromStr(IdType id, LabelType label, const string& s, -//// DataFileInputState* pInpStateBase) const { -//// DataFileInputStateVec* pInpState = NULL; -//// if (pInpStateBase != NULL) { -//// pInpState = dynamic_cast(pInpStateBase); -//// if (NULL == pInpState) { -//// PREPARE_RUNTIME_ERR(err) << "Bug: unexpected pointer type"; -//// THROW_RUNTIME_ERR(err); -//// } -//// } -//// vector vec; -//// ReadBitMaskVect(s, label, vec); -//// if (pInpState != NULL) { -//// size_t elemQty = vec[vec.size() - 1]; -//// if (pInpState->dim_ == 0) pInpState->dim_ = elemQty; -//// else if (elemQty != pInpState->dim_) { -//// PREPARE_RUNTIME_ERR(err) << "The # of bit-vector elements (" << elemQty << ")" << -//// " doesn't match the # of elements in previous lines. (" << pInpState->dim_ << " )"; -//// THROW_RUNTIME_ERR(err); -//// } -//// } -//// return unique_ptr(CreateObjFromVectInternal(id, label, vec)); -////} -// -////template -////Object* SpaceBitVector::CreateObjFromVectInternal(IdType id, LabelType label, const std::vector& InpVect) const { -//// return new Object(id, label, InpVect.size() * sizeof(dist_uint_t), &InpVect[0]); -////}; -// -////template -////bool SpaceBitVector::ApproxEqual(const Object& obj1, const Object& obj2) const { -//// const dist_uint_t* p1 = reinterpret_cast(obj1.data()); -//// const dist_uint_t* p2 = reinterpret_cast(obj2.data()); -//// const size_t len1 = obj1.datalength() / sizeof(dist_uint_t) -//// - 1; // the last integer is an original number of elements -//// const size_t len2 = obj2.datalength() / sizeof(dist_uint_t) -//// - 1; // the last integer is an original number of elements -//// if (len1 != len2) { -//// PREPARE_RUNTIME_ERR(err) << "Bug: comparing vectors of different lengths: " << len1 << " and " << len2; -//// THROW_RUNTIME_ERR(err); -//// } -//// for (size_t i = 0; i < len1; ++i) { -//// dist_uint_t v1 = ((p1[i/32] >> (i & 31)) & 1); -//// dist_uint_t v2 = ((p2[i/32] >> (i & 31)) & 1); -//// if (v1 != v2) return false; -//// } -//// -//// return true; -////} -// -// -////template -////string SpaceBitVector::CreateStrFromObj(const Object* pObj, const string& externId /* ignored */) const { -//// stringstream out; -//// const dist_uint_t* p = reinterpret_cast(pObj->data()); -//// const size_t length = pObj->datalength() / sizeof(dist_uint_t) -//// - 1; // the last integer is an original number of elements -//// const size_t elemQty = p[length]; // last elem -//// -//// for (size_t i = 0; i < elemQty; ++i) { -//// if (i) out << " "; -//// out << ((p[i/32] >> (i & 31)) & 1); -//// } -//// -//// return out.str(); -////} -// -////template -////bool SpaceBitVector::ReadNextObjStr(DataFileInputState &inpStateBase, string& strObj, LabelType& label, string& externId) const { -//// externId.clear(); -//// DataFileInputStateOneFile* pInpState = dynamic_cast(&inpStateBase); -//// CHECK_MSG(pInpState != NULL, "Bug: unexpected pointer type"); -//// if (!pInpState->inp_file_) return false; -//// if (!getline(pInpState->inp_file_, strObj)) return false; -//// pInpState->line_num_++; -//// return true; -////} -// -// -///** End of standard functions to read/write/create objects */ -// -//} // namespace similarity