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) UnitInserts 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) UnitBuilds 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) BooleanLoads 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) IntReturns number of (allocated!) elements in Annoy.
#unsafeGetDistance Source
unsafeGetDistance :: forall r h. STPrimAnnoy h -> Int -> Int -> Eff (st :: ST h | r) NumberReturns the distance between items at positions i and j. No bounds checks are performed.
- Modules
- Annoy
- Annoy.
ST - Annoy.
Types - Annoy.
Unsafe