A Skyline solver for linear sets
Project description
Skyline Solver
Skyline Solver is a Python library for solving a linear set with symmetric and skyline matrix of coefficients. It uses Cholesky decomposition for matrix factorization.
Installation
Use the package manager pip to install Skyline Solver.
pip install skyline_solver
For installation from the source:
python setup.py install
Usage
The following example has been used for usage and validation. This is a combination of Example 8.4 and 8.5 of Finite Element Procedures by K.J. Bathe.
from skyline_solver import skyline_solver
# Skyline vector of a symmetric matrix
# 1-based indexing must be used
m=[1,1,2,3,1]
# The matrix initialization
sk=skyline_solver(m)
# The matrix is initialized with zero values by default.
# However, the initial values can be set using the set method:
sk.set(0.0)
print("The rank is:", sk.rank)
print("The number of non-zero values is:", sk.nnz)
# Adding values according to 1-based indexing scheme.
sk.add_value(1,1,2.0)
sk.add_value(1,2,-2.0)
sk.add_value(1,5,-1.0)
sk.add_value(2,2,3.0)
sk.add_value(2,3,-2.0)
sk.add_value(3,3,5.0)
sk.add_value(3,4,-3.0)
sk.add_value(4,4,10.0)
sk.add_value(4,5,4.0)
sk.add_value(5,5,10.0)
print("The matrix in the dense format is:")
print(sk.to_dense())
# The factorization is done inplace.
sk.decompose()
print("The factorized matrix in the dense format is:")
print(sk.to_dense())
# Constants or load vectors
f=[0,1,0,0,0]
# Providing in place solution
f = sk.solve(f)
print("The solution is:")
print(f)
print("The solution from Finite Element Procedures By K. J. Bathe (Example 8.5) is:")
print([636, 619, 292, 74, 34])
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skyline_solver-0.0.1.tar.gz.
File metadata
- Download URL: skyline_solver-0.0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
315d4127cfec552df923185199ff34b2bdc75b78f16794bc6a8637ad4d812959
|
|
| MD5 |
f6443b28f3eeaeeb9b0ef8d98f5cf2a9
|
|
| BLAKE2b-256 |
9a3782699fd730cff18ecd7fd2f4c08e56c4a50a329e954e6d5935b849c43bc7
|
File details
Details for the file skyline_solver-0.0.1-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: skyline_solver-0.0.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 233.5 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3caafd250b1c87b7873819bfd07b8b42add8a10b5a60d70a493c11052ffbb7b9
|
|
| MD5 |
79ee8c59b817041b0f293da5bd04063f
|
|
| BLAKE2b-256 |
170fb369840281d826198ebcf8c9ea3d3131d36a97b7e5612b7847cb46e83745
|
File details
Details for the file skyline_solver-0.0.1-cp38-cp38-win32.whl.
File metadata
- Download URL: skyline_solver-0.0.1-cp38-cp38-win32.whl
- Upload date:
- Size: 195.2 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c63a9299998455ba21b6b19c6b3a851de9dadddd5a4a58a5ebc41f901cf6bd95
|
|
| MD5 |
cda6898ec7cd045c91c477509a50d49a
|
|
| BLAKE2b-256 |
4223edb35c9131c2a679ecff57c12e7ba14d281bbbc3ce275b604adb715aab4c
|