h$$"e      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGNone5678:>? #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-treeRandom projection treesThe first type parameter corresponds to a floating point scalar value, the second labels every tree part (e.g. for visual rendering) and the third 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 (Bi-)Functor instance for postprocessing and visualization.This implementation uses one projection vector per tree level (as suggested in  9https://www.cs.helsinki.fi/u/ttonteri/pub/bigdata2016.pdf ).Hrp-tree+one random projection vector per tree levelIrp-treeInternal6one projection vector per tree level (as suggested in  9https://www.cs.helsinki.fi/u/ttonteri/pub/bigdata2016.pdf ) rp-tree%Dense vectors with unboxed components rp-tree&Sparse vectors with unboxed componentsJrp-treeBounds around the cutting planeKrp-treelower bound on the cut pointLrp-tree upper boundMrp-tree Exceptions rp-tree0Pairing of a data item with its vector embedding*The vector is used internally for indexing rp-treevector embeddingrp-tree data itemrp-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 indexrp-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 indexrp-treeSerialise each tree in the  as a separate bytestringrp-treeDeserialise each tree in the + from a separate bytestring and reconstructrp-tree1All data buckets stored at the leaves of the treerp-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)Nrp-tree4Vector distance induced by the L2 norm (dense-dense)Orp-tree Vector sumPrp-tree Vector sumQrp-treeVector differenceRrp-treeVector differenceSrp-treeBinary operation on   sTrp-treesparse * dense -> densee.g. vector sum, differenceUrp-tree 1- , fpMinLeafSize :: Int -- ^ min leaf size )rp-treedata chunk size*rp-tree&nonzero density of projection vectors p_{nz} \in (0, 1),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 result-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 result.rp-treeConfigure the rp-tree tree construction process with some natural defaults/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 depth, l > 1 rp-treemin leaf size,  m_{leaf} > 1rp-treenumber of trees, n_t > 1rp-treedata chunk size,  n_{chunk} > 3rp-tree'nonzero density of projection vectors, p_{nz} \in (0, 1)rp-tree!dimension of projection vectors, d > 1rp-tree data source.rp-tree min leaf sizerp-treenumber of points in the datasetrp-tree#vector dimension of the data points/rp-treenumber of vectors to generaterp-tree*random generator for the vector components &'()*+,-./None<rp-tree(binary mixture of isotropic Gaussian rvs=rp-tree?binary mixture of isotropic Gaussian rvs with sparse components<rp-treenumber of data pointsrp-treevector dimension=rp-treenumber of data pointsrp-treevector dimensionrp-treenonzero density01:98765432;<=None 58>?!?rp-tree Look up the k# nearest neighbors to a query pointThe supplied distance function d. must satisfy the definition of a metric, i.e.%identity of indiscernible elements : ( d(x, y) = 0 \leftrightarrow x \equiv y  symmetry :  d(x, y) = d(y, x) triangle inequality :  d(x, y) + d(y, z) \geq d(x, z) @rp-treeSame as ? but based on | FIXME uses } internally so might be slowArp-tree1Average recall-at-k, computed over a set of treesThe supplied distance function d. must satisfy the definition of a metric, i.e.%identity of indiscernible elements : ( d(x, y) = 0 \leftrightarrow x \equiv y  symmetry :  d(x, y) = d(y, x) triangle inequality :  d(x, y) + d(y, z) \geq d(x, z) Brp-tree$Retrieve points nearest to the query=in case of a narrow margin, collect both branches of the treeDrp-tree&How many data items are stored in the Erp-tree3How many data items are stored in each leaf of the ?rp-treedistance functionrp-tree k neighborsrp-treerandom projection forestrp-tree query pointrp-tree7ordered in increasing distance order to the query point@rp-treedistance functionrp-tree k neighborsrp-treerandom projection forestrp-tree query pointrp-tree7ordered in increasing distance order to the query pointArp-treedistance functionrp-tree+k : number of nearest neighbors to considerrp-tree query pointBrp-tree query point  !"#$%&'()*+,-./0123456789:;<=>?@ABCDE,-.&'()*?@ABCDE>   $%0123456789: +;/=<"#!      !"#$%&'()*+,-./01234566789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijOklmnopqrstuvwxyz{|}~"rp-tree-0.6-HhVugFEcI57HongslUcGg5 Data.RPTreeData.RPTree.InternalData.RPTree.GenData.RPTree.DrawData.RPTree.ConduitData.RPTree.Internal.TestingInnerinnermetricL2^+^^-^Scale.*RPForestRPTreeDVectorSVectorEmbedeEmbedeData fromListSv fromVectorSv fromListDv fromVectorDvserialiseRPForestdeserialiseRPForestleaveslevelspointsinnerSSinnerSDinnerDD metricSSL2 metricSDL2scaleDscaleScircle2d normalSparse2normal2sparsedensewriteCsvwriteDot RPTreeConfigRPCfgfpMaxTreeDepthfpDataChunkSizefpProjNzDensityliftCtreeforest rpTreeCfg dataSource BenchConfig bcDescriptionbcMaxTreeDepth bcMinLeafSize bcNumTrees bcChunkSize bcNZDensity bcVectorDim bcDataSizebcNumQueryPointsrandSeeddatDdatS RPTreeStatsknnknnPQ recallWith candidates treeStatstreeSize leafSizes$fEqRPTreeStats$fShowRPTreeStats _rpVectorsRPTMargin cMarginLow cMarginHighRPTError metricDDL2sumSDsumSSdiffSDdiffSSbinSSbinSDDpartitionAtMedian$fSemigroupMarginVE_rpTreeTipBin_rpData_rpR_rpL _rpMargin _rpThreshold_rpLabelDVdvVecSVsvVecsvDim EmptyResult getMargintoListDv/. normalizesortByVG rsReservoir rsfLookAhrsfW sampleWORreplaceInBufferdenseVGsparseVGResSRSFull RSPartialgenWgenSmixtureN normalDense2 heaps-0.4-50MzWopeGAz8Qgc4olzEfa Data.HeapHeapnub