Skip to content

Commit 362e2b1

Browse files
PatrickNortonJojo-Schmitz
authored andcommitted
Updated README
1 parent c869903 commit 362e2b1

File tree

1 file changed

+24
-28
lines changed

1 file changed

+24
-28
lines changed

thirdparty/intervaltree/README

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
1-
Overview:
1+
# intervaltree
22

3-
An interval tree can be used to efficiently find a set of numeric
4-
intervals overlapping or containing another interval.
3+
## Overview
54

6-
This library provides a basic implementation of an interval tree using
7-
C++ templates, allowing the insertion of arbitrary types into the
8-
tree.
5+
An interval tree can be used to efficiently find a set of numeric intervals overlapping or containing another interval.
96

7+
This library provides a basic implementation of an interval tree using C++ templates, allowing the insertion of arbitrary types into the tree.
108

11-
Usage:
9+
## Usage
1210

13-
Add #include "IntervalTree.h" to the source files in which you will
14-
use the interval tree.
11+
Add `#include "IntervalTree.h"` to the source files in which you will use the interval tree.
1512

1613
To make an IntervalTree to contain objects of class T, use:
1714

18-
vector<Interval<T> > intervals;
19-
T a, b, c;
20-
intervals.push_back(Interval<T>(2, 10, a));
21-
intervals.push_back(Interval<T>(3, 4, b));
22-
intervals.push_back(Interval<T>(20, 100, c));
23-
IntervalTree<T> tree;
24-
tree = IntervalTree<T>(intervals);
15+
```c++
16+
vector<Interval<T> > intervals;
17+
T a, b, c;
18+
intervals.push_back(Interval<T>(2, 10, a));
19+
intervals.push_back(Interval<T>(3, 4, b));
20+
intervals.push_back(Interval<T>(20, 100, c));
21+
IntervalTree<T> tree;
22+
tree = IntervalTree<T>(intervals);
23+
```
2524

26-
Now, it's possible to query the tree and obtain a set of intervals
27-
which are contained within the start and stop coordinates.
25+
Now, it's possible to query the tree and obtain a set of intervals which are contained within the start and stop coordinates.
2826

29-
vector<Interval<T> > results;
30-
tree.findContained(start, stop, results);
31-
cout << "found " << results.size()
32-
<< " overlapping intervals" << endl;
27+
```c++
28+
vector<Interval<T> > results;
29+
tree.findContained(start, stop, results);
30+
cout << "found " << results.size() << " overlapping intervals" << endl;
31+
```
3332

34-
The function IntervalTree::findOverlapping provides a method to find
35-
all those intervals which are contained or partially overlap the
36-
interval (start, stop).
33+
The function IntervalTree::findOverlapping provides a method to find all those intervals which are contained or partially overlap the interval (start, stop).
3734

35+
### Author: Erik Garrison <[email protected]>
3836

39-
Author: Erik Garrison <[email protected]>
40-
41-
License: MIT
37+
### License: MIT

0 commit comments

Comments
 (0)