-
Notifications
You must be signed in to change notification settings - Fork 0
/
gofaiss.go
2884 lines (2606 loc) · 121 KB
/
gofaiss.go
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// WARNING: This file has automatically been generated on Mon, 10 Jan 2022 11:46:52 CST.
// Code generated by https://git.io/c-for-go. DO NOT EDIT.
package gofaiss
/*
#cgo pkg-config: faiss
#include "faiss.h"
#include <stdlib.h>
#include "cgo_helpers.h"
*/
import "C"
import (
"runtime"
"unsafe"
)
// ParameterRangeName function as declared in c_api/AutoTune_c.h:24
func ParameterRangeName(Arg0 *FaissParameterRange) string {
cArg0, cArg0AllocMap := (*C.FaissParameterRange)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_ParameterRange_name(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := packPCharString(__ret)
return __v
}
// ParameterRangeValues function as declared in c_api/AutoTune_c.h:28
func ParameterRangeValues(Arg0 *FaissParameterRange, Arg1 **float64, Arg2 *uint) {
cArg0, cArg0AllocMap := (*C.FaissParameterRange)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (**C.double)(unsafe.Pointer(Arg1)), cgoAllocsUnknown
cArg2, cArg2AllocMap := (*C.size_t)(unsafe.Pointer(Arg2)), cgoAllocsUnknown
C.faiss_ParameterRange_values(cArg0, cArg1, cArg2)
runtime.KeepAlive(cArg2AllocMap)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
}
// ParameterSpaceFree function as declared in c_api/AutoTune_c.h:34
func ParameterSpaceFree(Obj *FaissParameterSpace) {
cObj, cObjAllocMap := (*C.FaissParameterSpace)(unsafe.Pointer(Obj)), cgoAllocsUnknown
C.faiss_ParameterSpace_free(cObj)
runtime.KeepAlive(cObjAllocMap)
}
// ParameterSpaceNew function as declared in c_api/AutoTune_c.h:37
func ParameterSpaceNew(Space **FaissParameterSpace) int32 {
cSpace, cSpaceAllocMap := (**C.FaissParameterSpace)(unsafe.Pointer(Space)), cgoAllocsUnknown
__ret := C.faiss_ParameterSpace_new(cSpace)
runtime.KeepAlive(cSpaceAllocMap)
__v := (int32)(__ret)
return __v
}
// ParameterSpaceNCombinations function as declared in c_api/AutoTune_c.h:40
func ParameterSpaceNCombinations(Arg0 *FaissParameterSpace) uint {
cArg0, cArg0AllocMap := (*C.FaissParameterSpace)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_ParameterSpace_n_combinations(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (uint)(__ret)
return __v
}
// ParameterSpaceCombinationName function as declared in c_api/AutoTune_c.h:45
func ParameterSpaceCombinationName(Arg0 *FaissParameterSpace, Arg1 uint, Arg2 *byte, Arg3 uint) int32 {
cArg0, cArg0AllocMap := (*C.FaissParameterSpace)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (C.size_t)(Arg1), cgoAllocsUnknown
cArg2, cArg2AllocMap := (*C.char)(unsafe.Pointer(Arg2)), cgoAllocsUnknown
cArg3, cArg3AllocMap := (C.size_t)(Arg3), cgoAllocsUnknown
__ret := C.faiss_ParameterSpace_combination_name(cArg0, cArg1, cArg2, cArg3)
runtime.KeepAlive(cArg3AllocMap)
runtime.KeepAlive(cArg2AllocMap)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ParameterSpaceSetIndexParameters function as declared in c_api/AutoTune_c.h:52
func ParameterSpaceSetIndexParameters(Arg0 *FaissParameterSpace, Arg1 *FaissIndex, Arg2 string) int32 {
cArg0, cArg0AllocMap := (*C.FaissParameterSpace)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg1)), cgoAllocsUnknown
Arg2 = safeString(Arg2)
cArg2, cArg2AllocMap := unpackPCharString(Arg2)
__ret := C.faiss_ParameterSpace_set_index_parameters(cArg0, cArg1, cArg2)
runtime.KeepAlive(Arg2)
runtime.KeepAlive(cArg2AllocMap)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ParameterSpaceSetIndexParametersCno function as declared in c_api/AutoTune_c.h:58
func ParameterSpaceSetIndexParametersCno(Arg0 *FaissParameterSpace, Arg1 *FaissIndex, Arg2 uint) int32 {
cArg0, cArg0AllocMap := (*C.FaissParameterSpace)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg1)), cgoAllocsUnknown
cArg2, cArg2AllocMap := (C.size_t)(Arg2), cgoAllocsUnknown
__ret := C.faiss_ParameterSpace_set_index_parameters_cno(cArg0, cArg1, cArg2)
runtime.KeepAlive(cArg2AllocMap)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ParameterSpaceSetIndexParameter function as declared in c_api/AutoTune_c.h:64
func ParameterSpaceSetIndexParameter(Arg0 *FaissParameterSpace, Arg1 *FaissIndex, Arg2 string, Arg3 float64) int32 {
cArg0, cArg0AllocMap := (*C.FaissParameterSpace)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg1)), cgoAllocsUnknown
Arg2 = safeString(Arg2)
cArg2, cArg2AllocMap := unpackPCharString(Arg2)
cArg3, cArg3AllocMap := (C.double)(Arg3), cgoAllocsUnknown
__ret := C.faiss_ParameterSpace_set_index_parameter(cArg0, cArg1, cArg2, cArg3)
runtime.KeepAlive(cArg3AllocMap)
runtime.KeepAlive(Arg2)
runtime.KeepAlive(cArg2AllocMap)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ParameterSpaceDisplay function as declared in c_api/AutoTune_c.h:71
func ParameterSpaceDisplay(Arg0 *FaissParameterSpace) {
cArg0, cArg0AllocMap := (*C.FaissParameterSpace)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
C.faiss_ParameterSpace_display(cArg0)
runtime.KeepAlive(cArg0AllocMap)
}
// ParameterSpaceAddRange function as declared in c_api/AutoTune_c.h:74
func ParameterSpaceAddRange(Arg0 *FaissParameterSpace, Arg1 string, Arg2 **FaissParameterRange) int32 {
cArg0, cArg0AllocMap := (*C.FaissParameterSpace)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
Arg1 = safeString(Arg1)
cArg1, cArg1AllocMap := unpackPCharString(Arg1)
cArg2, cArg2AllocMap := (**C.FaissParameterRange)(unsafe.Pointer(Arg2)), cgoAllocsUnknown
__ret := C.faiss_ParameterSpace_add_range(cArg0, cArg1, cArg2)
runtime.KeepAlive(cArg2AllocMap)
runtime.KeepAlive(Arg1)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFree function as declared in c_api/Index_c.h:44
func IndexFree(Obj *FaissIndex) {
cObj, cObjAllocMap := (*C.FaissIndex)(unsafe.Pointer(Obj)), cgoAllocsUnknown
C.faiss_Index_free(cObj)
runtime.KeepAlive(cObjAllocMap)
}
// IndexD function as declared in c_api/Index_c.h:47
func IndexD(Arg0 *FaissIndex) int32 {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Index_d(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// IndexIsTrained function as declared in c_api/Index_c.h:50
func IndexIsTrained(Arg0 *FaissIndex) int32 {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Index_is_trained(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// IndexNtotal function as declared in c_api/Index_c.h:53
func IndexNtotal(Arg0 *FaissIndex) int {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Index_ntotal(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int)(__ret)
return __v
}
// IndexMetricType function as declared in c_api/Index_c.h:56
func IndexMetricType(Arg0 *FaissIndex) FaissMetricType {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Index_metric_type(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (FaissMetricType)(__ret)
return __v
}
// IndexSetVerbose function as declared in c_api/Index_c.h:58
func IndexSetVerbose(Arg0 *FaissIndex, Arg1 int32) {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (C.int)(Arg1), cgoAllocsUnknown
C.faiss_Index_set_verbose(cArg0, cArg1)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
}
// IndexVerbose function as declared in c_api/Index_c.h:58
func IndexVerbose(Arg0 *FaissIndex) int32 {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Index_verbose(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// IndexTrain function as declared in c_api/Index_c.h:66
func IndexTrain(Index *FaissIndex, N int, X *float32) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cN, cNAllocMap := (C.idx_t)(N), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
__ret := C.faiss_Index_train(cIndex, cN, cX)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexAdd function as declared in c_api/Index_c.h:76
func IndexAdd(Index *FaissIndex, N int, X *float32) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cN, cNAllocMap := (C.idx_t)(N), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
__ret := C.faiss_Index_add(cIndex, cN, cX)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexAddWithIds function as declared in c_api/Index_c.h:86
func IndexAddWithIds(Index *FaissIndex, N int, X *float32, Xids *int) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cN, cNAllocMap := (C.idx_t)(N), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
cXids, cXidsAllocMap := (*C.idx_t)(unsafe.Pointer(Xids)), cgoAllocsUnknown
__ret := C.faiss_Index_add_with_ids(cIndex, cN, cX, cXids)
runtime.KeepAlive(cXidsAllocMap)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexSearch function as declared in c_api/Index_c.h:102
func IndexSearch(Index *FaissIndex, N int, X *float32, K int, Distances *float32, Labels *int) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cN, cNAllocMap := (C.idx_t)(N), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
cK, cKAllocMap := (C.idx_t)(K), cgoAllocsUnknown
cDistances, cDistancesAllocMap := (*C.float)(unsafe.Pointer(Distances)), cgoAllocsUnknown
cLabels, cLabelsAllocMap := (*C.idx_t)(unsafe.Pointer(Labels)), cgoAllocsUnknown
__ret := C.faiss_Index_search(cIndex, cN, cX, cK, cDistances, cLabels)
runtime.KeepAlive(cLabelsAllocMap)
runtime.KeepAlive(cDistancesAllocMap)
runtime.KeepAlive(cKAllocMap)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexRangeSearch function as declared in c_api/Index_c.h:121
func IndexRangeSearch(Index *FaissIndex, N int, X *float32, Radius float32, Result *FaissRangeSearchResult) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cN, cNAllocMap := (C.idx_t)(N), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
cRadius, cRadiusAllocMap := (C.float)(Radius), cgoAllocsUnknown
cResult, cResultAllocMap := (*C.FaissRangeSearchResult)(unsafe.Pointer(Result)), cgoAllocsUnknown
__ret := C.faiss_Index_range_search(cIndex, cN, cX, cRadius, cResult)
runtime.KeepAlive(cResultAllocMap)
runtime.KeepAlive(cRadiusAllocMap)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexAssign function as declared in c_api/Index_c.h:135
func IndexAssign(Index *FaissIndex, N int, X *float32, Labels *int, K int) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cN, cNAllocMap := (C.idx_t)(N), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
cLabels, cLabelsAllocMap := (*C.idx_t)(unsafe.Pointer(Labels)), cgoAllocsUnknown
cK, cKAllocMap := (C.idx_t)(K), cgoAllocsUnknown
__ret := C.faiss_Index_assign(cIndex, cN, cX, cLabels, cK)
runtime.KeepAlive(cKAllocMap)
runtime.KeepAlive(cLabelsAllocMap)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexReset function as declared in c_api/Index_c.h:145
func IndexReset(Index *FaissIndex) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
__ret := C.faiss_Index_reset(cIndex)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexRemoveIds function as declared in c_api/Index_c.h:151
func IndexRemoveIds(Index *FaissIndex, Sel *FaissIDSelector, NRemoved *uint) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cSel, cSelAllocMap := (*C.FaissIDSelector)(unsafe.Pointer(Sel)), cgoAllocsUnknown
cNRemoved, cNRemovedAllocMap := (*C.size_t)(unsafe.Pointer(NRemoved)), cgoAllocsUnknown
__ret := C.faiss_Index_remove_ids(cIndex, cSel, cNRemoved)
runtime.KeepAlive(cNRemovedAllocMap)
runtime.KeepAlive(cSelAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexReconstruct function as declared in c_api/Index_c.h:163
func IndexReconstruct(Index *FaissIndex, Key int, Recons *float32) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cKey, cKeyAllocMap := (C.idx_t)(Key), cgoAllocsUnknown
cRecons, cReconsAllocMap := (*C.float)(unsafe.Pointer(Recons)), cgoAllocsUnknown
__ret := C.faiss_Index_reconstruct(cIndex, cKey, cRecons)
runtime.KeepAlive(cReconsAllocMap)
runtime.KeepAlive(cKeyAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexReconstructN function as declared in c_api/Index_c.h:171
func IndexReconstructN(Index *FaissIndex, I0 int, Ni int, Recons *float32) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cI0, cI0AllocMap := (C.idx_t)(I0), cgoAllocsUnknown
cNi, cNiAllocMap := (C.idx_t)(Ni), cgoAllocsUnknown
cRecons, cReconsAllocMap := (*C.float)(unsafe.Pointer(Recons)), cgoAllocsUnknown
__ret := C.faiss_Index_reconstruct_n(cIndex, cI0, cNi, cRecons)
runtime.KeepAlive(cReconsAllocMap)
runtime.KeepAlive(cNiAllocMap)
runtime.KeepAlive(cI0AllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexComputeResidual function as declared in c_api/Index_c.h:189
func IndexComputeResidual(Index *FaissIndex, X *float32, Residual *float32, Key int) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
cResidual, cResidualAllocMap := (*C.float)(unsafe.Pointer(Residual)), cgoAllocsUnknown
cKey, cKeyAllocMap := (C.idx_t)(Key), cgoAllocsUnknown
__ret := C.faiss_Index_compute_residual(cIndex, cX, cResidual, cKey)
runtime.KeepAlive(cKeyAllocMap)
runtime.KeepAlive(cResidualAllocMap)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexComputeResidualN function as declared in c_api/Index_c.h:208
func IndexComputeResidualN(Index *FaissIndex, N int, X *float32, Residuals *float32, Keys *int) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cN, cNAllocMap := (C.idx_t)(N), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
cResiduals, cResidualsAllocMap := (*C.float)(unsafe.Pointer(Residuals)), cgoAllocsUnknown
cKeys, cKeysAllocMap := (*C.idx_t)(unsafe.Pointer(Keys)), cgoAllocsUnknown
__ret := C.faiss_Index_compute_residual_n(cIndex, cN, cX, cResiduals, cKeys)
runtime.KeepAlive(cKeysAllocMap)
runtime.KeepAlive(cResidualsAllocMap)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringParametersInit function as declared in c_api/Clustering_c.h:43
func ClusteringParametersInit(Params *FaissClusteringParameters) {
cParams, cParamsAllocMap := (*C.FaissClusteringParameters)(unsafe.Pointer(Params)), cgoAllocsUnknown
C.faiss_ClusteringParameters_init(cParams)
runtime.KeepAlive(cParamsAllocMap)
}
// ClusteringNiter function as declared in c_api/Clustering_c.h:61
func ClusteringNiter(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_niter(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringNredo function as declared in c_api/Clustering_c.h:62
func ClusteringNredo(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_nredo(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringVerbose function as declared in c_api/Clustering_c.h:63
func ClusteringVerbose(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_verbose(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringSpherical function as declared in c_api/Clustering_c.h:64
func ClusteringSpherical(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_spherical(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringIntCentroids function as declared in c_api/Clustering_c.h:65
func ClusteringIntCentroids(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_int_centroids(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringUpdateIndex function as declared in c_api/Clustering_c.h:66
func ClusteringUpdateIndex(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_update_index(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringFrozenCentroids function as declared in c_api/Clustering_c.h:67
func ClusteringFrozenCentroids(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_frozen_centroids(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringMinPointsPerCentroid function as declared in c_api/Clustering_c.h:69
func ClusteringMinPointsPerCentroid(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_min_points_per_centroid(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringMaxPointsPerCentroid function as declared in c_api/Clustering_c.h:70
func ClusteringMaxPointsPerCentroid(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_max_points_per_centroid(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringSeed function as declared in c_api/Clustering_c.h:72
func ClusteringSeed(Arg0 *FaissClustering) int32 {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_seed(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringDecodeBlockSize function as declared in c_api/Clustering_c.h:73
func ClusteringDecodeBlockSize(Arg0 *FaissClustering) uint {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_decode_block_size(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (uint)(__ret)
return __v
}
// ClusteringD function as declared in c_api/Clustering_c.h:76
func ClusteringD(Arg0 *FaissClustering) uint {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_d(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (uint)(__ret)
return __v
}
// ClusteringK function as declared in c_api/Clustering_c.h:79
func ClusteringK(Arg0 *FaissClustering) uint {
cArg0, cArg0AllocMap := (*C.FaissClustering)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_Clustering_k(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (uint)(__ret)
return __v
}
// ClusteringIterationStatsObj function as declared in c_api/Clustering_c.h:82
func ClusteringIterationStatsObj(Arg0 *FaissClusteringIterationStats) float32 {
cArg0, cArg0AllocMap := (*C.FaissClusteringIterationStats)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_ClusteringIterationStats_obj(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (float32)(__ret)
return __v
}
// ClusteringIterationStatsTime function as declared in c_api/Clustering_c.h:83
func ClusteringIterationStatsTime(Arg0 *FaissClusteringIterationStats) float64 {
cArg0, cArg0AllocMap := (*C.FaissClusteringIterationStats)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_ClusteringIterationStats_time(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (float64)(__ret)
return __v
}
// ClusteringIterationStatsTimeSearch function as declared in c_api/Clustering_c.h:84
func ClusteringIterationStatsTimeSearch(Arg0 *FaissClusteringIterationStats) float64 {
cArg0, cArg0AllocMap := (*C.FaissClusteringIterationStats)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_ClusteringIterationStats_time_search(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (float64)(__ret)
return __v
}
// ClusteringIterationStatsImbalanceFactor function as declared in c_api/Clustering_c.h:85
func ClusteringIterationStatsImbalanceFactor(Arg0 *FaissClusteringIterationStats) float64 {
cArg0, cArg0AllocMap := (*C.FaissClusteringIterationStats)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_ClusteringIterationStats_imbalance_factor(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (float64)(__ret)
return __v
}
// ClusteringIterationStatsNsplit function as declared in c_api/Clustering_c.h:86
func ClusteringIterationStatsNsplit(Arg0 *FaissClusteringIterationStats) int32 {
cArg0, cArg0AllocMap := (*C.FaissClusteringIterationStats)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_ClusteringIterationStats_nsplit(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringCentroids function as declared in c_api/Clustering_c.h:89
func ClusteringCentroids(Clustering *FaissClustering, Centroids **float32, Size *uint) {
cClustering, cClusteringAllocMap := (*C.FaissClustering)(unsafe.Pointer(Clustering)), cgoAllocsUnknown
cCentroids, cCentroidsAllocMap := (**C.float)(unsafe.Pointer(Centroids)), cgoAllocsUnknown
cSize, cSizeAllocMap := (*C.size_t)(unsafe.Pointer(Size)), cgoAllocsUnknown
C.faiss_Clustering_centroids(cClustering, cCentroids, cSize)
runtime.KeepAlive(cSizeAllocMap)
runtime.KeepAlive(cCentroidsAllocMap)
runtime.KeepAlive(cClusteringAllocMap)
}
// ClusteringIterationStats function as declared in c_api/Clustering_c.h:95
func ClusteringIterationStats(Clustering *FaissClustering, IterationStats **FaissClusteringIterationStats, Size *uint) {
cClustering, cClusteringAllocMap := (*C.FaissClustering)(unsafe.Pointer(Clustering)), cgoAllocsUnknown
cIterationStats, cIterationStatsAllocMap := (**C.FaissClusteringIterationStats)(unsafe.Pointer(IterationStats)), cgoAllocsUnknown
cSize, cSizeAllocMap := (*C.size_t)(unsafe.Pointer(Size)), cgoAllocsUnknown
C.faiss_Clustering_iteration_stats(cClustering, cIterationStats, cSize)
runtime.KeepAlive(cSizeAllocMap)
runtime.KeepAlive(cIterationStatsAllocMap)
runtime.KeepAlive(cClusteringAllocMap)
}
// ClusteringNew function as declared in c_api/Clustering_c.h:101
func ClusteringNew(PClustering **FaissClustering, D int32, K int32) int32 {
cPClustering, cPClusteringAllocMap := (**C.FaissClustering)(unsafe.Pointer(PClustering)), cgoAllocsUnknown
cD, cDAllocMap := (C.int)(D), cgoAllocsUnknown
cK, cKAllocMap := (C.int)(K), cgoAllocsUnknown
__ret := C.faiss_Clustering_new(cPClustering, cD, cK)
runtime.KeepAlive(cKAllocMap)
runtime.KeepAlive(cDAllocMap)
runtime.KeepAlive(cPClusteringAllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringNewWithParams function as declared in c_api/Clustering_c.h:103
func ClusteringNewWithParams(PClustering **FaissClustering, D int32, K int32, Cp *FaissClusteringParameters) int32 {
cPClustering, cPClusteringAllocMap := (**C.FaissClustering)(unsafe.Pointer(PClustering)), cgoAllocsUnknown
cD, cDAllocMap := (C.int)(D), cgoAllocsUnknown
cK, cKAllocMap := (C.int)(K), cgoAllocsUnknown
cCp, cCpAllocMap := (*C.FaissClusteringParameters)(unsafe.Pointer(Cp)), cgoAllocsUnknown
__ret := C.faiss_Clustering_new_with_params(cPClustering, cD, cK, cCp)
runtime.KeepAlive(cCpAllocMap)
runtime.KeepAlive(cKAllocMap)
runtime.KeepAlive(cDAllocMap)
runtime.KeepAlive(cPClusteringAllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringTrain function as declared in c_api/Clustering_c.h:109
func ClusteringTrain(Clustering *FaissClustering, N int, X *float32, Index *FaissIndex) int32 {
cClustering, cClusteringAllocMap := (*C.FaissClustering)(unsafe.Pointer(Clustering)), cgoAllocsUnknown
cN, cNAllocMap := (C.idx_t)(N), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
__ret := C.faiss_Clustering_train(cClustering, cN, cX, cIndex)
runtime.KeepAlive(cIndexAllocMap)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cClusteringAllocMap)
__v := (int32)(__ret)
return __v
}
// ClusteringFree function as declared in c_api/Clustering_c.h:115
func ClusteringFree(Clustering *FaissClustering) {
cClustering, cClusteringAllocMap := (*C.FaissClustering)(unsafe.Pointer(Clustering)), cgoAllocsUnknown
C.faiss_Clustering_free(cClustering)
runtime.KeepAlive(cClusteringAllocMap)
}
// KmeansClustering function as declared in c_api/Clustering_c.h:127
func KmeansClustering(D uint, N uint, K uint, X *float32, Centroids *float32, QError *float32) int32 {
cD, cDAllocMap := (C.size_t)(D), cgoAllocsUnknown
cN, cNAllocMap := (C.size_t)(N), cgoAllocsUnknown
cK, cKAllocMap := (C.size_t)(K), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
cCentroids, cCentroidsAllocMap := (*C.float)(unsafe.Pointer(Centroids)), cgoAllocsUnknown
cQError, cQErrorAllocMap := (*C.float)(unsafe.Pointer(QError)), cgoAllocsUnknown
__ret := C.faiss_kmeans_clustering(cD, cN, cK, cX, cCentroids, cQError)
runtime.KeepAlive(cQErrorAllocMap)
runtime.KeepAlive(cCentroidsAllocMap)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cKAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cDAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFlatNew function as declared in c_api/IndexFlat_c.h:27
func IndexFlatNew(PIndex **FaissIndexFlat) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexFlat)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
__ret := C.faiss_IndexFlat_new(cPIndex)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFlatNewWith function as declared in c_api/IndexFlat_c.h:29
func IndexFlatNewWith(PIndex **FaissIndexFlat, D int, Metric FaissMetricType) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexFlat)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
cD, cDAllocMap := (C.idx_t)(D), cgoAllocsUnknown
cMetric, cMetricAllocMap := (C.FaissMetricType)(Metric), cgoAllocsUnknown
__ret := C.faiss_IndexFlat_new_with(cPIndex, cD, cMetric)
runtime.KeepAlive(cMetricAllocMap)
runtime.KeepAlive(cDAllocMap)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFlatXb function as declared in c_api/IndexFlat_c.h:41
func IndexFlatXb(Index *FaissIndexFlat, PXb **float32, PSize *uint) {
cIndex, cIndexAllocMap := (*C.FaissIndexFlat)(unsafe.Pointer(Index)), cgoAllocsUnknown
cPXb, cPXbAllocMap := (**C.float)(unsafe.Pointer(PXb)), cgoAllocsUnknown
cPSize, cPSizeAllocMap := (*C.size_t)(unsafe.Pointer(PSize)), cgoAllocsUnknown
C.faiss_IndexFlat_xb(cIndex, cPXb, cPSize)
runtime.KeepAlive(cPSizeAllocMap)
runtime.KeepAlive(cPXbAllocMap)
runtime.KeepAlive(cIndexAllocMap)
}
// IndexFlatCast function as declared in c_api/IndexFlat_c.h:49
func IndexFlatCast(Arg0 *FaissIndex) *FaissIndexFlat {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexFlat_cast(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := *(**FaissIndexFlat)(unsafe.Pointer(&__ret))
return __v
}
// IndexFlatFree function as declared in c_api/IndexFlat_c.h:51
func IndexFlatFree(Obj *FaissIndexFlat) {
cObj, cObjAllocMap := (*C.FaissIndexFlat)(unsafe.Pointer(Obj)), cgoAllocsUnknown
C.faiss_IndexFlat_free(cObj)
runtime.KeepAlive(cObjAllocMap)
}
// IndexFlatComputeDistanceSubset function as declared in c_api/IndexFlat_c.h:62
func IndexFlatComputeDistanceSubset(Index *FaissIndex, N int, X *float32, K int, Distances *float32, Labels *int) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(Index)), cgoAllocsUnknown
cN, cNAllocMap := (C.idx_t)(N), cgoAllocsUnknown
cX, cXAllocMap := (*C.float)(unsafe.Pointer(X)), cgoAllocsUnknown
cK, cKAllocMap := (C.idx_t)(K), cgoAllocsUnknown
cDistances, cDistancesAllocMap := (*C.float)(unsafe.Pointer(Distances)), cgoAllocsUnknown
cLabels, cLabelsAllocMap := (*C.idx_t)(unsafe.Pointer(Labels)), cgoAllocsUnknown
__ret := C.faiss_IndexFlat_compute_distance_subset(cIndex, cN, cX, cK, cDistances, cLabels)
runtime.KeepAlive(cLabelsAllocMap)
runtime.KeepAlive(cDistancesAllocMap)
runtime.KeepAlive(cKAllocMap)
runtime.KeepAlive(cXAllocMap)
runtime.KeepAlive(cNAllocMap)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFlatIPCast function as declared in c_api/IndexFlat_c.h:73
func IndexFlatIPCast(Arg0 *FaissIndex) *FaissIndexFlatIP {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexFlatIP_cast(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := *(**FaissIndexFlatIP)(unsafe.Pointer(&__ret))
return __v
}
// IndexFlatIPFree function as declared in c_api/IndexFlat_c.h:74
func IndexFlatIPFree(Obj *FaissIndexFlatIP) {
cObj, cObjAllocMap := (*C.FaissIndexFlatIP)(unsafe.Pointer(Obj)), cgoAllocsUnknown
C.faiss_IndexFlatIP_free(cObj)
runtime.KeepAlive(cObjAllocMap)
}
// IndexFlatIPNew function as declared in c_api/IndexFlat_c.h:76
func IndexFlatIPNew(PIndex **FaissIndexFlatIP) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexFlatIP)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
__ret := C.faiss_IndexFlatIP_new(cPIndex)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFlatIPNewWith function as declared in c_api/IndexFlat_c.h:78
func IndexFlatIPNewWith(PIndex **FaissIndexFlatIP, D int) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexFlatIP)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
cD, cDAllocMap := (C.idx_t)(D), cgoAllocsUnknown
__ret := C.faiss_IndexFlatIP_new_with(cPIndex, cD)
runtime.KeepAlive(cDAllocMap)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFlatL2Cast function as declared in c_api/IndexFlat_c.h:83
func IndexFlatL2Cast(Arg0 *FaissIndex) *FaissIndexFlatL2 {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexFlatL2_cast(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := *(**FaissIndexFlatL2)(unsafe.Pointer(&__ret))
return __v
}
// IndexFlatL2Free function as declared in c_api/IndexFlat_c.h:84
func IndexFlatL2Free(Obj *FaissIndexFlatL2) {
cObj, cObjAllocMap := (*C.FaissIndexFlatL2)(unsafe.Pointer(Obj)), cgoAllocsUnknown
C.faiss_IndexFlatL2_free(cObj)
runtime.KeepAlive(cObjAllocMap)
}
// IndexFlatL2New function as declared in c_api/IndexFlat_c.h:86
func IndexFlatL2New(PIndex **FaissIndexFlatL2) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexFlatL2)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
__ret := C.faiss_IndexFlatL2_new(cPIndex)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFlatL2NewWith function as declared in c_api/IndexFlat_c.h:88
func IndexFlatL2NewWith(PIndex **FaissIndexFlatL2, D int) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexFlatL2)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
cD, cDAllocMap := (C.idx_t)(D), cgoAllocsUnknown
__ret := C.faiss_IndexFlatL2_new_with(cPIndex, cD)
runtime.KeepAlive(cDAllocMap)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexRefineFlatNew function as declared in c_api/IndexFlat_c.h:97
func IndexRefineFlatNew(PIndex **FaissIndexRefineFlat, BaseIndex *FaissIndex) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexRefineFlat)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
cBaseIndex, cBaseIndexAllocMap := (*C.FaissIndex)(unsafe.Pointer(BaseIndex)), cgoAllocsUnknown
__ret := C.faiss_IndexRefineFlat_new(cPIndex, cBaseIndex)
runtime.KeepAlive(cBaseIndexAllocMap)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexRefineFlatFree function as declared in c_api/IndexFlat_c.h:101
func IndexRefineFlatFree(Obj *FaissIndexRefineFlat) {
cObj, cObjAllocMap := (*C.FaissIndexRefineFlat)(unsafe.Pointer(Obj)), cgoAllocsUnknown
C.faiss_IndexRefineFlat_free(cObj)
runtime.KeepAlive(cObjAllocMap)
}
// IndexRefineFlatCast function as declared in c_api/IndexFlat_c.h:102
func IndexRefineFlatCast(Arg0 *FaissIndex) *FaissIndexRefineFlat {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexRefineFlat_cast(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := *(**FaissIndexRefineFlat)(unsafe.Pointer(&__ret))
return __v
}
// IndexRefineFlatOwnFields function as declared in c_api/IndexFlat_c.h:104
func IndexRefineFlatOwnFields(Arg0 *FaissIndexRefineFlat) int32 {
cArg0, cArg0AllocMap := (*C.FaissIndexRefineFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexRefineFlat_own_fields(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// IndexRefineFlatSetOwnFields function as declared in c_api/IndexFlat_c.h:104
func IndexRefineFlatSetOwnFields(Arg0 *FaissIndexRefineFlat, Arg1 int32) {
cArg0, cArg0AllocMap := (*C.FaissIndexRefineFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (C.int)(Arg1), cgoAllocsUnknown
C.faiss_IndexRefineFlat_set_own_fields(cArg0, cArg1)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
}
// IndexRefineFlatKFactor function as declared in c_api/IndexFlat_c.h:108
func IndexRefineFlatKFactor(Arg0 *FaissIndexRefineFlat) float32 {
cArg0, cArg0AllocMap := (*C.FaissIndexRefineFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexRefineFlat_k_factor(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (float32)(__ret)
return __v
}
// IndexRefineFlatSetKFactor function as declared in c_api/IndexFlat_c.h:108
func IndexRefineFlatSetKFactor(Arg0 *FaissIndexRefineFlat, Arg1 float32) {
cArg0, cArg0AllocMap := (*C.FaissIndexRefineFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (C.float)(Arg1), cgoAllocsUnknown
C.faiss_IndexRefineFlat_set_k_factor(cArg0, cArg1)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
}
// IndexFlat1DCast function as declared in c_api/IndexFlat_c.h:116
func IndexFlat1DCast(Arg0 *FaissIndex) *FaissIndexFlat1D {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexFlat1D_cast(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := *(**FaissIndexFlat1D)(unsafe.Pointer(&__ret))
return __v
}
// IndexFlat1DFree function as declared in c_api/IndexFlat_c.h:117
func IndexFlat1DFree(Obj *FaissIndexFlat1D) {
cObj, cObjAllocMap := (*C.FaissIndexFlat1D)(unsafe.Pointer(Obj)), cgoAllocsUnknown
C.faiss_IndexFlat1D_free(cObj)
runtime.KeepAlive(cObjAllocMap)
}
// IndexFlat1DNew function as declared in c_api/IndexFlat_c.h:119
func IndexFlat1DNew(PIndex **FaissIndexFlat1D) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexFlat1D)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
__ret := C.faiss_IndexFlat1D_new(cPIndex)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFlat1DNewWith function as declared in c_api/IndexFlat_c.h:120
func IndexFlat1DNewWith(PIndex **FaissIndexFlat1D, ContinuousUpdate int32) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexFlat1D)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
cContinuousUpdate, cContinuousUpdateAllocMap := (C.int)(ContinuousUpdate), cgoAllocsUnknown
__ret := C.faiss_IndexFlat1D_new_with(cPIndex, cContinuousUpdate)
runtime.KeepAlive(cContinuousUpdateAllocMap)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexFlat1DUpdatePermutation function as declared in c_api/IndexFlat_c.h:124
func IndexFlat1DUpdatePermutation(Index *FaissIndexFlat1D) int32 {
cIndex, cIndexAllocMap := (*C.FaissIndexFlat1D)(unsafe.Pointer(Index)), cgoAllocsUnknown
__ret := C.faiss_IndexFlat1D_update_permutation(cIndex)
runtime.KeepAlive(cIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexIVFFlatFree function as declared in c_api/IndexIVFFlat_c.h:27
func IndexIVFFlatFree(Obj *FaissIndexIVFFlat) {
cObj, cObjAllocMap := (*C.FaissIndexIVFFlat)(unsafe.Pointer(Obj)), cgoAllocsUnknown
C.faiss_IndexIVFFlat_free(cObj)
runtime.KeepAlive(cObjAllocMap)
}
// IndexIVFFlatCast function as declared in c_api/IndexIVFFlat_c.h:28
func IndexIVFFlatCast(Arg0 *FaissIndex) *FaissIndexIVFFlat {
cArg0, cArg0AllocMap := (*C.FaissIndex)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexIVFFlat_cast(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := *(**FaissIndexIVFFlat)(unsafe.Pointer(&__ret))
return __v
}
// IndexIVFFlatNlist function as declared in c_api/IndexIVFFlat_c.h:31
func IndexIVFFlatNlist(Arg0 *FaissIndexIVFFlat) uint {
cArg0, cArg0AllocMap := (*C.FaissIndexIVFFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexIVFFlat_nlist(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (uint)(__ret)
return __v
}
// IndexIVFFlatNprobe function as declared in c_api/IndexIVFFlat_c.h:33
func IndexIVFFlatNprobe(Arg0 *FaissIndexIVFFlat) uint {
cArg0, cArg0AllocMap := (*C.FaissIndexIVFFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexIVFFlat_nprobe(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (uint)(__ret)
return __v
}
// IndexIVFFlatSetNprobe function as declared in c_api/IndexIVFFlat_c.h:33
func IndexIVFFlatSetNprobe(Arg0 *FaissIndexIVFFlat, Arg1 uint) {
cArg0, cArg0AllocMap := (*C.FaissIndexIVFFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (C.size_t)(Arg1), cgoAllocsUnknown
C.faiss_IndexIVFFlat_set_nprobe(cArg0, cArg1)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
}
// IndexIVFFlatQuantizer function as declared in c_api/IndexIVFFlat_c.h:35
func IndexIVFFlatQuantizer(Arg0 *FaissIndexIVFFlat) *FaissIndex {
cArg0, cArg0AllocMap := (*C.FaissIndexIVFFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexIVFFlat_quantizer(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := *(**FaissIndex)(unsafe.Pointer(&__ret))
return __v
}
// IndexIVFFlatQuantizerTrainsAlone function as declared in c_api/IndexIVFFlat_c.h:41
func IndexIVFFlatQuantizerTrainsAlone(Arg0 *FaissIndexIVFFlat) byte {
cArg0, cArg0AllocMap := (*C.FaissIndexIVFFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexIVFFlat_quantizer_trains_alone(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (byte)(__ret)
return __v
}
// IndexIVFFlatOwnFields function as declared in c_api/IndexIVFFlat_c.h:44
func IndexIVFFlatOwnFields(Arg0 *FaissIndexIVFFlat) int32 {
cArg0, cArg0AllocMap := (*C.FaissIndexIVFFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
__ret := C.faiss_IndexIVFFlat_own_fields(cArg0)
runtime.KeepAlive(cArg0AllocMap)
__v := (int32)(__ret)
return __v
}
// IndexIVFFlatSetOwnFields function as declared in c_api/IndexIVFFlat_c.h:44
func IndexIVFFlatSetOwnFields(Arg0 *FaissIndexIVFFlat, Arg1 int32) {
cArg0, cArg0AllocMap := (*C.FaissIndexIVFFlat)(unsafe.Pointer(Arg0)), cgoAllocsUnknown
cArg1, cArg1AllocMap := (C.int)(Arg1), cgoAllocsUnknown
C.faiss_IndexIVFFlat_set_own_fields(cArg0, cArg1)
runtime.KeepAlive(cArg1AllocMap)
runtime.KeepAlive(cArg0AllocMap)
}
// IndexIVFFlatNew function as declared in c_api/IndexIVFFlat_c.h:46
func IndexIVFFlatNew(PIndex **FaissIndexIVFFlat) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexIVFFlat)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
__ret := C.faiss_IndexIVFFlat_new(cPIndex)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexIVFFlatNewWith function as declared in c_api/IndexIVFFlat_c.h:48
func IndexIVFFlatNewWith(PIndex **FaissIndexIVFFlat, Quantizer *FaissIndex, D uint, Nlist uint) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexIVFFlat)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
cQuantizer, cQuantizerAllocMap := (*C.FaissIndex)(unsafe.Pointer(Quantizer)), cgoAllocsUnknown
cD, cDAllocMap := (C.size_t)(D), cgoAllocsUnknown
cNlist, cNlistAllocMap := (C.size_t)(Nlist), cgoAllocsUnknown
__ret := C.faiss_IndexIVFFlat_new_with(cPIndex, cQuantizer, cD, cNlist)
runtime.KeepAlive(cNlistAllocMap)
runtime.KeepAlive(cDAllocMap)
runtime.KeepAlive(cQuantizerAllocMap)
runtime.KeepAlive(cPIndexAllocMap)
__v := (int32)(__ret)
return __v
}
// IndexIVFFlatNewWithMetric function as declared in c_api/IndexIVFFlat_c.h:54
func IndexIVFFlatNewWithMetric(PIndex **FaissIndexIVFFlat, Quantizer *FaissIndex, D uint, Nlist uint, Metric FaissMetricType) int32 {
cPIndex, cPIndexAllocMap := (**C.FaissIndexIVFFlat)(unsafe.Pointer(PIndex)), cgoAllocsUnknown
cQuantizer, cQuantizerAllocMap := (*C.FaissIndex)(unsafe.Pointer(Quantizer)), cgoAllocsUnknown
cD, cDAllocMap := (C.size_t)(D), cgoAllocsUnknown
cNlist, cNlistAllocMap := (C.size_t)(Nlist), cgoAllocsUnknown
cMetric, cMetricAllocMap := (C.FaissMetricType)(Metric), cgoAllocsUnknown
__ret := C.faiss_IndexIVFFlat_new_with_metric(cPIndex, cQuantizer, cD, cNlist, cMetric)