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")

    HnswIndex_path(x)

    HnswIndex_ef_search(x)

    ## S4 method for signature 'HnswIndex'
    show(object)

### 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.
`x, object` | A HnswIndex object.

### 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`.

### Value

The `HnswIndex` constructor will return an instance of the HnswIndex class.

`HnswIndex_path` will return the path to the index file.

`HnswIndex_ef_search` will return the size of the dynamic list.

### Author(s)

Aaron Lun

### See Also

`buildHnsw`

### Examples

    example(buildHnsw)
    str(HnswIndex_path(out))

[Package BiocNeighbors version 1.8.2 Index]