HnswIndex {BiocNeighbors} | R Documentation

## The HnswIndex class

### Description

A class to hold indexing structures for the HNSW algorithm for approximate nearest neighbor identification.

### Usage

    HnswIndex(data, path, ef.search = 10, NAMES = NULL, distance = "Euclidean")

### Arguments

`data` | A numeric matrix with data points in columns and dimensions in rows.
`path` | A string specifying the path to the index file.
`ef.search` | Integer scalar specifying the size of the dynamic list at run time.
`NAMES` | A character vector of sample names or `NULL`.
`distance` | A string specifying the distance metric to use.

### Details

The HnswIndex class holds the indexing structure required to run the HNSW algorithm. Users should never need to call the constructor explicitly, but should generate instances of HnswIndex classes with `buildHnsw`.

Users can get values from an HnswIndex object with the usual `[[` syntax. All parameters listed in the constructor can be extracted in this manner.

### Value

An instance of the HnswIndex class.

### Author(s)

Aaron Lun

### See Also

`buildHnsw`, to build the index.

BiocNeighborIndex, for the parent class and its available methods.

### Examples

    example(buildHnsw)
    out[['path']]

[Package BiocNeighbors version 1.12.0 Index]