Skip to main content

pentapy: A toolbox for pentadiagonal matrizes.

Project description

Welcome to pentapy

PyPI version Build Status Build 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
from pentapy import solve
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
X = solve(M_flat, V, is_flat=True)

# create the corresponding matrix for checking
M = (
     np.diag(M_flat[0, :-2], 2)
     + np.diag(M_flat[1, :-1], 1)
     + np.diag(M_flat[2, :], 0)
     + np.diag(M_flat[3, 1:], -1)
     + np.diag(M_flat[4, 2:], -2)
)
# calculate the error
print(np.max(np.abs(np.dot(M, X) - V)))

This should give something like:

4.257890395820141e-08

Requirements:

Contact

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

License

GPL © 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-0.1.1.tar.gz (133.7 kB view hashes)

Uploaded Source

Built Distributions

pentapy-0.1.1-cp36-cp36m-win_amd64.whl (197.3 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

pentapy-0.1.1-cp36-cp36m-win32.whl (186.2 kB view hashes)

Uploaded CPython 3.6m Windows x86

pentapy-0.1.1-cp36-cp36m-manylinux1_x86_64.whl (407.8 kB view hashes)

Uploaded CPython 3.6m

pentapy-0.1.1-cp36-cp36m-manylinux1_i686.whl (389.4 kB view hashes)

Uploaded CPython 3.6m

pentapy-0.1.1-cp36-cp36m-macosx_10_6_intel.whl (270.6 kB view hashes)

Uploaded CPython 3.6m macOS 10.6+ intel

pentapy-0.1.1-cp35-cp35m-win_amd64.whl (196.7 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

pentapy-0.1.1-cp35-cp35m-win32.whl (185.6 kB view hashes)

Uploaded CPython 3.5m Windows x86

pentapy-0.1.1-cp35-cp35m-manylinux1_x86_64.whl (404.7 kB view hashes)

Uploaded CPython 3.5m

pentapy-0.1.1-cp35-cp35m-manylinux1_i686.whl (384.6 kB view hashes)

Uploaded CPython 3.5m

pentapy-0.1.1-cp35-cp35m-macosx_10_6_intel.whl (268.0 kB view hashes)

Uploaded CPython 3.5m macOS 10.6+ intel

pentapy-0.1.1-cp34-cp34m-win_amd64.whl (195.6 kB view hashes)

Uploaded CPython 3.4m Windows x86-64

pentapy-0.1.1-cp34-cp34m-win32.whl (187.6 kB view hashes)

Uploaded CPython 3.4m Windows x86

pentapy-0.1.1-cp34-cp34m-manylinux1_x86_64.whl (408.9 kB view hashes)

Uploaded CPython 3.4m

pentapy-0.1.1-cp34-cp34m-manylinux1_i686.whl (389.2 kB view hashes)

Uploaded CPython 3.4m

pentapy-0.1.1-cp34-cp34m-macosx_10_6_intel.whl (276.4 kB view hashes)

Uploaded CPython 3.4m macOS 10.6+ intel

pentapy-0.1.1-cp27-cp27mu-manylinux1_x86_64.whl (407.7 kB view hashes)

Uploaded CPython 2.7mu

pentapy-0.1.1-cp27-cp27mu-manylinux1_i686.whl (389.1 kB view hashes)

Uploaded CPython 2.7mu

pentapy-0.1.1-cp27-cp27m-win_amd64.whl (202.0 kB view hashes)

Uploaded CPython 2.7m Windows x86-64

pentapy-0.1.1-cp27-cp27m-win32.whl (190.6 kB view hashes)

Uploaded CPython 2.7m Windows x86

pentapy-0.1.1-cp27-cp27m-manylinux1_x86_64.whl (407.6 kB view hashes)

Uploaded CPython 2.7m

pentapy-0.1.1-cp27-cp27m-manylinux1_i686.whl (389.1 kB view hashes)

Uploaded CPython 2.7m

pentapy-0.1.1-cp27-cp27m-macosx_10_6_intel.whl (286.8 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