2021-03-11

NHood结构体里的init函数

void init() {

            //allocate space for hnn_high . hnn0 

            size_t max_high = max((int)FastHnsw::maxM_,(int)FastHnsw::ef_construction_);

            size_t max_0 = max((int)maxM0_,(int)ef_construction_);

            hnn_high.reserve(max_high);

            hnn0.reserve(max_0);

            printf("init success\n");

        }


/home/ug2021/hnswlib-master-fasthnsw/hnswlib/FastHnsw.h:107:12: error: invalid use of non-static data member ‘hnswlib::FastHnsw<float>::maxM_’

    size_t maxM_;          //the max connection for every node in other layer

            ^

/home/ug2021/hnswlib-master-fasthnsw/hnswlib/FastHnsw.h:222:87: error: from this location

            size_t max_high = max((int)FastHnsw::maxM_,(int)FastHnsw::ef_construction_);

max函数里的四个参数全部报错


加了类名冒号也依然不行,强制类型转换也不行



问题二:分配空间问题

不进入for循环 好奇怪


问题三:主要关注指针和数据对应的问题

实现函数getdataByID()

参照原算法来写。需要首先了解fstdistfunc等的运行原理。原算法中的getdatabyInternalId是不是也是值得到一个指针,无法直接输出内容,需要copydata_size_的char,才能用

SIMD指令集

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容