Changeset 37231 in project


Ignore:
Timestamp:
02/12/19 15:32:29 (8 months ago)
Author:
Ivan Raikov
Message:

markup fixes in kd-tree doc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/kd-tree

    r37230 r37231  
    2727=== K-dimensional point space
    2828
    29 Module <code>kspace</code> provides facilities for managament of K-dimensional point spaces.
     29Module {{kspace}} provides facilities for managament of K-dimensional point spaces.
    3030
    31 <procedure>
    32 make-space:: COORDS -&gt; SPACE
    33 </procedure>
     31<procedure>make-space:: COORDS -> SPACE</procedure>
    3432
    3533Given a list of coordinate collections of length K, constructs a yasos
     
    3836collections module.
    3937
    40 <procedure>
    41 space? :: OBJECT -&gt; BOOL
    42 </procedure>
     38<procedure>space? :: OBJECT -> BOOL</procedure>
    4339K-dimensional point space predicate.
    4440
    45 <procedure>
    46 dimension :: OBJECT -&gt; INT
    47 </procedure>
     41<procedure>dimension :: OBJECT -> INT</procedure>
    4842Returns the dimensionality of the point space.
    4943
    50 <procedure>
    51 point :: OBJECT * INT -&gt; REAL LIST
    52 </procedure>
     44<procedure>point :: OBJECT * INT -> REAL LIST</procedure>
    5345Returns the coordinates of the point at the given index.
    5446
    55 <procedure>
    56 coord :: OBJECT * INT * INT -&gt; FLOAT
    57 </procedure>
     47<procedure>coord :: OBJECT * INT * INT -> FLOAT</procedure>
    5848Returns the k'th coordinate of i'th point, starting from 0.
    5949
    60 <procedure>
    61 compare-coord :: SPACE * INT * INT * INT -&gt; INT
    62 </procedure>
     50<procedure>compare-coord :: SPACE * INT * INT * INT -> INT</procedure>
    6351Given the indices of two points and a coordinate index, compares the respective coordinates of the two points and returns -1, 0, or 1, depending on whether the coordinates are less than, equal, or greater than each other.
    6452
    65 <procedure>
    66 squared-distance :: SPACE * INT * INT -&gt; FLOAT
    67 </procedure>
     53<procedure>squared-distance :: SPACE * INT * INT -> FLOAT</procedure>
    6854Returns the square of the Euclidean distance between the points at the given indices.
    6955
    70 <procedure>
    71 compare-distance :: SPACE * INT * INT -&gt; INT
    72 </procedure>
     56<procedure>compare-distance :: SPACE * INT * INT -> INT</procedure>
    7357Compares the square of the Euclidean distance between the points at the given indices.
    7458
     
    7761==== Constructors
    7862
    79 <procedure>
    80 make-kd-tree:: SPACE -&gt; OBJECT
    81 </procedure>
    82 Given a <code>kspace</code> object, constructs and returns a yasos spatial map object.
     63<procedure>make-kd-tree:: SPACE -> OBJECT</procedure>
     64Given a {{kspace}} object, constructs and returns a yasos spatial map object.
    8365
    8466==== Predicates
    8567
    86 <procedure>
    87 spatial-map? :: OBJECT -&gt; BOOL
    88 </procedure>
    89 Returns <code>#t</code> if the given object is a spatial map, <code>#f</code> otherwise.
     68<procedure>spatial-map? :: OBJECT -> BOOL</procedure>
     69Returns {{#t}} if the given object is a spatial map, {{#f}} otherwise.
    9070
    91 <procedure>
    92 empty? :: OBJECT -&gt; BOOL
    93 </procedure>
    94 Returns <code>#t</code> if the given spatial map object is empty, <code>#f</code> otherwise.
     71<procedure>empty? :: OBJECT -> BOOL</procedure>
     72Returns {{#t}} if the given spatial map object is empty, {{#f}} otherwise.
    9573
    96 <procedure>
    97 kd-tree-is-valid? :: OBJECT -&gt; BOOL
    98 </procedure>
     74<procedure>kd-tree-is-valid? :: OBJECT -> BOOL</procedure>
    9975Checks whether the K-D tree property holds for the given spatial map. Specifically, it tests that all points in the left subtree lie to the left of the plane, p is on the plane, and all points in the right subtree lie to the right.
    10076
    101 <procedure>
    102 kd-tree-all-subtrees-are-valid? :: KD-TREE -&gt; BOOL
    103 </procedure>
     77<procedure>kd-tree-all-subtrees-are-valid? :: KD-TREE -> BOOL</procedure>
    10478Checks whether the K-D tree property holds for the given spatial map and all subtrees.
    10579
    10680==== Accessors
    10781
    108 <procedure>
    109 get-kspace :: OBJECT -&gt; KSPACE
    110 </procedure>
    111 Returns the underlying <code>kspace</code> object of the map.
     82<procedure>get-kspace :: OBJECT -> KSPACE</procedure>
     83Returns the underlying {{kspace}} object of the map.
    11284
    113 <procedure>
    114 spatial-map-&gt;list :: KD-TREE -&gt; POINT LIST
    115 </procedure>
     85<procedure>spatial-map->list :: KD-TREE -> POINT LIST</procedure>
    11686Returns a list with the points contained in the spatial map.
    11787
    11888==== Query procedures
    11989
    120 <procedure>
    121 nearest-neighbor :: SPATIAL-MAP * POINT -&gt; POINT
    122 </procedure>
     90<procedure>nearest-neighbor :: SPATIAL-MAP * POINT -> POINT</procedure>
    12391Nearest neighbor of a point.
    12492
    125 <procedure>
    126 near-neighbors :: SPATIAL-MAP * POINT * RADIUS -&gt; POINT LIST
    127 </procedure>
     93<procedure>near-neighbors :: SPATIAL-MAP * POINT * RADIUS -> POINT LIST</procedure>
    12894Neighbors of a point within radius r.
    12995
    130 <procedure>
    131 k-nearest-neighbors :: SPATIAL-MAP * POINT * INT -&gt; POINT LIST
    132 </procedure>
     96<procedure>k-nearest-neighbors :: SPATIAL-MAP * POINT * INT -> POINT LIST</procedure>
    13397K nearest neighbors of a point.
    13498
    135 <procedure>
    136 slice :: SPATIAL-MAP * AXIS * COORD * COORD -&gt; POINT LIST
    137 </procedure>
     99<procedure>slice :: SPATIAL-MAP * AXIS * COORD * COORD -> POINT LIST</procedure>
    138100Returns all points between two planes.
    139101
    140102==== Combinators
    141103
    142 <procedure>
    143 spatial-map-for-each :: SPATIAL-MAP * F -&gt; VOID
    144 </procedure>
     104<procedure>spatial-map-for-each :: SPATIAL-MAP * F -> VOID</procedure>
    145105Point iterator.
    146106
    147 <procedure>
    148 spatial-map-fold :: SPATIAL-MAP * F -&gt; AX
    149 </procedure>
    150 <procedure>
    151 spatial-map-fold-right :: SPATIAL-MAP * F * INIT -&gt; INIT
    152 </procedure>
     107<procedure>spatial-map-fold-right :: SPATIAL-MAP * F * INIT -> INIT</procedure>
    153108Fold on points.
    154109
    155 <procedure>
    156 spatial-map-fold-right* :: SPATIAL-MAP * F * INIT -&gt; INIT
    157 </procedure>
     110<procedure>spatial-map-fold-right* :: SPATIAL-MAP * F * INIT -> INIT</procedure>
    158111Fold on points and their indices.
    159112
    160 ==== Modifiers ====
     113==== Modifiers
    161114
    162 <procedure>
    163 kd-tree-remove :: SPATIAL-MAP * POINT -&gt; SPATIAL-MAP
    164 </procedure>
     115<procedure>kd-tree-remove :: SPATIAL-MAP * POINT -> SPATIAL-MAP</procedure>
    165116
    166117== Examples
     
    196147</enscript>
    197148
    198 == Version history ==
     149== Version history
    199150
    200151* 6.0 : refactored to use yasos, ported to CHICKEN 5
    201 * 5.0 : added list-&gt;kd-tree* procedure to KdTree class
     152* 5.0 : added list->kd-tree* procedure to KdTree class
    202153* 4.1-4.8 : Using f64vector for internal point representation
    203154* 4.0-4.1 : Added with-distance? flag to kd-tree-near-neighbors
Note: See TracChangeset for help on using the changeset viewer.