h$};      !"#$%&'()*+,-./0123456789:None5678>? ;rp-treeInternal%one projection vector per node (like annoy)rp-tree%Dense vectors with unboxed componentsrp-tree&Sparse vectors with unboxed components<rp-treeBounds around the cutting plane=rp-treelower bound on the cut point>rp-tree upper bound?rp-tree Exceptionsrp-tree$Pair a datum with a vector embeddingrp-treethe embedding is a vectorrp-tree(Unsafe) Pack a ) from its vector dimension and components0Note : the relevant invariants are not checked :9vector components are _assumed_ to be in increasing order3vector dimension is larger than any component index@rp-tree(Used for updating in a streaming settingArp-treeInternal6one projection vector per tree level (as suggested in  9https://www.cs.helsinki.fi/u/ttonteri/pub/bigdata2016.pdf ) rp-treeRandom projection treesThe first type parameter corresponds to a floating point scalar value, the second is the type of the data collected at the leaves of the tree (e.g. lists of vectors)We keep them separate to leverage the Functor instance for postprocessing and visualization6One projection vector per tree level (as suggested in  9https://www.cs.helsinki.fi/u/ttonteri/pub/bigdata2016.pdf )Brp-tree+one random projection vector per tree level rp-treeInner product spacesThis typeclass is provided as a convenience for library users to interface their own vector types.rp-treeScale a vectorrp-tree0A random projection forest is an ordered set of  sThis supports efficient updates of the ensemble in the streaming/online setting.rp-treeSerialise each tree in the  as a separate bytestringrp-treeDeserialise each tree in the + from a separate bytestring and reconstructrp-treeNumber of tree levelsrp-tree.Set of data points used to construct the indexrp-treesparse-sparse inner productrp-treesparse-dense inner productrp-tree6Vector distance induced by the L2 norm (sparse-sparse)rp-tree5Vector distance induced by the L2 norm (sparse-dense)Crp-tree4Vector distance induced by the L2 norm (dense-dense)Drp-tree Vector sumErp-tree Vector sumFrp-treeVector differenceGrp-treeVector differenceHrp-treeBinary operation on  sIrp-tree=?ST UAVWXYZ[\] ^_B`  abcdCDEFGHeIfNone5?q grp-tree reservoirhrp-treelookahead indexirp-treeWjrp-tree;Sample without replacement with a single pass over the data-implements Algorithm L for reservoir samplingLi, Kim-Hung (4 December 1994). "Reservoir-Sampling Algorithms of Time Complexity O(n(1+log(Nn)))". ACM Transactions on Mathematical Software. 20 (4): 481@493. doi:10.1145 198429.198435krp-tree7Replaces a value at a random position within the buffer!rp-treeGenerate a sparse random vector with a given nonzero density and components sampled from the supplied random generator"rp-treeGenerate a dense random vector with components sampled from the supplied random generatorlrp-treeSample a dense random vectormrp-treeSample a sparse random vectorjrp-tree sample size!rp-treenonzero densityrp-treevector dimensionrp-tree%random generator of vector components"rp-treevector dimensionrp-tree%random generator of vector componentslrp-treevector dimensionmrp-treenonzero densityrp-treevector dimensionnopihgjqrkst !"lmNone#rp-tree(Encode dataset as CSV and save into file$rp-treeRender a tree to stdoutUseful for debuggingThis should be called only for small trees, otherwise the printed result quickly overflows the screen and becomes hard to read.>NB : prints distance information rounded to two decimal digits#rp-treedata point, label uv#wx$yz{|}~None3? &rp-tree"Populate a tree from a data streamAssumptions on the data source:'non-empty : contains at least one value>stationary : each chunk is representative of the whole datasetbounded : we wait until the end of the stream to produce a resultThrows S if the conduit is empty'rp-tree$Populate a forest from a data streamAssumptions on the data source:'non-empty : contains at least one value>stationary : each chunk is representative of the whole datasetbounded : we wait until the end of the stream to produce a resultThrows S if the conduit is empty(rp-treeSource of random data points&rp-tree random seedrp-treemax tree depthrp-tree min leaf sizerp-treedata chunk sizerp-tree%nonzero density of projection vectorsrp-treedimension of projection vectorsrp-tree data source'rp-tree random seedrp-treemax tree depthrp-tree min leaf sizerp-treenumber of treesrp-treedata chunk sizerp-tree%nonzero density of projection vectorsrp-treedimension of projection vectorsrp-tree data source(rp-treenumber of vectors to generaterp-tree*random generator for the vector components%&'(NoneQ5rp-tree(binary mixture of isotropic Gaussian rvs6rp-tree?binary mixture of isotropic Gaussian rvs with sparse components5rp-treenumber of data pointsrp-treevector dimension6rp-treenumber of data pointsrp-treevector dimensionrp-treenonzero density)*3210/.-,+456)*3210/.-,+456None 58>?8rp-treek nearest neighbors9rp-tree1average recall-at-k, computed over a set of trees:rp-tree$Retrieve points nearest to the query=in case of a narrow margin, collect both branches of the tree8rp-treedistance functionrp-tree k neighborsrp-treerandom projection forestrp-tree query pointrp-tree$ordered in increasing distance order9rp-tree+k : number of nearest neighbors to considerrp-tree query point:rp-tree query point8  !"#$%&'()*+,-./0123489:8&'89:  (!" $#4)*+,-./0123%       !"#$%&'()*+,-.//0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVAWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"rp-tree-0.3-7mhRZY15dkaLn5ZeyyTkXr Data.RPTreeData.RPTree.Internal.TestingData.RPTree.InternalData.RPTree.GenData.RPTree.DrawData.RPTree.ConduitDVectorSVectorEmbedeEmbedeData fromListSv fromVectorSv fromListDv fromVectorDvRPTreeInnerinnermetricL2^+^^-^Scale.*RPForestserialiseRPForestdeserialiseRPForestleaveslevelspointsinnerSSinnerSDinnerDD metricSSL2 metricSDL2scaleDscaleS normalSparse2normal2sparsedensewriteCsvdrawliftCtreeforest dataSource BenchConfig bcDescriptionbcMaxTreeDepth bcMinLeafSize bcNumTrees bcChunkSize bcNZDensity bcVectorDim bcDataSizebcNumQueryPointsrandSeeddatDdatS$fShowBenchConfigknn recallWith candidatesRTMargin cMarginLow cMarginHighRPTError$fSemigroupMarginRPT _rpVectors metricDDL2sumSDsumSSdiffSDdiffSSbinSSpartitionAtMedianRTipRBin_rDataDVdvVecSVsvVecsvDim EmptyResult getMargintoListDvTipBin_rpData_rpR_rpL _rpMargin _rpThresholdrData_rpTreerpDatarpTree rpTreeData/. normalizebinSDsortByVG rsReservoir rsfLookAhrsfW sampleWORreplaceInBufferdenseVGsparseVGResSRSFull RSPartialgenWgenSmixtureN normalDense2BoxedboxedtoCsvRowtoCsvdrawRPT toStringRPTtoBoxtipDatatxtbysidestack