Giter Site home page Giter Site logo

matrix-inverse's Introduction

matrix-inverse

version license build bundle size code style

Matrix inverse function. Code is from sylvester by James Coglan, with gratitude.

Installation

Install matrix-inverse by running:

npm install matrix-inverse

Example

const matrixInverse = require('matrix-inverse')

const M = [
  [3, 3.2],
  [3.5, 3.6],
]

const M_inv = matrixInverse(M)

Origin

This code was copied and adapted from sylvester at commit 5a2c61681e988d60bf0a4223640c636052946341.

Contribute

Acknowledgements

This project was packaged by Paul Melnikow while at Body Labs. Thanks to Body Labs for the repository transfer.

License

The project is licensed under the MIT license.

matrix-inverse's People

Contributors

dependabot-preview[bot] avatar paulmelnikow avatar piercus avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

piercus

matrix-inverse's Issues

Feature request : isInvertible

Hello,

Thanks for this library, very useful ! I've just published https://github.com/piercus/kalman-filter which is using matrix-inverse.

Would it be possible to include a function like isInvertible(matrix) to know if the matrix is invertible.
It will give the ability to check before the code is crashing !

Use case

Actual

const matrixInverse = require('matrix-inverse');
matrixInverse([[0,0],[0,0]]) // Cannot read property 'elements' of null

Expected

(just a proposal)

const matrixInverse = require('matrix-inverse');
const mat = [[0,0],[0,0]];
let invert;
if(matrixInverse.isInvertible(mat)){
  invert = matrixInverse(mat); // Cannot read property 'elements' of null
} else {
  console.log('matrix is not invertible');
  invert = null;
}

Thanks for your help

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.