Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion fern/pages/c_api/c-api-neighbors-vamana.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ The build uses the Vamana insertion-based algorithm to create the graph. The alg

The following distance metrics are supported:

- L2
- L2Expanded (sqeuclidean)
- L2SqrtExpanded (l2 / euclidean distance)

Usage example:

Expand Down
124 changes: 87 additions & 37 deletions fern/pages/java_api/java-api-com-nvidia-cuvs-cagraindex.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public final void setDelegate(AutoCloseable delegate, long handleAddress)

Internal wiring hook used by the Java wrapper implementation.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:33`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:34`_

### isPresent

Expand All @@ -39,7 +39,7 @@ public final boolean isPresent()

Returns true when this view has a native handle.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:41`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:42`_

### nativeHandleAddress

Expand All @@ -49,7 +49,7 @@ public final long nativeHandleAddress()

Internal accessor for native handle address.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:48`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:49`_

### setDelegate

Expand All @@ -59,7 +59,7 @@ public final void setDelegate(AutoCloseable delegate)

Internal wiring hook used by the Java wrapper implementation.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:83`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:84`_

### setDelegate

Expand All @@ -69,7 +69,7 @@ public final void setDelegate(AutoCloseable delegate, long handleAddress)

Internal wiring hook used by the Java wrapper implementation.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:90`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:91`_

### isPresent

Expand All @@ -79,7 +79,7 @@ public final boolean isPresent()

Returns true when this handle owns native dataset storage.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:98`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:99`_

### nativeHandleAddress

Expand All @@ -89,7 +89,7 @@ public final long nativeHandleAddress()

Internal accessor for native handle address.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:105`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:106`_

### close

Expand All @@ -99,7 +99,7 @@ _Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:105`_

Invokes the native destroy_cagra_index to de-allocate the CAGRA index

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:135`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:136`_

### search

Expand All @@ -120,7 +120,7 @@ CAGRA index.

an instance of `SearchResults` containing the results

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:146`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:147`_

### makePaddedDataset

Expand All @@ -132,7 +132,7 @@ Create an owning padded dataset by allocating padded storage and copying
`dataset`. Prefer this when the source matrix is not already padded to CAGRA's
required row stride (e.g. unaligned dimensions).

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:153`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:154`_

### makePaddedDatasetView

Expand All @@ -144,7 +144,7 @@ Create a caller-owned padded dataset view handle from a matrix that is already
padded to CAGRA's required row stride. For unpadded matrices use
`#makePaddedDataset(CuVSMatrix)`.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:160`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:161`_

### makeStandardDatasetView

Expand All @@ -154,7 +154,7 @@ StandardDatasetView makeStandardDatasetView(CuVSMatrix dataset) throws Throwable

Create a caller-owned standard dataset view handle from a matrix.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:163`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:164`_

### updateDataset

Expand All @@ -166,7 +166,7 @@ Update this index with a caller-provided padded device dataset view and leave it
search-ready in padded-device layout. The caller retains ownership of the underlying
padded storage and must keep it alive while this index uses it.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:170`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:171`_

### updateDataset

Expand All @@ -177,7 +177,7 @@ void updateDataset(PaddedDataset dataset) throws Throwable
Update this index with a caller-owned padded device dataset. The dataset must remain alive
while this index uses it.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:176`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:177`_

### getGraph

Expand All @@ -191,7 +191,7 @@ Returns the CAGRA graph

a `CuVSDeviceMatrix` encapsulating the native int (uint32_t) array used to represent the cagra graph

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:183`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:184`_

### getGraphDegree

Expand All @@ -207,7 +207,21 @@ build truncated it.

the built graph degree (`graph().extent(1)`)

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:192`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:193`_

### size

```java
long size()
```

Returns the number of vectors in this index.

**Returns**

