Module
Annoy.Unsafe
- Package
- purescript-annoy
- Repository
- Kamirus/purescript-annoy
#unsafeAddItem Source
unsafeAddItem :: forall r h. STPrimAnnoy h -> Int -> Array Number -> Eff (st :: ST h | r) Unit
Inserts vector at given index. No checks for: not frozen STPrimAnnoy
, matching dimension, negative index.
#unsafeBuild Source
unsafeBuild :: forall r h. STPrimAnnoy h -> Int -> Eff (st :: ST h | r) Unit
Builds a forest of given number of trees. After calling, no more items can be added.
#unsafeLoad Source
unsafeLoad :: forall r h. STPrimAnnoy h -> String -> Eff (fs :: FS, st :: ST h | r) Boolean
Loads an index from disk.
#unsafeGetItem Source
unsafeGetItem :: forall r h. STPrimAnnoy h -> Int -> Eff (st :: ST h | r) (Array Number)
Returns vector under given index. No bounds checks are performed.
#unsafeGetNNsByItem Source
unsafeGetNNsByItem :: forall r h. STPrimAnnoy h -> Int -> Int -> Int -> Eff (st :: ST h | r) (Array Int)
unsafeGetNNsByItem a i n search_k
Returns n
closest items to the i
-th vector. No bounds checks are performed.
#unsafeGetNNsByVector Source
unsafeGetNNsByVector :: forall r h. STPrimAnnoy h -> Array Number -> Int -> Int -> Eff (st :: ST h | r) (Array Int)
unsafeGetNNsByVector a v n search_k
Like above but query by vector v instead of index.
#getNItems Source
getNItems :: forall r h. STPrimAnnoy h -> Eff (st :: ST h | r) Int
Returns number of (allocated!) elements in Annoy.
#unsafeGetDistance Source
unsafeGetDistance :: forall r h. STPrimAnnoy h -> Int -> Int -> Eff (st :: ST h | r) Number
Returns the distance between items at positions i
and j
. No bounds checks are performed.
- Modules
- Annoy
- Annoy.
ST - Annoy.
Types - Annoy.
Unsafe