h$+).      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKNone5678:>?%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 ).Lrp-tree+one random projection vector per tree levelMrp-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 componentsNrp-treeBounds around the cutting planeOrp-treelower bound on the cut pointPrp-tree upper boundQrp-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 indexRrp-tree(Batch (= non-incremental) creation of a MSrp-tree/Batch (= non-incremental) creation of multiple Msrp-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)Trp-tree4Vector distance induced by the L2 norm (dense-dense)Urp-tree Vector sumVrp-tree Vector sumWrp-treeVector differenceXrp-treeVector differenceYrp-treeBinary operation on   sZrp-treesparse * dense -> densee.g. vector sum, difference[rp-tree 1 rp-treemin leaf size,  m_{leaf} > 1rp-treenumber of trees, n_t > 1rp-tree'nonzero density of projection vectors, p_{nz} \in (0, 1)rp-tree!dimension of projection vectors, d > 1rp-treedataset)rp-treenumber of points to generaterp-treerandom point generator'() Safe-Inferredhrp-tree The items a in a  have type prp-tree#Insert a weighted entry in the heaprp-treeCompute the median weightrp-treeweightNone3?!,rp-treemax tree depth l > 1- , fpMinLeafSize :: Int -- ^ min leaf size -rp-treedata chunk size.rp-tree&nonzero density of projection vectors p_{nz} \in (0, 1)0rp-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 result1rp-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 result2rp-treeConfigure the rp-tree tree construction process with some natural defaults3rp-treeSource of random data points0rp-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 source1rp-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 source2rp-tree min leaf sizerp-treenumber of points in the datasetrp-tree#vector dimension of the data points3rp-treenumber of vectors to generaterp-tree*random generator for the vector components *+,-./0123None"T@rp-tree(binary mixture of isotropic Gaussian rvsArp-tree?binary mixture of isotropic Gaussian rvs with sparse components@rp-treenumber of data pointsrp-treevector dimensionArp-treenumber of data pointsrp-treevector dimensionrp-treenonzero density45>=<;:9876?@ANone 58>?(Crp-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) Drp-treeSame as C but based on min-0Leaves are prioritized according to their marginErp-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) Frp-tree$Retrieve points nearest to the query=in case of a narrow margin, collect both branches of the treeHrp-tree&How many data items are stored in the Irp-tree3How many data items are stored in each leaf of the Crp-treedistance functionrp-tree k neighborsrp-treerandom projection forestrp-tree query pointrp-tree7ordered in increasing distance order to the query pointDrp-treedistance functionrp-tree k neighborsrp-treerandom projection forestrp-tree query pointrp-tree7ordered in increasing distance order to the query pointErp-treedistance functionrp-tree+k : number of nearest neighbors to considerrp-tree query pointFrp-tree query point  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI'(012*+,-.CDEFGHIB   %$&456789:;<=> /?)3A@"#!      !"#$%&'()*+,-./0123456789:;<<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstUuvwxyz{|}~e!rp-tree-0.7-GJGvr7XqdZ78ZFwXj05bP Data.RPTreeData.RPTree.InternalData.RPTree.GenData.RPTree.DrawData.RPTree.BatchData.RPTree.Internal.MedianHeapData.RPTree.ConduitData.RPTree.Internal.TestingInnerinnermetricL2^+^^-^Scale.*RPForestRPTreeDVectorSVectorEmbedeEmbedeData fromListSv fromVectorSv fromListDv fromVectorDvserialiseRPForestdeserialiseRPForestleaveslevelspointsinnerSSinnerSDinnerDD metricSSL2 metricSDL2scaleDscaleScircle2d normalSparse2normal2sparsedense knnWriteCsvwriteCsvwriteDot treeBatch forestBatch dataBatch RPTreeConfigRPCfgfpMaxTreeDepthfpDataChunkSizefpProjNzDensityliftCtreeforest rpTreeCfg dataSource BenchConfig bcDescriptionbcMaxTreeDepth bcMinLeafSize bcNumTrees bcChunkSize bcNZDensity bcVectorDim bcDataSizebcNumQueryPointsrandSeeddatDdatS RPTreeStatsknnknnH recallWith candidates treeStatstreeSize leafSizes$fEqRPTreeStats$fShowRPTreeStats _rpVectorsRPTMargin cMarginLow cMarginHighRPTErrorcreate createMulti metricDDL2sumSDsumSSdiffSDdiffSSbinSSbinSDDpartitionAtMedian$fSemigroupMargin insertMultiinsertVE_rpTreeTipBin_rpData_rpR_rpL _rpMargin _rpThreshold_rpLabelDVdvVecSVsvVecsvDim EmptyResult getMargintoListDv/. normalizesortByVG rsReservoir rsfLookAhrsfW sampleWORreplaceInBufferdenseVGsparseVGResSRSFull RSPartialgenWgenSmixtureN normalDense2 MedianHeapmedianfromList heaps-0.4-50MzWopeGAz8Qgc4olzEfa Data.HeapHeap