the number of rows of the indexed dataset

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:200`_

### serialize

Expand All @@ -224,7 +238,7 @@ for writing index bytes.
| --- | --- |
| `outputStream` | an instance of `OutputStream` to write the index bytes into |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:201`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:209`_

### serialize

Expand All @@ -242,7 +256,7 @@ for writing index bytes.
| `outputStream` | an instance of `OutputStream` to write the index bytes into |
| `bufferLength` | the length of buffer to use for writing bytes. Default value is 1024 |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:212`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:220`_

### serialize

Expand All @@ -260,7 +274,7 @@ for writing index bytes.
| `outputStream` | an instance of `OutputStream` to write the index bytes into |
| `tempFile` | an intermediate `Path` where CAGRA index is written temporarily |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:223`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:231`_

### serialize

Expand All @@ -279,7 +293,7 @@ and path to the intermediate temporary file.
| `tempFile` | an intermediate `Path` where CAGRA index is written temporarily |
| `bufferLength` | the length of buffer to use for writing bytes. Default value is 1024 |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:238`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:246`_

### serializeToHNSW

Expand All @@ -296,7 +310,7 @@ of `OutputStream` and path to the intermediate temporary file.
| --- | --- |
| `outputStream` | an instance of `OutputStream` to write the index bytes to |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:247`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:255`_

### serializeToHNSW

Expand All @@ -314,7 +328,7 @@ of `OutputStream` and path to the intermediate temporary file.
| `outputStream` | an instance of `OutputStream` to write the index bytes to |
| `bufferLength` | the length of buffer to use for writing bytes. Default value is 1024 |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:258`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:266`_

### serializeToHNSW

Expand All @@ -332,7 +346,7 @@ of `OutputStream` and path to the intermediate temporary file.
| `outputStream` | an instance of `OutputStream` to write the index bytes to |
| `tempFile` | an intermediate `Path` where CAGRA index is written temporarily |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:269`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:277`_

### serializeToHNSW

Expand All @@ -351,7 +365,7 @@ of `OutputStream` and path to the intermediate temporary file.
| `tempFile` | an intermediate `Path` where CAGRA index is written temporarily |
| `bufferLength` | the length of buffer to use for writing bytes. Default value is 1024 |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:284`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:292`_

### getCuVSResources

Expand All @@ -365,7 +379,7 @@ Gets an instance of `CuVSResources`

an instance of `CuVSResources`

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:291`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:299`_

### newBuilder

Expand All @@ -387,7 +401,7 @@ Creates a new Builder with an instance of `CuVSResources`.
| --- | --- |
| `UnsupportedOperationException` | if the provider does not cuvs |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:299`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:307`_

### merge

Expand All @@ -413,7 +427,7 @@ A new merged CAGRA index
| --- | --- |
| `Throwable` | if an error occurs during the merge operation |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:311`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:319`_

### merge

Expand All @@ -440,7 +454,43 @@ A new merged CAGRA index
| --- | --- |
| `Throwable` | if an error occurs during the merge operation |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:323`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:331`_

### merge

```java
static CagraIndex merge(CagraIndex[] indexes, CagraIndexParams mergeParams, BitSet rowFilter) throws Throwable
```

Merges multiple CAGRA indexes into a single index, keeping only the rows selected by
`rowFilter`.

The merge concatenates the input datasets in the order the indexes are given, so bit
`i` of the filter refers to row `i` of that concatenation: bits `0` to
`indexes[0].size() - 1` address the first index, the bits that follow address the second,
and so on. A set bit keeps the row; a clear bit drops it. The rows that survive keep
their relative order and are packed together, so the merged index has one row per set bit.

**Parameters**

| Name | Description |
| --- | --- |
| `indexes` | Array of CAGRA indexes to merge |
| `mergeParams` | Parameters to control the merge operation, or null to use defaults |
| `rowFilter` | The rows to keep, or null to keep all of them. A BitSet shorter than the total row count is valid: the rows beyond its logical length are treated as clear (dropped). A bit set at a position at or beyond the total row count throws `IllegalArgumentException`. |

**Returns**

A new merged CAGRA index

**Throws**

| Type | Description |
| --- | --- |
| `IllegalArgumentException` | if `rowFilter` has a bit set beyond the last row, or if it is non-null but keeps no rows at all |
| `Throwable` | if an error occurs during the merge operation |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:355`_

### isPaddedDataset

Expand All @@ -466,7 +516,7 @@ copy it into padded storage it already occupies, and one that is not has to go t

true when the rows are already padded the way CAGRA requires

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:350`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:383`_

### from

Expand All @@ -487,7 +537,7 @@ needed.

an instance of this Builder

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:367`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:400`_

### from

Expand All @@ -510,7 +560,7 @@ serialized index. Keep `outDataset` alive while the built index is in use.

an instance of this Builder

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:378`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:411`_

### from

Expand All @@ -521,7 +571,7 @@ Builder from(CuVSMatrix graph)
Sets a CAGRA graph instance to re-create an index from a
previously built graph.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:384`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:417`_

### withDataset

Expand All @@ -541,7 +591,7 @@ Sets the dataset vectors for building the `CagraIndex`.

an instance of this Builder

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:392`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:425`_

### withDataset

Expand All @@ -561,7 +611,7 @@ Sets the dataset for building the `CagraIndex`.

an instance of this Builder

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:400`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:433`_

### withIndexParams

Expand All @@ -582,7 +632,7 @@ Builder.

An instance of this Builder.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:409`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:442`_

### build

Expand All @@ -596,6 +646,6 @@ Builds and returns an instance of CagraIndex.

an instance of CagraIndex

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:416`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:449`_

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:25`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java:26`_
Loading
Loading