Skip to content

Commit baada0d

Browse files
committed
docs: add codeblocks highlight
1 parent 2de6f33 commit baada0d

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PSI is a high-performance parallel library for a collection of spatial indexes,
1414

1515
## Citation
1616
If you use our code, please cite our papers:
17-
```{tex}
17+
```tex
1818
@article{men2025parallel,
1919
title={Parallel kd-tree with Batch Updates},
2020
author={Men, Ziyang and Shen, Zheqi and Gu, Yan and Sun, Yihan},

docs/MANUAL.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Thanks for AI, there is a generally good [wiki](https://deepwiki.com/ucrparlay/S
99
Any contribution is welcomed 🤗!
1010

1111
## File Organization
12-
```{bash}
12+
```bash
1313
include/
1414
├── baselines
1515
│   ├── boost_rtree
@@ -44,7 +44,7 @@ We will take the **Pkd-tree** as an example, other trees are similar.
4444
All source files for examples can be found in the [example/](../example/).
4545

4646
Everything start with the definition of the `Point`:
47-
```{c++}
47+
```c++
4848
// Type for each coordinate
4949
using Coord = long;
5050

@@ -67,7 +67,7 @@ using Point = psi::AugPoint<Coord, 2, AugId>;
6767
```
6868
6969
With `Point`, we can now use all functionalities provided in `Basetree`, e.g.,
70-
```{c++}
70+
```c++
7171
using BT = psi::BaseTree<Point>;
7272
auto box = BT::GetBox(input); // demo code, to get the bounding box for the input
7373
```
@@ -76,7 +76,7 @@ You want to augment some info on the tree nodes, both the leaf nodes, and the in
7676
<details>
7777
<summary>click to expand</summary>
7878

79-
```{c++}
79+
```c++
8080
// Leaf augmentation: stores bounding box
8181
// WARN: All functions must be defined
8282
template <class BaseTree>
@@ -167,7 +167,7 @@ struct InteriorAugBox {
167167
</details>
168168
169169
Of course, as a spatial partition tree, we can choose how to split the space:
170-
```{c++}
170+
```c++
171171
// Define split rule: max stretch dimension + object median
172172
using SplitRule = psi::OrthogonalSplitRule<psi::MaxStretchDim<Point>,
173173
psi::ObjectMedian<Point>>;
@@ -178,36 +178,36 @@ using AnotherSplitRule =
178178
```
179179

180180
Now we can define the tree type with all building blocks above:
181-
```{c++}
181+
```c++
182182
// Define KdTree type
183183
using Tree = psi::KdTree<Point, SplitRule, LeafAugBox<BT>, InteriorAugBox<BT>>;
184184
Tree tree;
185185
```
186186

187187
Then we can use the tree as follows:
188188
- Build the tree:
189-
```{c++}
189+
```c++
190190
Points points;
191191
auto points_copy = points;
192192
tree.Build(points_copy);
193193
```
194194
- Batch Insert:
195-
```{c++}
195+
```c++
196196
Points insert_points;
197197
auto insert_copy = insert_points;
198198
tree.BatchInsert(insert_copy);
199199
```
200200

201201
- Batch Delete (assumes all points to be deleted are in the tree, use `BatchDiff` if you are not sure):
202-
```{c++}
202+
```c++
203203
Points delete_points;
204204
auto delete_copy = delete_points;
205205
tree.BatchDelete(delete_copy);
206206
// tree.BatchDiff(delete_copy);
207207
```
208208

209209
- KNN query
210-
```{c++}
210+
```c++
211211
int K = 10; // K for KNN
212212
Point query_point; // Points to be queried
213213

@@ -222,7 +222,7 @@ tree.KNN(root, query_point, bq); // do the query
222222
```
223223
224224
- Range count and Range query
225-
```{c++}
225+
```c++
226226
typename Tree::Box query_box; // a pair of point
227227
Points range_result(n); // Allocate max possible size
228228
auto [count, logger] =
@@ -235,7 +235,7 @@ A comprehensive example can be found [here](../example/kd_tree.h).
235235
PSI also shipped a parallel data_generator for two distribution of points, namely, the `Uniform` (uniformly spread across a cube) and `Varden` (very skewed).
236236

237237
Usage:
238-
```{bash}
238+
```bash
239239
# In the build
240240
make data_generator
241241
./data_generator -p [output_path] -d [dimension] -n [points_num] -file_num [files_num] -varden [0:uniform, 1:varden]

docs/QUICK_START.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,26 @@ Try:
2626

2727
1. Clone the repository.
2828

29-
```{bash}
29+
```bash
3030
git clone git@github.com:ucrparlay/SpaceTreeLib.git
3131
cd SpaceTreeLib
3232
```
3333

3434
2. Initialize the submodule:
3535

36-
```{bash}
36+
```bash
3737
git submodule update --init
3838
```
3939

4040
3. Compilation (with `Release` and `jemalloc` disabled)
41-
```{bash}
41+
```bash
4242
mkdir build && cd build
4343
cmake -DDEBUG=OFF -DJEMA=OFF ..
4444
make -j
4545
```
4646

4747
4. Run some toy examples:
48-
```{bash}
48+
```bash
4949
./example/run_examples.sh
5050
```
5151

0 commit comments

Comments
 (0)