Skip to main content

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


Download files

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

Source Distribution

linrax-2025.2.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linrax-2025.2.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file linrax-2025.2.1.tar.gz.

File metadata

  • Download URL: linrax-2025.2.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for linrax-2025.2.1.tar.gz
Algorithm Hash digest
SHA256 dcf653e611ff2544b81ffe71a3c60cdb59acab3061c50c115d742c3d11c81115
MD5 1eaf78c7fd8e6c2e8061fb7109388111
BLAKE2b-256 bd33c8980f165a452c1d0079bc35290057b7c4a1b132ea57b2f31a522ae39c57

See more details on using hashes here.

File details

Details for the file linrax-2025.2.1-py3-none-any.whl.

File metadata

  • Download URL: linrax-2025.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for linrax-2025.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7cc351099f68c9c66e5c0a5066bdfa28f8d795579cfbf4b3172e077bcfedac0c
MD5 7343ac0ac40dff94ee8a8274ba74cdc7
BLAKE2b-256 47ccd44699caf93014edafede55cc0042a3da4e66ae5553b4f07d8c570a6d965

See more details on using hashes here.

Supported by

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