Skip to content

Commit

Permalink
Merge branch 'GUDHI:master' into simplex_tree_filtration_value_genera…
Browse files Browse the repository at this point in the history
…lization
  • Loading branch information
hschreiber authored Nov 27, 2024
2 parents bcdad85 + 7bd2ecc commit b202391
Show file tree
Hide file tree
Showing 8 changed files with 288 additions and 47 deletions.
30 changes: 15 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
examples:
docker:
# cf. https://github.com/GUDHI/gudhi-deploy/blob/main/Dockerfile_for_circleci_image
- image: gudhi/ci_for_gudhi:2024.09.01
- image: gudhi/ci_for_gudhi:2024.10.01
steps:
- checkout
- run:
Expand All @@ -24,7 +24,7 @@ jobs:
tests:
docker:
- image: gudhi/ci_for_gudhi:2024.09.01
- image: gudhi/ci_for_gudhi:2024.10.01
steps:
- checkout
- run:
Expand All @@ -43,7 +43,7 @@ jobs:
debug_tests:
docker:
- image: gudhi/ci_for_gudhi:2024.09.01
- image: gudhi/ci_for_gudhi:2024.10.01
steps:
- checkout
- run:
Expand All @@ -62,7 +62,7 @@ jobs:
utils:
docker:
- image: gudhi/ci_for_gudhi:2024.09.01
- image: gudhi/ci_for_gudhi:2024.10.01
steps:
- checkout
- run:
Expand All @@ -81,7 +81,7 @@ jobs:
python:
docker:
- image: gudhi/ci_for_gudhi:2024.09.01
- image: gudhi/ci_for_gudhi:2024.10.01
resource_class: large # Delaunay complex requires about 5 Gb of RAM to compile
steps:
- checkout
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:

doxygen:
docker:
- image: gudhi/doxygen_for_gudhi:2024.06.01
- image: gudhi/doxygen_for_gudhi:2024.10.01
steps:
- checkout
- run:
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:

bibliography:
docker:
- image: gudhi/doxygen_for_gudhi:2024.06.01
- image: gudhi/doxygen_for_gudhi:2024.10.01
steps:
- checkout
- run:
Expand All @@ -170,7 +170,7 @@ jobs:
examples_without_cgal_eigen:
docker:
# cf. https://github.com/GUDHI/gudhi-deploy/blob/main/Dockerfile_for_circleci_image_without_cgal
- image: gudhi/ci_for_gudhi_wo_cgal:2024.06.01
- image: gudhi/ci_for_gudhi_wo_cgal:2024.10.01
steps:
- checkout
- run:
Expand All @@ -189,7 +189,7 @@ jobs:
tests_without_cgal_eigen:
docker:
- image: gudhi/ci_for_gudhi_wo_cgal:2024.06.01
- image: gudhi/ci_for_gudhi_wo_cgal:2024.10.01
steps:
- checkout
- run:
Expand All @@ -208,7 +208,7 @@ jobs:
utils_without_cgal_eigen:
docker:
- image: gudhi/ci_for_gudhi_wo_cgal:2024.06.01
- image: gudhi/ci_for_gudhi_wo_cgal:2024.10.01
steps:
- checkout
- run:
Expand All @@ -227,7 +227,7 @@ jobs:
python_without_cgal_eigen:
docker:
- image: gudhi/ci_for_gudhi_wo_cgal:2024.06.01
- image: gudhi/ci_for_gudhi_wo_cgal:2024.10.01
steps:
- checkout
- run:
Expand All @@ -249,7 +249,7 @@ jobs:

