Skip to main content

pentapy: A toolbox for pentadiagonal matrizes.

Project description

Welcome to pentapy

DOI PyPI version Build Status Build status Coverage Status Documentation Status Code style: black

Purpose

pentapy is a toolbox to deal with pentadiagonal matrices in Python.

Installation

The package can be installed via pip. On Windows you can install WinPython to get Python and pip running.

pip install pentapy

References

The solver is based on the algorithms PTRANS-I and PTRANS-II presented by Askar et al. 2015.

Examples

Solving a pentadiagonal linear equation system

This is an example of how to solve a LES with a pentadiagonal matrix.

import numpy as np
import pentapy as pp

size = 1000
# create a flattened pentadiagonal matrix
M_flat = (np.random.random((5, size)) - 0.5) * 1e-5
V = np.random.random(size) * 1e5
# solve the LES with M_flat as row-wise flattened matrix
X = pp.solve(M_flat, V, is_flat=True)

# create the corresponding matrix for checking
M = pp.create_full(M_flat, col_wise=False)
# calculate the error
print(np.max(np.abs(np.dot(M, X) - V)))

This should give something like:

4.257890395820141e-08

Performance

In the following a couple of solvers for pentadiagonal systems is compared:

Performance

The performance plot was created with perfplot. Have a look at the script: examples/02_perform.py.

Requirements:

Contact

You can contact us via info@geostat-framework.org.

License

MIT © 2019

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pentapy-1.0.0rc1.tar.gz (141.7 kB view hashes)

Uploaded Source

Built Distributions

pentapy-1.0.0rc1-cp37-cp37m-win_amd64.whl (206.3 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pentapy-1.0.0rc1-cp37-cp37m-win32.whl (193.4 kB view hashes)

Uploaded CPython 3.7m Windows x86

pentapy-1.0.0rc1-cp37-cp37m-manylinux1_x86_64.whl (454.3 kB view hashes)

Uploaded CPython 3.7m

pentapy-1.0.0rc1-cp37-cp37m-manylinux1_i686.whl (429.9 kB view hashes)

Uploaded CPython 3.7m

pentapy-1.0.0rc1-cp37-cp37m-macosx_10_6_intel.whl (292.2 kB view hashes)

Uploaded CPython 3.7m macOS 10.6+ intel

pentapy-1.0.0rc1-cp36-cp36m-win_amd64.whl (206.6 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

pentapy-1.0.0rc1-cp36-cp36m-win32.whl (193.5 kB view hashes)

Uploaded CPython 3.6m Windows x86

pentapy-1.0.0rc1-cp36-cp36m-manylinux1_x86_64.whl (456.9 kB view hashes)

Uploaded CPython 3.6m

pentapy-1.0.0rc1-cp36-cp36m-manylinux1_i686.whl (433.6 kB view hashes)

Uploaded CPython 3.6m

pentapy-1.0.0rc1-cp36-cp36m-macosx_10_6_intel.whl (291.9 kB view hashes)

Uploaded CPython 3.6m macOS 10.6+ intel

pentapy-1.0.0rc1-cp35-cp35m-win_amd64.whl (205.7 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

pentapy-1.0.0rc1-cp35-cp35m-win32.whl (192.1 kB view hashes)

Uploaded CPython 3.5m Windows x86

pentapy-1.0.0rc1-cp35-cp35m-manylinux1_x86_64.whl (448.0 kB view hashes)

Uploaded CPython 3.5m

pentapy-1.0.0rc1-cp35-cp35m-manylinux1_i686.whl (425.1 kB view hashes)

Uploaded CPython 3.5m

pentapy-1.0.0rc1-cp35-cp35m-macosx_10_6_intel.whl (288.0 kB view hashes)

Uploaded CPython 3.5m macOS 10.6+ intel

pentapy-1.0.0rc1-cp34-cp34m-win_amd64.whl (205.8 kB view hashes)

Uploaded CPython 3.4m Windows x86-64

pentapy-1.0.0rc1-cp34-cp34m-win32.whl (195.3 kB view hashes)

Uploaded CPython 3.4m Windows x86

pentapy-1.0.0rc1-cp34-cp34m-manylinux1_x86_64.whl (448.5 kB view hashes)

Uploaded CPython 3.4m

pentapy-1.0.0rc1-cp34-cp34m-manylinux1_i686.whl (428.8 kB view hashes)

Uploaded CPython 3.4m

pentapy-1.0.0rc1-cp34-cp34m-macosx_10_6_intel.whl (295.7 kB view hashes)

Uploaded CPython 3.4m macOS 10.6+ intel

pentapy-1.0.0rc1-cp27-cp27mu-manylinux1_x86_64.whl (449.0 kB view hashes)

Uploaded CPython 2.7mu

pentapy-1.0.0rc1-cp27-cp27mu-manylinux1_i686.whl (430.0 kB view hashes)

Uploaded CPython 2.7mu

pentapy-1.0.0rc1-cp27-cp27m-win_amd64.whl (211.4 kB view hashes)

Uploaded CPython 2.7m Windows x86-64

pentapy-1.0.0rc1-cp27-cp27m-win32.whl (198.3 kB view hashes)

Uploaded CPython 2.7m Windows x86

pentapy-1.0.0rc1-cp27-cp27m-manylinux1_x86_64.whl (449.0 kB view hashes)

Uploaded CPython 2.7m

pentapy-1.0.0rc1-cp27-cp27m-manylinux1_i686.whl (430.1 kB view hashes)

Uploaded CPython 2.7m

pentapy-1.0.0rc1-cp27-cp27m-macosx_10_6_intel.whl (305.2 kB view hashes)

Uploaded CPython 2.7m macOS 10.6+ intel

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page