• 大小: 562KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-13
  • 语言: 其他
  • 标签: E2LSH  

资源简介

E2LSH的源代码,p稳定分布LSH 用于大规模的图片检索

资源截图

代码片段和文件信息

/*
 * Copyright (c) 2004-2005 Massachusetts Institute of Technology.
 * All Rights Reserved.
 *
 * MIT grants permission to use copy modify and distribute this software and
 * its documentation for NON-COMMERCIAL purposes and without fee provided that
 * this copyright notice appears in all copies.
 *
 * MIT provides this software “as is“ without representations or warranties of
 * any kind either expressed or implied including but not limited to the
 * implied warranties of merchantability fitness for a particular purpose and
 * noninfringement.  MIT shall not be liable for any damages arising from any
 * use of this software.
 *
 * Author: Alexandr Andoni (andoni@mit.edu) Piotr Indyk (indyk@mit.edu)
 */

#include “headers.h“


// Creates a new bucket with specified fields. The new bucket contains
// only a single entry -- bucketEntry. bucketEntry->nextEntry is
// expected to be NULL.
inline PGBucketT newGBucket(PUHashStructureT uhash Uns32T control1 /*PPointT point */ Int32T pointIndex PGBucketT nextGBucket){
  PGBucketT bucket;
  if (uhash != NULL && uhash->unusedPGBuckets != NULL){
    bucket = uhash->unusedPGBuckets;
    uhash->unusedPGBuckets = uhash->unusedPGBuckets->nextGBucketInChain;
  } else {
    FAILIF(NULL == (bucket = (PGBucketT)MALLOC(sizeof(GBucketT))));
    nAllocatedGBuckets++;
  }
  ASSERT(bucket != NULL);
  bucket->controlValue1 = control1;
  bucket->firstEntry.pointIndex = pointIndex;
  bucket->firstEntry.nextEntry = NULL;
  bucket->nextGBucketInChain = nextGBucket;

  nGBuckets++;
  return bucket;
}

// Adds the entry  to the bucket .
inline void addPointToGBucket(PUHashStructureT uhash PGBucketT bucket/* PPointT point*/  Int32T pointIndex){
  ASSERT(bucket != NULL);
  ASSERT(uhash != NULL);

  // create a new bucket entry for the point
  TIMEV_START(timeBucketCreation);
  PBucketEntryT bucketEntry;
  if (uhash->unusedPBucketEntrys != NULL){
    bucketEntry = uhash->unusedPBucketEntrys;
    uhash->unusedPBucketEntrys = uhash->unusedPBucketEntrys->nextEntry;
  }else{
    FAILIF(NULL == (bucketEntry = (PBucketEntryT)MALLOC(sizeof(BucketEntryT))));
    nAllocatedBEntries++;
  }
  ASSERT(bucketEntry != NULL);
  bucketEntry->pointIndex = pointIndex;
  TIMEV_END(timeBucketCreation);
  
  bucketEntry->nextEntry = bucket->firstEntry.nextEntry;
  bucket->firstEntry.nextEntry = bucketEntry;
}

// Creates a new UH structure (initializes the hash table and the hash
// functions used). If ==HT_PACKED or HT_HYBRID_CHAINS then
//  gives the sizes of all the static arrays that are
// used. Otherwise parameter  is not used.
PUHashStructureT newUHashStructure(IntT typeHT Int32T hashTableSize IntT bucketVectorLength BooleanT useExternalUHFs Uns32T *(&mainHashA) Uns32T *(&controlHash1) PUHashStructureT modelHT){
  PUHashStructureT uhash;
  FAILIF(NULL == (uhash = (PUHashStructureT)MALLOC(sizeof(UHashStructureT))));
  uhash->typeHT = typeHT;
  uhash->hashTableSize = hashTabl

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-09-13 09:31  E2LSH\
     文件        1698  2009-03-24 07:55  E2LSH\Makefile
     目录           0  2013-09-13 09:31  E2LSH\bin\
     文件         911  2009-03-24 07:55  E2LSH\bin\compile
     文件         420  2009-03-24 07:55  E2LSH\bin\exact
     文件        1070  2009-03-24 07:55  E2LSH\bin\lsh
     文件         991  2009-03-24 07:55  E2LSH\bin\lsh_computeParams
     文件         618  2009-03-24 07:55  E2LSH\bin\lsh_fromParams
     文件      228997  2009-03-24 07:55  E2LSH\manual.ps
     文件     7057000  2009-03-24 07:55  E2LSH\mnist1k.dts
     文件       63513  2009-03-24 07:55  E2LSH\mnist1k.q
     目录           0  2014-01-03 11:01  E2LSH\sources\
     文件        7245  2009-03-24 07:55  E2LSH\sources\BasicDefinitions.h
     文件        7211  2009-03-24 07:55  E2LSH\sources\BasicDefinitions.h.~1.8.~
     文件        7212  2009-03-24 07:55  E2LSH\sources\BasicDefinitions.h~
     文件       27332  2009-03-24 07:55  E2LSH\sources\BucketHashing.cpp
     文件        7441  2009-03-24 07:55  E2LSH\sources\BucketHashing.h
     文件        1851  2009-03-24 07:55  E2LSH\sources\Geometry.cpp
     文件        1562  2009-03-24 07:55  E2LSH\sources\Geometry.cpp.~1.3.~
     文件        1562  2009-03-24 07:55  E2LSH\sources\Geometry.cpp~
     文件        1376  2009-03-24 07:55  E2LSH\sources\Geometry.h
     文件        1156  2009-03-24 07:55  E2LSH\sources\Geometry.h.~1.2.~
     文件        1311  2009-03-24 07:55  E2LSH\sources\Geometry.h~
     文件         770  2009-03-24 07:55  E2LSH\sources\GlobalVars.cpp
     文件        2332  2009-03-24 07:55  E2LSH\sources\GlobalVars.h
     文件       13224  2009-03-24 07:55  E2LSH\sources\LSHMain.cpp
     文件       13219  2009-03-24 07:55  E2LSH\sources\LSHMain.cpp.~1.17.~
     文件       13219  2009-03-24 07:55  E2LSH\sources\LSHMain.cpp~
     文件       29672  2009-03-24 07:55  E2LSH\sources\LocalitySensitiveHashing.cpp
     文件       29670  2009-03-24 07:55  E2LSH\sources\LocalitySensitiveHashing.cpp.~1.7.~
     文件       29670  2009-03-24 07:55  E2LSH\sources\LocalitySensitiveHashing.cpp~
............此处省略23个文件信息

评论

共有 条评论

相关资源