G      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFNone0A k--d tree structure that stores points of type p with axis values of type a?. Additionally, each point is associated with a value of type v.9Returns the squared distance between two points of type p with axis values of type a.Converts a point of type p with axis values of type a into a list of axis values [a].3Performs a foldr over each point-value pair in the .Builds an empty .Builds an empty 3 using a user-specified squared distance function.Returns G if the given  is empty. Builds a P with a single point-value pair and a user-specified squared distance function. Builds a  with a single point-value pair.  Builds a w from a list of pairs of points (of type p) and values (of type v), using a user-specified squared distance function.Average time complexity:  O(n * log(n)) for n data points.Worst case time complexity: O(n^2) for n data points.Worst case space complexity: O(n) for n data points. EA default implementation of squared distance given two points and a .  Builds a KdTreeo from a list of pairs of points (of type p) and values (of type v) using a default squared distance function  .Average complexity:  O(n * log(n)) for n data points.Worst case time complexity: O(n^2) for n data points.Worst case space complexity: O(n) for n data points. "Inserts a point-value pair into a . This can potentially cause the internal tree structure to become unbalanced. If the tree becomes too unbalanced, point queries will be very inefficient. If you need to perform lots of point insertions on an already existing k-d map, check out Data.KdMap.Dynamic..Average complexity:  O(log(n)) for n data points.Worst case time complexity: O(n) for n data points. +Inserts a list of point-value pairs into a z. This can potentially cause the internal tree structure to become unbalanced, which leads to inefficient point queries.Average complexity:  O(n * log(n)) for n data points.Worst case time complexity: O(n^2) for n data points.3Returns a list of all the point-value pairs in the .Time complexity: O(n) for n data points.Returns all points in the .Time complexity: O(n) for n data points.Returns all values in the .Time complexity: O(n) for n data points.Given a 9 and a query point, returns the point-value pair in the % with the point nearest to the query.Average time complexity:  O(log(n)) for n data points.Worst case time complexity: O(n) for n data points.#Throws error if called on an empty .Given a E, a query point, and a radius, returns all point-value pairs in the 9 with points within the given radius of the query point.0Points are not returned in any particular order.Worst case time complexity: O(n) for nB data points and a radius that spans all points in the structure.Given a , a query point, and a number k, returns the k9 point-value pairs with the nearest points to the query.INeighbors are returned in order of increasing distance from query point.Average time complexity: log(k) * log(n) for k( nearest neighbors on a structure with n data points.Worst case time complexity:  n * log(k) for k( nearest neighbors on a structure with n data points.!Finds all point-value pairs in a e with points within a given range, where the range is specified as a set of lower and upper bounds.0Points are not returned in any particular order.Worst case time complexity: O(n): for n data points and a range that spans all the points.TODO: Maybe use known bounds on entire tree structure to be able to automatically count whole portions of tree as being within given range./Returns the number of point-value pairs in the .Time complexity: O(1)Returns GM if tree structure adheres to k-d tree properties. For internal testing use./HIJKLMNOPQRSTUVW Xradius query pointClist of point-value pairs with points within given radius of querylower bounds of rangeupper bounds of range%point-value pairs within given rangeYZ[\]^_   $HIJKLMONPQRSTUVW XYZ[\]^_None0A k--d tree structure that stores points of type p with axis values of type a.Builds an empty .Builds an empty 3 using a user-specified squared distance function. Builds a  with a single point. Builds a G with a single point using a user-specified squared distance function. Builds a G from a list of data points using a default squared distance function  .Average complexity:  O(n * log(n)) for n data points.Worst case time complexity: O(n^2) for n data points.Worst case space complexity: O(n) for n data points. Builds a N from a list of data points using a user-specified squared distance function.Average time complexity:  O(n * log(n)) for n data points.Worst case time complexity: O(n^2) for n data points.Worst case space complexity: O(n) for n data points.Inserts a point into a . This can potentially cause the internal tree structure to become unbalanced. If the tree becomes too unbalanced, point queries will be very inefficient. If you need to perform lots of point insertions on an already existing k-d tree, check out Data.KdTree.Dynamic..Average complexity:  O(log(n)) for n data points.Worse case time complexity: O(n) for n data points.  Inserts a list of points into a z. This can potentially cause the internal tree structure to become unbalanced, which leads to inefficient point queries.Average complexity:  O(n * log(n)) for n data points.Worst case time complexity: O(n^2) for n data points.!Given a 6 and a query point, returns the nearest point in the  to the query point.Average time complexity:  O(log(n)) for n data points.Worst case time complexity: O(n) for n data points.&Throws an error if called on an empty ."Given a :, a query point, and a radius, returns all points in the 6 that are within the given radius of the query point.0Points are not returned in any particular order.Worst case time complexity: O(n) for nE data points and a radius that subsumes all points in the structure.#Given a , a query point, and a number k, returns the k nearest points in the  to the query point.INeighbors are returned in order of increasing distance from query point.Average time complexity: log(k) * log(n) for k( nearest neighbors on a structure with n data points.Worst case time complexity:  n * log(k) for k( nearest neighbors on a structure with n data points.$Finds all points in a d with points within a given range, where the range is specified as a set of lower and upper bounds.0Points are not returned in any particular order.Worst case time complexity: O(n): for n data points and a range that spans all the points.%(Returns a list of all the points in the .Time complexity: O(n) for n data points.&&Returns the number of elements in the .Time complexity: O(1)`2non-empty list of data points to be stored in the k-d tree !"radius query point8list of points in tree with given radius of query point#$lower bounds of rangeupper bounds of rangeall points within given range%&abc  !"#$%& !"#$%& ` !"#$%&abcNone0' A dynamic k--d tree structure that stores points of type p with axis values of type a?. Additionally, each point is associated with a value of type v.(3Performs a foldr over each point-value pair in the '.)Generates an empty ') with a user-specified distance function.*Returns whether the ' is empty.+ Generates a 'J with a single point-value pair using a user-specified distance function.,Generates an empty '$ with the default distance function.- Generates a 'E with a single point-value pair using the default distance function..#Adds a given point-value pair to a '.'Average time complexity per insert for n inserts:  O(log^2(n))./Same as .&, but takes point and value as a pair.0Given a '9 and a query point, returns the point-value pair in the '% with the point nearest to the query.Average time complexity:  O(log^2(n)).1Given a ', a query point, and a number k, returns the k8 point-value pairs with the nearest points to the query.INeighbors are returned in order of increasing distance from query point.Average time complexity: log(k) * log^2(n) for k( nearest neighbors on a structure with n data points.Worst case time complexity:  n * log(k) for k( nearest neighbors on a structure with n data points.2Given a 'E, a query point, and a radius, returns all point-value pairs in the KdTree9 with points within the given radius of the query point.0Points are not returned in any particular order.Worst case time complexity: O(n) for n data points.3!Finds all point-value pairs in a 'e with points within a given range, where the range is specified as a set of lower and upper bounds.0Points are not returned in any particular order.Worst case time complexity: O(n): for n data points and a range that spans all the points.4&Returns the number of elements in the '.Time complexity: O(1)53Returns a list of all the point-value pairs in the '.Time complexity: O(n) for n data points.6Returns all points in the '.Time complexity: O(n) for n data points.7Returns all values in the '.Time complexity: O(n) for n data points.8-Inserts a list of point-value pairs into the '.MTODO: This will be made far more efficient than simply repeatedly inserting.9Returns size of each internal kG-d tree that makes up the dynamic structure. For internal testing use.'defgh()*+,-./0123lower bounds of rangeupper bounds of range%point-value pairs within given range456789ijklm '()*+,-./0123456789',-)+./80213567*4( 9'defgh()*+,-./0123456789ijklmNone : A dynamic k--d tree structure that stores points of type p with axis values of type a.;Generates an empty :) with a user-specified distance function.<Generates an empty :$ with the default distance function.=Returns whether the : is empty.> Generates a :? with a single point using a user-specified distance function.? Generates a :: with a single point using the default distance function.@Adds a given point to a :.'Average time complexity per insert for n inserts:  O(log^2(n)).AGiven a :6 and a query point, returns the nearest point in the : to the query point.Average time complexity:  O(log^2(n)).BGiven a :, a query point, and a number k, returns the k nearest points in the : to the query point.INeighbors are returned in order of increasing distance from query point.Average time complexity: log(k) * log^2(n) for k( nearest neighbors on a structure with n data points.Worst case time complexity:  n * log(k) for k( nearest neighbors on a structure with n data points.CGiven a ::, a query point, and a radius, returns all points in the :7 that are within the given radius of the query points.0Points are not returned in any particular order.Worst case time complexity: O(n) for n data points.DFinds all points in a :d with points within a given range, where the range is specified as a set of lower and upper bounds.0Points are not returned in any particular order.Worst case time complexity: O(n): for n data points and a range that spans all the points.E&Returns the number of elements in the :.Time complexity: O(1)F(Returns a list of all the points in the :.Time complexity: O(n):n;<=>?@ABCDlower bounds of rangeupper bounds of rangeall points within given rangeEFop :;<=>?@ABCDEF:<?;>@ACBDF=E :n;<=>?@ABCDEFopq               !    "#$%&'()*)+,-./0123456789:;<=>%&?56789<;@ kdt-0.2.0Data.KdMap.StaticData.KdTree.StaticData.KdMap.DynamicData.KdTree.DynamicKdMapKdTreeSquaredDistanceFn PointAsListFn foldrWithKeyempty emptyWithDistnullsingletonWithDist singleton buildWithDistdefaultSqrDistbuildinsertUnbalancedbatchInsertUnbalancedassocskeyselemsnearestinRadiuskNearestinRangesizeisValidtoListinsert insertPair batchInsert subtreeSizesghc-prim GHC.TypesTrue _pointAsList_distSqr _rootNode_sizeTreeNodeEmpty _treeLeft _treePoint _axisValue _treeRight mapTreeNode foldrTreeNodetraverseTreeNode quickselectassocsInternalisTreeNodeValid$fTraversableKdMap$fFoldableKdMap$fFunctorKdMap $fShowKdMap $fNFDataKdMap$fNFDataTreeNode$fFoldableKdTree $fShowKdTree$fNFDataKdTree_trees _numNodes