HnswParam {BiocNeighbors} | R Documentation

## The HnswParam class

### Description

A class to hold parameters for the Hnsw algorithm for approximate nearest neighbor identification.

### Usage

    HnswParam(nlinks=16, ef.construction=200, directory=tempdir(),
        ef.search=10, distance="Euclidean")

    HnswParam_nlinks(x)

    HnswParam_ef_construction(x)

    HnswParam_directory(x)

    HnswParam_ef_search(x)

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

### Arguments

`nlinks` | Integer scalar, number of bi-directional links per element for index generation.
`ef.construction` | Integer scalar, size of the dynamic list for index generation.
`directory` | String specifying the directory in which to save the index.
`ef.search` | Integer scalar, size of the dynamic list for neighbor searching.
`distance` | A string specifying the distance metric to use.
`x, object` | A HnswParam object.

### Details

The HnswParam class holds any parameters associated with running the HNSW algorithm. This generally relates to building of the index - see `buildHnsw` for details.

### Value

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

`HnswParam_nlinks` and `HnswParam_ef_construction` will return the number of links and the size of the dynamic list, respectively, as integer scalars.

`HnswParam_directory` will return the directory as a string.

`HnswParam_ef_search` will return the size of the dynamic list to be used during searching.

### Author(s)

Aaron Lun

### See Also

`buildHnsw`

### Examples

    (out <- HnswParam())

    HnswParam_nlinks(out)
    HnswParam_ef_construction(out)
    HnswParam_directory(out)

[Package BiocNeighbors version 1.8.2 Index]