examples_without_cgal:
docker:
- image: gudhi/ci_for_gudhi_wo_cgal:2024.06.01
- image: gudhi/ci_for_gudhi_wo_cgal:2024.10.01
steps:
- checkout
- run:
Expand All @@ -268,7 +268,7 @@ jobs:
tests_without_cgal:
docker:
- image: gudhi/ci_for_gudhi_wo_cgal:2024.06.01
- image: gudhi/ci_for_gudhi_wo_cgal:2024.10.01
steps:
- checkout
- run:
Expand All @@ -287,7 +287,7 @@ jobs:
utils_without_cgal:
docker:
- image: gudhi/ci_for_gudhi_wo_cgal:2024.06.01
- image: gudhi/ci_for_gudhi_wo_cgal:2024.10.01
steps:
- checkout
- run:
Expand All @@ -306,7 +306,7 @@ jobs:
python_without_cgal:
docker:
- image: gudhi/ci_for_gudhi_wo_cgal:2024.06.01
- image: gudhi/ci_for_gudhi_wo_cgal:2024.10.01
steps:
- checkout
- run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pip-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: build pip wheel
runs-on: ubuntu-latest
# cf. https://github.com/GUDHI/gudhi-deploy/blob/main/Dockerfile_for_pip
container: gudhi/pip_for_gudhi:2024.06.02
container: gudhi/pip_for_gudhi:2024.10.02
steps:
# Should use actions/checkout@v4, but requires node20, not available for quay.io/pypa/manylinux2014_x86_64
- uses: actions/checkout@v3
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/pip-packaging-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: build pip wheel
runs-on: ubuntu-latest
# cf. https://github.com/GUDHI/gudhi-deploy/blob/main/Dockerfile_for_pip
container: gudhi/pip_for_gudhi:2024.06.02
container: gudhi/pip_for_gudhi:2024.10.02
steps:
# Should use actions/checkout@v4, but requires node20, not available for quay.io/pypa/manylinux2014_x86_64
- uses: actions/checkout@v3
Expand Down Expand Up @@ -111,6 +111,24 @@ jobs:
$PYTHON312/bin/python -m pytest -v src/python/test/test_bottleneck_distance.py
$PYTHON312/bin/python -m pytest -v src/python/test/test_cubical_complex.py
$PYTHON312/bin/python -m pytest -v src/python/test/test_rips_complex.py
- name: Build wheel for Python 3.13
run: |
mkdir build_313
cd build_313
cmake -DCMAKE_BUILD_TYPE=Release -DPython_EXECUTABLE=$PYTHON313/bin/python ..
cd src/python
$PYTHON313/bin/python -m build -n -w
auditwheel repair dist/*.whl
- name: Install and test wheel for Python 3.13
run: |
$PYTHON313/bin/python -m pip install --user pytest build_313/src/python/dist/*.whl
$PYTHON313/bin/python -m pip install numpy~=1.26.0
$PYTHON313/bin/python -c "import gudhi; print(gudhi.__version__)"
$PYTHON313/bin/python -m pytest -v src/python/test/test_alpha_complex.py
$PYTHON313/bin/python -m pytest -v src/python/test/test_delaunay_complex.py
$PYTHON313/bin/python -m pytest -v src/python/test/test_bottleneck_distance.py
$PYTHON313/bin/python -m pytest -v src/python/test/test_cubical_complex.py
$PYTHON313/bin/python -m pytest -v src/python/test/test_rips_complex.py
- name: Publish on PyPi
env:
TWINE_USERNAME: __token__
Expand All @@ -121,3 +139,4 @@ jobs:
$PYTHON38/bin/python -m twine upload build_310/src/python/wheelhouse/*.whl
$PYTHON38/bin/python -m twine upload build_311/src/python/wheelhouse/*.whl
$PYTHON38/bin/python -m twine upload build_312/src/python/wheelhouse/*.whl
$PYTHON38/bin/python -m twine upload build_313/src/python/wheelhouse/*.whl
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@

[![OSx and Win on Azure](https://dev.azure.com/GUDHI/gudhi-devel/_apis/build/status/GUDHI.gudhi-devel?branchName=master)](https://dev.azure.com/GUDHI/gudhi-devel/_build/latest?definitionId=1&branchName=master)
[![Linux on CircleCI](https://circleci.com/gh/GUDHI/gudhi-devel/tree/master.svg?style=svg)](https://circleci.com/gh/GUDHI/gudhi-devel/tree/master)
[![Anaconda Cloud](https://anaconda.org/conda-forge/gudhi/badges/version.svg)](https://anaconda.org/conda-forge/gudhi)
[![Anaconda downloads](https://anaconda.org/conda-forge/gudhi/badges/downloads.svg)](https://anaconda.org/conda-forge/gudhi)

| [![OSx and Win on Azure](https://dev.azure.com/GUDHI/gudhi-devel/_apis/build/status/GUDHI.gudhi-devel?branchName=master)](https://dev.azure.com/GUDHI/gudhi-devel/_build/latest?definitionId=1&branchName=master) [![Linux on CircleCI](https://circleci.com/gh/GUDHI/gudhi-devel/tree/master.svg?style=svg)](https://circleci.com/gh/GUDHI/gudhi-devel/tree/master) | [![Anaconda Cloud](https://anaconda.org/conda-forge/gudhi/badges/version.svg)](https://anaconda.org/conda-forge/gudhi) ![Conda Downloads](https://img.shields.io/conda/d/conda-forge/gudhi) | ![PyPI - Version](https://img.shields.io/pypi/v/gudhi) ![PyPI - Downloads](https://img.shields.io/pypi/dm/gudhi) |
| --- | --- | --- |

![GUDHI](src/common/doc/Gudhi_banner.png "Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding")

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
timeoutInMinutes: 0
cancelTimeoutInMinutes: 60
pool:
vmImage: macOS-latest
vmImage: macOS-13
variables:
pythonVersion: "3.9"
cmakeBuildType: Release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,24 +913,28 @@ inline void Chain_matrix<Master_matrix>::print() const
{
std::cout << "Column Matrix:\n";
if constexpr (!Master_matrix::Option_list::has_map_column_container) {
for (ID_index i = 0; i < pivotToColumnIndex_.size() && pivotToColumnIndex_[i] != static_cast<Index>(-1); ++i) {
for (ID_index i = 0; i < pivotToColumnIndex_.size(); ++i) {
Index pos = pivotToColumnIndex_[i];
const Column& col = matrix_[pos];
for (const auto& entry : col) {
std::cout << entry.get_row_index() << " ";
if (pos != static_cast<Index>(-1)){
const Column& col = matrix_[pos];
for (const auto& entry : col) {
std::cout << entry.get_row_index() << " ";
}
std::cout << "(" << i << ", " << pos << ")\n";
}
std::cout << "(" << i << ", " << pos << ")\n";
}
if constexpr (Master_matrix::Option_list::has_row_access) {
std::cout << "\n";
std::cout << "Row Matrix:\n";
for (ID_index i = 0; i < pivotToColumnIndex_.size() && pivotToColumnIndex_[i] != static_cast<Index>(-1); ++i) {
for (ID_index i = 0; i < pivotToColumnIndex_.size(); ++i) {
Index pos = pivotToColumnIndex_[i];
const Row& row = RA_opt::get_row(pos);
for (const auto& entry : row) {
std::cout << entry.get_column_index() << " ";
if (pos != static_cast<Index>(-1)){
const Row& row = RA_opt::get_row(pos);
for (const auto& entry : row) {
std::cout << entry.get_column_index() << " ";
}
std::cout << "(" << i << ", " << pos << ")\n";
}
std::cout << "(" << i << ", " << pos << ")\n";
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ inline const typename Base_pairing<Master_matrix>::Barcode& Base_pairing<Master_
template <class Master_matrix>
inline void Base_pairing<Master_matrix>::_reduce()
{
std::unordered_map<ID_index, Index> pivotsToColumn(_matrix()->get_number_of_columns());
std::unordered_map<Index, Index> negativeColumns(_matrix()->get_number_of_columns());

auto dim = _matrix()->get_max_dimension();
std::vector<std::vector<Index> > columnsByDim(dim + 1);
for (auto& v : columnsByDim) v.reserve(_matrix()->get_number_of_columns());
for (unsigned int i = 0; i < _matrix()->get_number_of_columns(); i++) {
columnsByDim[dim - _matrix()->get_column_dimension(i)].push_back(i);
}
Expand All @@ -144,17 +145,21 @@ inline void Base_pairing<Master_matrix>::_reduce()
for (Index i : cols) {
auto& curr = _matrix()->get_column(i);
if (curr.is_empty()) {
if (pivotsToColumn.find(i) == pivotsToColumn.end()) {
if (negativeColumns.find(i) == negativeColumns.end()) {
barcode_.emplace_back(i, -1, dim);
}
} else {
ID_index pivot = curr.get_pivot();
auto it = idToPosition_.find(pivot);
Index pivotColumnNumber = it == idToPosition_.end() ? pivot : it->second;
auto itNeg = negativeColumns.find(pivotColumnNumber);
Index pivotKiller = itNeg == negativeColumns.end() ? -1 : itNeg->second;

while (pivot != static_cast<ID_index>(-1) && pivotsToColumn.find(pivot) != pivotsToColumn.end()) {
while (pivot != static_cast<ID_index>(-1) && pivotKiller != static_cast<Index>(-1)) {
if constexpr (Master_matrix::Option_list::is_z2) {
curr += _matrix()->get_column(pivotsToColumn.at(pivot));
curr += _matrix()->get_column(pivotKiller);
} else {
auto& toadd = _matrix()->get_column(pivotsToColumn.at(pivot));
auto& toadd = _matrix()->get_column(pivotKiller);
typename Master_matrix::Element coef = toadd.get_pivot_value();
auto& operators = _matrix()->colSettings_->operators;
coef = operators.get_inverse(coef);
Expand All @@ -163,12 +168,14 @@ inline void Base_pairing<Master_matrix>::_reduce()
}

pivot = curr.get_pivot();
it = idToPosition_.find(pivot);
pivotColumnNumber = it == idToPosition_.end() ? pivot : it->second;
itNeg = negativeColumns.find(pivotColumnNumber);
pivotKiller = itNeg == negativeColumns.end() ? -1 : itNeg->second;
}

if (pivot != static_cast<ID_index>(-1)) {
pivotsToColumn.emplace(pivot, i);
auto it = idToPosition_.find(pivot);
auto pivotColumnNumber = it == idToPosition_.end() ? pivot : it->second;
negativeColumns.emplace(pivotColumnNumber, i);
_matrix()->get_column(pivotColumnNumber).clear();
barcode_.emplace_back(pivotColumnNumber, i, dim - 1);
} else {
Expand Down
Loading

0 comments on commit b202391

Please sign in to comment.