forked from whenever5225/GraphANNS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathT-siftsmall.cpp
37 lines (29 loc) · 1.09 KB
/
T-siftsmall.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/***************************
@Author: Chunel
@Contact: [email protected]
@File: T-siftsmall.cpp
@Time: 2022/4/30 17:24
@Desc:
***************************/
#include "src/graph_anns.h"
using namespace CGraph;
int main() {
GPipelinePtr pipeline = GPipelineFactory::create();
GElementPtr a, b, c, d, e, f = nullptr;
// build
CStatus status = pipeline->registerGElement<ConfigAlgNPGNode>(&a, {}, "config_npg");
status += pipeline->registerGElement<ConfigModelNode>(&b, {a}, "config_model");
status += pipeline->registerGElement<C1InitializationNNDescent>(&c, {b}, "c1_nssg");
status += pipeline->registerGElement<C2CandidateNSSGV1>(&d, {c}, "c2_nssg");
status += pipeline->registerGElement<C3NeighborNSGV1>(&e, {d}, "c3_nsg");
status += pipeline->registerGElement<SaveIndexNode>(&f, {e}, "save_index");
a->setLevel(-1);
b->setLevel(-2);
status += pipeline->process();
if (!status.isOK()) {
CGRAPH_ECHO("process graph error, error info is [%s]", status.getInfo().c_str());
return 0;
}
GPipelineFactory::remove(pipeline);
return 0;
}