Skip to content

Commit 766e921

Browse files
committed
Updated docs
1 parent e512e13 commit 766e921

File tree

1 file changed

+42
-9
lines changed

1 file changed

+42
-9
lines changed

doc/manual.tex

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,21 @@ \subsubsection{flann::Index}
307307
typedef typename Distance::ElementType ElementType;
308308
typedef typename Distance::ResultType DistanceType;
309309
public:
310-
Index(const Matrix<ElementType>& features, const IndexParams& params);
310+
Index(const IndexParams& params, Distance distance = Distance() );
311+
312+
Index(const Matrix<ElementType>& points, const IndexParams& params,
313+
Distance distance = Distance() );
311314
312315
~Index();
313316
314-
void buildIndex();
317+
void buildIndex();
318+
319+
void buildIndex(const Matrix<ElementType>& points);
320+
321+
void addPoints(const Matrix<ElementType>& points,
322+
float rebuild_threshold = 2);
323+
324+
void removePoint(size_t point_id);
315325
316326
int knnSearch(const Matrix<ElementType>& queries,
317327
Matrix<int>& indices,
@@ -325,7 +335,6 @@ \subsubsection{flann::Index}
325335
size_t knn,
326336
const SearchParams& params);
327337
328-
329338
int radiusSearch(const Matrix<ElementType>& queries,
330339
Matrix<int>& indices,
331340
Matrix<DistanceType>& dists,
@@ -406,7 +415,10 @@ \subsubsection{flann::Index}
406415
\textbf{flann::Index::Index}
407416
Constructs a nearest neighbor search index for a given dataset.
408417
\begin{Verbatim}[fontsize=\footnotesize,frame=single]
409-
Index(const Matrix<ElementType>& features, const IndexParams& params);
418+
Index(const IndexParams& params, Distance distance = Distance() );
419+
420+
Index(const Matrix<ElementType>& points, const IndexParams& params,
421+
Distance distance = Distance() );
410422
\end{Verbatim}
411423
\begin{description}
412424
\item[features] Matrix containing the features(points) that should be indexed, stored in a row-major order (one point
@@ -597,12 +609,33 @@ \subsubsection{flann::Index}
597609
\end{description}
598610

599611
\subsubsection{flann::Index::buildIndex}
600-
Constructs the nearest neighbor search index using the parameters provided to the constructor (with the
601-
exception of saved index type).
612+
Builds the nearest neighbor search index. There are two versions of the \texttt{buildIndex} method, one that
613+
uses the points provided as argument and one that uses the points provided to the constructor when the object was
614+
constructed.
602615
\begin{Verbatim}[fontsize=\footnotesize,frame=single]
603-
void buildIndex();
616+
void buildIndex();
617+
618+
void buildIndex(const Matrix<ElementType>& points);
604619
\end{Verbatim}
605620

621+
\subsubsection{flann::Index::addPoints}
622+
The \texttt{addPoints} method can be used to incrementally add points to the index after the index was build.
623+
To avoid the index getting unbalanced, the \texttt{addPoints} method has the option of rebuilding the index after a
624+
large number of points have been added. The \texttt{rebuild\_threshold} parameter controls when the index is
625+
rebuild, by default this is done when it doubles in size (\texttt{rebuild\_threshold} = 2).
626+
627+
\begin{Verbatim}[fontsize=\footnotesize,frame=single]
628+
void addPoints(const Matrix<ElementType>& points, float rebuild_threshold = 2);
629+
\end{Verbatim}
630+
631+
\subsubsection{flann::Index::removePoint}
632+
The \texttt{removePoint} method removes one point with the specified \texttt{point\_id} from the index. The indices
633+
(of the remaining points) returned by the nearest neighbor operations do not change when points are removed from the
634+
index.
635+
636+
\begin{Verbatim}[fontsize=\footnotesize,frame=single]
637+
void removePoint(size_t point_id);
638+
\end{Verbatim}
606639

607640

608641
\subsubsection{flann::Index::knnSearch}
@@ -662,7 +695,7 @@ \subsubsection{flann::Index::knnSearch}
662695
FLANN\_True, FLANN\_Undefined). A heap is more efficient for a large number of neighbors and less efficient for a small
663696
number of neighbors. Default value is FLANN\_Undefined, which lets the code choose the best option depending on the
664697
number of neighbors requested. Only used for KNN search.
665-
\item[cores] How many cores to assign to the search (specify -1 for automatic core selection).
698+
\item[cores] How many cores to assign to the search (specify 0 for automatic core selection).
666699
\item[matrices\_in\_gpu\_ram] for GPU search indicates if matrices are already in GPU ram.
667700
\end{description}
668701
\end{description}
@@ -804,7 +837,7 @@ \subsubsection{flann::KdTreeCuda3dIndex}
804837
\subsection{Using FLANN from C}
805838

806839
FLANN can be used in C programs through the C bindings provided
807-
with the library. Because there is not template support in C, there
840+
with the library. Because there is no template support in C, there
808841
are bindings provided for the following data types: \texttt{unsigned char},
809842
\texttt{int}, \texttt{float} and \texttt{double}. For each of the functions
810843
below there is a corresponding version for each of the for data types, for example

0 commit comments

Comments
 (0)