# robust-linear-solve

> Exactly solve a low dimensional linear system

Latest version **1.0.0** (published 2014-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install robust-linear-solve
pnpm add robust-linear-solve
yarn add robust-linear-solve
bun add robust-linear-solve
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-05-08 |
| First published | 2014-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | linear, solve, robust, exact, arithmetic |

## Links

- npm: https://www.npmjs.com/package/robust-linear-solve
- Repository: https://github.com/mikolalysenko/robust-linear-solve
- Issues: https://github.com/mikolalysenko/robust-linear-solve/issues
- npm.io page: https://npm.io/package/robust-linear-solve

## Dependencies (1)

- [robust-determinant](https://npm.io/package/robust-determinant.md) ^1.1.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-05-08

## README

robust-linear-solve
===================
An exact linear solver for low dimensional systems.

# Example

```javascript
var linSolve = require("robust-linear-solve")

var A = [ [1, 2, 3],
          [3, 2, 1],
          [0, 0, 1] ]

var b = [1, 2, 3]

console.log(linSolve(A, b))
```

Output:

```javascript
[ [ -14 ], [ 23 ], [ -12 ], [ -4 ] ]
```

# Install

```
npm install robust-linear-solve
```

# API

#### `require("robust-linear-solve")(A, b)`
Finds the exact solution to a linear system, `Ax = b`, using Cramer's rule.

* `A` is a `n`-by-`n` square matrix, encoded as an array of arrays
* `b` is an `n` dimensional vector encoded as a length `n` array

**Returns** A projective `n+1` dimensional vector of non-overlapping increasing sequences representing the exact solution to the system.  That is to say, if `x` is the returned solution then in psuedocode we have the following constraint:

`A [ x[0], x[1], ... ,  x[n-1] ] =  b * x[n]`

Or in other words, the solution is given by the quotient:

`[ x[0] / x[n], x[1] / x[n], .... , x[n-1] / x[n] ]`

If the system is not solvable, then the last coefficient, `x[n]` will be `0`.

**Note** For up to `n=5`, you can avoid the extra method look up by calling `linSolve[n]` directly.

# Credits
(c) 2014 Mikola Lysenko. MIT License

---
_Source: https://npm.io/package/robust-linear-solve · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
