@@ -99,6 +99,7 @@ struct Index {
9999 * Vectors are implicitly assigned labels ntotal .. ntotal + n - 1
100100 * This function slices the input vectors in chunks smaller than
101101 * blocksize_add and calls add_core.
102+ * @param n number of vectors
102103 * @param x input matrix, size n * d
103104 */
104105 virtual void add (idx_t n, const float * x) = 0;
@@ -108,7 +109,9 @@ struct Index {
108109 * The default implementation fails with an assertion, as it is
109110 * not supported by all indexes.
110111 *
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)
112115 */
113116 virtual void add_with_ids (idx_t n, const float * x, const idx_t * xids);
114117
@@ -117,9 +120,11 @@ struct Index {
117120 * return at most k vectors. If there are not enough results for a
118121 * query, the result array is padded with -1s.
119122 *
123+ * @param n number of vectors
120124 * @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
122126 * @param distances output pairwise distances, size n*k
127+ * @param labels output labels of the NNs, size n*k
123128 */
124129 virtual void search (
125130 idx_t n,
@@ -135,6 +140,7 @@ struct Index {
135140 * indexes do not implement the range_search (only the k-NN search
136141 * is mandatory).
137142 *
143+ * @param n number of vectors
138144 * @param x input vectors to search, size n * d
139145 * @param radius search radius
140146 * @param result result table
@@ -149,8 +155,10 @@ struct Index {
149155 /* * return the indexes of the k vectors closest to the query x.
150156 *
151157 * This function is identical as search but only return labels of neighbors.
158+ * @param n number of vectors
152159 * @param x input vectors to search, size n * d
153160 * @param labels output labels of the NNs, size n*k
161+ * @param k number of nearest neighbours
154162 */
155163 virtual void assign (idx_t n, const float * x, idx_t * labels, idx_t k = 1 )
156164 const ;
@@ -174,7 +182,7 @@ struct Index {
174182 /* * Reconstruct several stored vectors (or an approximation if lossy coding)
175183 *
176184 * 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
178186 * @param keys ids of the vectors to reconstruct (size n)
179187 * @param recons reconstucted vector (size n * d)
180188 */
@@ -184,6 +192,8 @@ struct Index {
184192 /* * Reconstruct vectors i0 to i0 + ni - 1
185193 *
186194 * 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
187197 * @param recons reconstucted vector (size ni * d)
188198 */
189199 virtual void reconstruct_n (idx_t i0, idx_t ni, float * recons) const ;
@@ -194,6 +204,11 @@ struct Index {
194204 * If there are not enough results for a query, the resulting arrays
195205 * is padded with -1s.
196206 *
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
197212 * @param recons reconstructed vectors size (n, k, d)
198213 **/
199214 virtual void search_and_reconstruct (
0 commit comments