ultrametric_matrix_tools
Toolbox that provides functions and data structures to generate and handle ultrametric matrices.
Science Score: 64.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
2 of 3 committers (66.7%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.5%) to scientific vocabulary
Keywords
Repository
Toolbox that provides functions and data structures to generate and handle ultrametric matrices.
Basic Info
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 2
Topics
Metadata Files
README.md
Ultrametric matrix tools <!-- omit in toc -->
This toolbox provides functions and data structures to construct and handle ultrametric matrices in Rust and Python. The aim of the project is to provide efficient tools for ultrametric matrices and ultrametric trees. Currently, the project has the following features.
Features: <!-- omit in toc -->
- Generate a random ultrametric matrix
- Test ultramtic matrix property
- Construct the ultrametric tree from the ultrametric matrix
- Get properties of ultrametric tree
- Fast multiplication of ultrametric matrix with vector
The implementation is written in Rust and can be cross-compiled to Python.
Table of Contents <!-- omit in toc -->
Quickstart
Quickstart Rust
Add the following to the Cargo.toml file:
```toml
[dependencies]
TODO: replace the * by the latest version.
ultrametricmatrixtools = "*"
An example of the usage of is:
rust
use ultrametricmatrixtools::na::{DMatrix, DVector};
use ultrametricmatrixtools::UltrametricTree;
fn main() { let matrix = DMatrix::fromvec( 4, 4, vec![ 0.0, 1.0, 3.0, 1.0, 1.0, 3.0, 1.0, 1.0, 3.0, 1.0, 5.0, 1.0, 1.0, 1.0, 1.0, 1.0, ], ); let vector = DVector::fromvec(vec![4.0, 2.0, 7.0, 5.0]);
let tree = UltrametricTree::from_matrix(&matrix);
let product = tree * vector;
} ```
More examples can be found in ./examples/.
Quickstart Python
You can install the current release by running:
console
pip install ultrametric_matrix_tools
An example of the construction of the ultrametric tree and multiplication with it is: ```python from ultrametricmatrixtools import UltrametricTree import numpy as np
matrix = np.array([[0.0, 1.0, 3.0, 1.0], [1.0, 3.0, 1.0, 1.0], [ 3.0, 1.0, 5.0, 1.0], [1.0, 1.0, 1.0, 1.0]]) vector = np.array([4.0, 2.0, 7.0, 5.0])
tree = UltrametricTree(matrix) product = tree.mult(vector) ```
More examples can be found in ./examples/.
Build
Build Rust Library
The Rust library is build by running:
console
cargo build --release
The compiled Rust library is located in ./target/release/ and can be copied from there.
Build Python Module
The Python module is build from the Rust code using the PyO3. To build the Python module, you need to install Cargo and run:
console
cargo build --release
The compiled Python module is located in ./target/release/ and can be copied from there.
To export the Python wheels from a Linux host system run the following commands:
Linux (requires docker):
console
docker run --rm -v $(pwd):/io konstin2/maturin build --release
Windows (requires mingw32-python and mingw64-python):
console
make python_package_windows
Currently, cross-compiling to macOS is not supported.
Examples
Rust Example
You can try out the Rust examples, you need to install Cargo. You can try out the Python examples located in ./examples/ by running the following command:
console
cargo run --release --example [example_name]
E.g. to run the multiplication example run:
console
cargo run --release --example multiplication
Python Example
To run the Python examples, you need to install Cargo. You can try out the Python examples located in ./examples/ by running the following command:
console
make python_example name=[example_name]
E.g. to run the multiplication example run:
console
make python_example name=multiplication
Alternatively, if you have the Python package already installed via pip, then you can run the examples directly:
console
python [example_name].py
License
This project is under the Apache-2.0 license.
Benchmarks
The benchmarks use criterion for cargo, which can be installed by running:
console
cargo install cargo-criterion
The benchmarks can be found in ./benches and are run by:
console
cargo criterion --bench [benchmark_name]
Owner
- Name: Andy Oertel
- Login: aoertel
- Kind: user
- Repositories: 3
- Profile: https://github.com/aoertel
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: Ultrametric matrix tools
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Tobias
family-names: Hofmann
email: tobias.hofmann@math.tu-chemnitz.de
- given-names: Andy
family-names: Oertel
email: andy.oertel@cs.lth.se
repository-code: >-
https://github.com/aoertel/ultrametric-matrix-tools
keywords:
- ultrametric matrix
- rust
- matrix-vector multiplication
- ultrametric tree
license: Apache-2.0
version: 0.1.1
date-released: '2021-11-05'
GitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Andy Oertel | a****r@h****e | 56 |
| Andy Oertel | a****l@s****e | 6 |
| aoertel | o****y@g****m | 3 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 5 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cargo 1,434 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
crates.io: ultrametric_matrix_tools
Toolbox that provides functions and data structures to generate and handle ultrametric matrices.
- Documentation: https://docs.rs/ultrametric_matrix_tools/
- License: Apache-2.0
-
Latest release: 0.1.1
published about 4 years ago
Rankings
Maintainers (1)
Dependencies
- 135 dependencies
- criterion 0.3.5 development
- csv 1.1.6 development
- nalgebra 0.29.0
- ndarray 0.15.3
- numpy 0.14.1
- ptree 0.3.2
- pyo3 0.14.5
- rand 0.8.4