# ndarray-gemm

> Matrix multiplication for ndarrays

Latest version **1.0.0** (published 2016-01-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install ndarray-gemm
pnpm add ndarray-gemm
yarn add ndarray-gemm
bun add ndarray-gemm
```

## 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 | 2016-01-07 |
| First published | 2016-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mikola Lysenko |
| Maintainers | rreusser |
| Keywords | scijs, matrix, multiply, ndarray, blas, level, 3, general, vector, outer, inner, product, linear, algebra, numerical, methods |

## Links

- npm: https://www.npmjs.com/package/ndarray-gemm
- Repository: https://github.com/scijs/ndarray-gemm
- Homepage: https://github.com/scijs/ndarray-gemm#readme
- Issues: https://github.com/scijs/ndarray-gemm/issues
- npm.io page: https://npm.io/package/ndarray-gemm

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-01-07

## README

ndarray-gemm
======
[General matrix multiply](http://en.wikipedia.org/wiki/General_Matrix_Multiply) for [ndarrays](https://github.com/mikolalysenko/ndarray).  This is analogous to the [BLAS level 3](http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) routine xGEMM.

Note that while this implementation is correct, it is not yet very optimized.  If someone wants to take over this project or suggest improvements, patches are welcome.

[![build status](https://secure.travis-ci.org/scijs/ndarray-gemm.png)](http://travis-ci.org/scijs/ndarray-gemm)

## Example

```javascript
var zeros = require("zeros")
var ops = require("ndarray-ops")
var gemm = require("ndarray-gemm")

//Create 3 random matrices
var a = zeros([300, 400]) // a is 300 x 400
var b = zeros([400, 500]) // b is 400 x 500
var c = zeros([300, 500]) // c is 300 x 500

ops.random(a)
ops.random(b)
ops.random(c)

//Set c = a * b
gemm(c, a, b)
```

## Install
Install using [npm](https://www.npmjs.com/):

    npm install ndarray-gemm

## API

#### `require("ndarray-gemm")(c, a, b[, alpha, beta])`
Computes a generalized matrix multiplication.  This sets:

```javascript
c = alpha * a * b + beta * c
```

* `c` is a `[n,m]` shape ndarray
* `a` is a `[n,p]` shape ndarray
* `b` is a `[p,m]` shape ndarray
* `alpha` is a scalar weight which is applied to the product `a * b`
* `beta` is a scalar weight applied to `c` when added back in

## License
(c) 2013 Mikola Lysenko. MIT License

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