mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
Docs for array and btree
This commit is contained in:
parent
c5ccf0681b
commit
cd476dd243
@ -10,7 +10,7 @@ crosses a page boundary, it is not delegated and a bit slower.
|
|||||||
It's a very C++-style library that does unidiomatic things with interface default
|
It's a very C++-style library that does unidiomatic things with interface default
|
||||||
functions to get diamond inheritance.
|
functions to get diamond inheritance.
|
||||||
|
|
||||||
# Quick demo:
|
## Quick demo:
|
||||||
```java
|
```java
|
||||||
var array = LongArray.mmapForWriting(Path.of("/tmp/test"), 1<<16);
|
var array = LongArray.mmapForWriting(Path.of("/tmp/test"), 1<<16);
|
||||||
|
|
||||||
@ -25,4 +25,16 @@ array.forEach(0, 100, (pos, val) -> {
|
|||||||
System.out.println(pos + ":" + val);
|
System.out.println(pos + ":" + val);
|
||||||
});
|
});
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Query Buffers
|
||||||
|
|
||||||
|
The library offers many operations for sorting and dealing with sorted data.
|
||||||
|
Especially noteworthy are the operations `retain()` and `reject()` in
|
||||||
|
([IntArraySearch](src/main/java/nu/marginalia/array/algo/IntArraySearch.java) and [LongArraySearch](src/main/java/nu/marginalia/array/algo/LongArraySearch.java)) which act upon the
|
||||||
|
classes [IntQueryBuffer](src/main/java/nu/marginalia/array/buffer/IntQueryBuffer.java)
|
||||||
|
and [LongQueryBuffer](src/main/java/nu/marginalia/array/buffer/LongQueryBuffer.java);
|
||||||
|
they keep or remove all items in the buffer that exist in the range. These are used
|
||||||
|
to offer an intersection operation for the B-Tree that has in practice sub-linear run time.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user