@@ -99,6 +99,7 @@ struct Index {
99
99
* Vectors are implicitly assigned labels ntotal .. ntotal + n - 1
100
100
* This function slices the input vectors in chunks smaller than
101
101
* blocksize_add and calls add_core.
102
+ * @param n number of vectors
102
103
* @param x input matrix, size n * d
103
104
*/
104
105
virtual void add (idx_t n, const float * x) = 0;
@@ -108,7 +109,9 @@ struct Index {
108
109
* The default implementation fails with an assertion, as it is
109
110
* not supported by all indexes.
110
111
*
111
- * @param xids if non-null, ids to store for the vectors (size n)
112
+ * @param n number of vectors
113
+ * @param x input vectors, size n * d
114
+ * @param xids if non-null, ids to store for the vectors (size n)
112
115
*/
113
116
virtual void add_with_ids (idx_t n, const float * x, const idx_t * xids);
114
117
@@ -117,9 +120,11 @@ struct Index {
117
120
* return at most k vectors. If there are not enough results for a
118
121
* query, the result array is padded with -1s.
119
122
*
123
+ * @param n number of vectors
120
124
* @param x input vectors to search, size n * d
121
- * @param labels output labels of the NNs, size n*k
125
+ * @param k number of extracted vectors
122
126
* @param distances output pairwise distances, size n*k
127
+ * @param labels output labels of the NNs, size n*k
123
128
*/
124
129
virtual void search (
125
130
idx_t n,
@@ -135,6 +140,7 @@ struct Index {
135
140
* indexes do not implement the range_search (only the k-NN search
136
141
* is mandatory).
137
142
*
143
+ * @param n number of vectors
138
144
* @param x input vectors to search, size n * d
139
145
* @param radius search radius
140
146
* @param result result table
@@ -149,8 +155,10 @@ struct Index {
149
155
/* * return the indexes of the k vectors closest to the query x.
150
156
*
151
157
* This function is identical as search but only return labels of neighbors.
158
+ * @param n number of vectors
152
159
* @param x input vectors to search, size n * d
153
160
* @param labels output labels of the NNs, size n*k
161
+ * @param k number of nearest neighbours
154
162
*/
155
163
virtual void assign (idx_t n, const float * x, idx_t * labels, idx_t k = 1 )
156
164
const ;
@@ -174,7 +182,7 @@ struct Index {
174
182
/* * Reconstruct several stored vectors (or an approximation if lossy coding)
175
183
*
176
184
* this function may not be defined for some indexes
177
- * @param n number of vectors to reconstruct
185
+ * @param n number of vectors to reconstruct
178
186
* @param keys ids of the vectors to reconstruct (size n)
179
187
* @param recons reconstucted vector (size n * d)
180
188
*/
@@ -184,6 +192,8 @@ struct Index {
184
192
/* * Reconstruct vectors i0 to i0 + ni - 1
185
193
*
186
194
* this function may not be defined for some indexes
195
+ * @param i0 index of the first vector in the sequence
196
+ * @param ni number of vectors in the sequence
187
197
* @param recons reconstucted vector (size ni * d)
188
198
*/
189
199
virtual void reconstruct_n (idx_t i0, idx_t ni, float * recons) const ;
@@ -194,6 +204,11 @@ struct Index {
194
204
* If there are not enough results for a query, the resulting arrays
195
205
* is padded with -1s.
196
206
*
207
+ * @param n number of vectors
208
+ * @param x input vectors to search, size n * d
209
+ * @param k number of extracted vectors
210
+ * @param distances output pairwise distances, size n*k
211
+ * @param labels output labels of the NNs, size n*k
197
212
* @param recons reconstructed vectors size (n, k, d)
198
213
**/
199
214
virtual void search_and_reconstruct (
0 commit comments