A JAX-compatible, simplex method-based linear program solver
Project description
linrax
JAX-compatible, simplex method-based linear program solver. As part of the JAX ecosystem, linrax supports
- JIT compilation,
- Automatic Differentiability (forward mode only, currently), and
- GPU parallelization.
linrax is designed for use as a subroutine in a larger JAX pipeline. Its performance excels on smaller problems ($<50$ input variables), and is fully tracable in any of JAX's main transformations. In particular, linrax can solve problems that are specified with linearly dependent constraints, an area where other JAX-based solvers struggle.
Usage
The interface of linrax is designed to closely mimic that of scipy.linprog.
The public function is
import jax
import jax.numpy as jnp
@partial(jax.jit, static_argnames=[ "unbounded"])
def linprog(
c: jax.Array,
A_ub: jax.Array = jnp.empty((0, 0)),
b_ub: jax.Array = jnp.empty((0,)),
A_eq: jax.Array = jnp.empty((0, 0)),
b_eq: jax.Array = jnp.empty((0,)),
unbounded: bool = False,
) -> Tuple[SimplexStep, SimplexSolutionType]:
...
The SimplexSolutionType contains fields indicating if the problem is feasible or bounded, and a success property to check both simultaneously.
Assuming the problem has solutions, the SimplexStep object describes this solution. In particular, the fields x and fun retrieve the optimal point and objective value, respectively.
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 Distribution
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 linrax-0.1.0.tar.gz.
File metadata
- Download URL: linrax-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08c9b50f7d9b880d83d941636117756f970727b83dad36ff3ef33446029ce0ec
|
|
| MD5 |
b248cec2d8672b9e415a879042d25d04
|
|
| BLAKE2b-256 |
a8c63e7c48c9bec6ff809079063ab6c0e6392a2c6695481f58ca6aba8c42d64d
|
File details
Details for the file linrax-0.1.0-py3-none-any.whl.
File metadata
- Download URL: linrax-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ceb824de4a7e805fde8ebfebdb7158d5f6ce2d72306b8e770144305e8deba43
|
|
| MD5 |
784e2dd61c7663db4e8f39acd5a39203
|
|
| BLAKE2b-256 |
41d4dc99caf26fdc0a47a185661da07af3e7c55be8d33e4b8bfead4d9ab22d00
|