ultrametric_matrix_tools

Toolbox that provides functions and data structures to generate and handle ultrametric matrices.

https://github.com/aoertel/ultrametric-matrix-tools

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

fast-matrix-vector-multiplication linear-algebra math mathematics tree-representation ultrametric ultrametric-matrix ultrametric-tree
Last synced: 4 months ago · JSON representation ·

Repository

Toolbox that provides functions and data structures to generate and handle ultrametric matrices.

Basic Info
  • Host: GitHub
  • Owner: aoertel
  • License: apache-2.0
  • Language: Rust
  • Default Branch: master
  • Homepage:
  • Size: 104 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
fast-matrix-vector-multiplication linear-algebra math mathematics tree-representation ultrametric ultrametric-matrix ultrametric-tree
Created about 4 years ago · Last pushed almost 4 years ago
Metadata Files
Readme License Citation

README.md

Ultrametric matrix tools <!-- omit in toc -->

DOI

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

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

All Time
  • Total Commits: 65
  • Total Committers: 3
  • Avg Commits per committer: 21.667
  • Development Distribution Score (DDS): 0.138
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email 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.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,434 Total
Rankings
Dependent repos count: 29.3%
Dependent packages count: 33.8%
Forks count: 37.5%
Stargazers count: 39.2%
Average: 44.5%
Downloads: 82.9%
Maintainers (1)
Last synced: 5 months ago

Dependencies

Cargo.lock cargo
  • 135 dependencies
Cargo.toml cargo
  • 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