summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Bauer <ulrich.bauer@tum.de>2016-08-04 10:36:30 +0200
committerUlrich Bauer <ulrich.bauer@tum.de>2016-08-04 10:36:30 +0200
commit28cc281ad7a051077fa710406868e875c1476ce5 (patch)
tree524ffec3813bacaaba74f8f2fb028a5016b45aaf
parent3e8f2c31f133e4424f1874ba1ab4ef38237f26ea (diff)
updated readme and comment
-rw-r--r--README.md7
-rw-r--r--ripser.cpp4
2 files changed, 7 insertions, 4 deletions
diff --git a/README.md b/README.md
index f8b7372..71c82fd 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ Ripser supports several compile-time options. They are switched on by defining t
- `ASSEMBLE_REDUCTION_MATRIX`: store the reduction matrix; may speed up computation but will also increase memory usage
- `USE_COEFFICIENTS`: enable support for coefficients in a prime field
- `INDICATE_PROGRESS`: indicate the current progress in the console
- - `PRINT_PERSISTENCE_PAIRS`: output the computed persistence pairs (enabled by default)
+ - `PRINT_PERSISTENCE_PAIRS`: output the computed persistence pairs (enabled by default in the code; comment out to disable)
- `USE_GOOGLE_HASHMAP`: enable support for Google's [sparsehash] data structure; may further reducue memory footprint
Furthermore, one of the following options needs to be chosen to specify the format for the input files:
@@ -62,6 +62,7 @@ Furthermore, one of the following options needs to be chosen to specify the form
- `FILE_FORMAT_LOWER_TRIANGULAR_CSV`: lower triangular distance matrix; a comma (or whitespace, or other non-numerical character) separated list of the distance matrix entries below the diagonal, sorted lexicographically by row index, then column index
- `FILE_FORMAT_UPPER_TRIANGULAR_CSV`: upper triangular distance matrix; similar to the previous, but for the entries above the diagonal; suitable for output from the MATLAB function `pdist`, saved in a CSV file
- `FILE_FORMAT_DIPHA`: DIPHA distance matrix as described on the [DIPHA] website
+ - `FILE_FORMAT_POINT_CLOUD`: point cloud; a comma (or whitespace, or other non-numerical character) separated list of coordinates of the points in some Euclidean space, one point per line
For example, to build with support for coefficients:
@@ -69,6 +70,8 @@ For example, to build with support for coefficients:
$ c++ -std=c++11 ripser.cpp -o ripser -Ofast -D NDEBUG -D FILE_FORMAT_LOWER_TRIANGULAR_CSV -D USE_COEFFICIENTS
```
+A Makefile is provided with some variants of the above options. Use `make all` to build them. The default `make` only builds a binary with the option `FILE_FORMAT_LOWER_TRIANGULAR_CSV`.
+
The following options are supported at the command line:
- `--dim k`: compute persistent homology up to dimension *k*
@@ -87,7 +90,7 @@ The following features are currently planned for future versions:
### License
-[LGPL] 3.0
+Ripser is licensed under the [LGPL] 3.0. Please contact the author if you want to use Ripser in your software under a different license.
[Ulrich Bauer]: <http://ulrich-bauer.org>
diff --git a/ripser.cpp b/ripser.cpp
index c8965f0..d12c3a4 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -87,8 +87,8 @@ std::vector<coefficient_t> multiplicative_inverse_vector(const coefficient_t m)
inverse[1] = 1;
// m = a * (m / a) + m % a
// Multipying with inverse(a) * inverse(m % a):
- // 0 = (m / a) * inverse(m % a) + inverse(a) (mod m)
- for (coefficient_t a = 2; a < m; ++a) inverse[a] = m - ((m / a) * inverse[m % a]) % m;
+ // 0 = inverse(m % a) * (m / a) + inverse(a) (mod m)
+ for (coefficient_t a = 2; a < m; ++a) inverse[a] = m - (inverse[m % a] * (m / a)) % m;
return inverse;
}