GithubHelp home page GithubHelp logo

miguelfp / pypardisoproject Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haasad/pypardiso

0.0 0.0 0.0 768 KB

Python interface to the Intel MKL Pardiso library to solve large sparse linear systems of equations

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

pypardisoproject's Introduction

pypardiso-tests

PyPardiso

PyPardiso is a python package to solve large sparse linear systems of equations with the Intel oneAPI Math Kernel Library PARDISO solver, a shared-memory multiprocessing parallel direct sparse solver.

PyPardiso provides the same functionality as SciPy's scipy.sparse.linalg.spsolve for solving the sparse linear system Ax=b. However in many cases it is significantly faster than SciPy's built-in single-threaded SuperLU solver.

PyPardiso is not a python interface to the PARDISO Solver from the PARDISO 7.2 Solver Project and it also doesn't currently support complex numbers. Check out JuliaSparse/Pardiso.jl for these more advanced use cases.

Installation

PyPardiso runs on Linux, Windows and MacOS. It can be installed with conda or pip. It is recommended to install PyPardiso using a virtual environment.

conda-forge PyPI
conda-forge version PyPI version
conda install -c conda-forge pypardiso pip install pypardiso

Basic usage

How to solve the sparse linear system Ax=b for x, where A is a square, sparse matrix in CSR (or CSC) format and b is a vector (or matrix):

In [1]: import pypardiso

In [2]: import numpy as np

In [3]: import scipy.sparse as sp

In [4]: A = sp.rand(10, 10, density=0.5, format='csr')

In [5]: A
Out[5]:
<10x10 sparse matrix of type '<class 'numpy.float64'>'
	with 50 stored elements in Compressed Sparse Row format>

In [6]: b = np.random.rand(10)

In [7]: x = pypardiso.spsolve(A, b)

In [8]: x
Out[8]:
array([ 0.02918389,  0.59629935,  0.33407289, -0.48788966,  3.44508841,
        0.52565687, -0.48420646,  0.22136413, -0.95464127,  0.58297397])

pypardisoproject's People

Contributors

haasad avatar msrocka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.