square-matrix-multiply

0.2.2 • Public • Published

square-matrix-multiply

Stability: 1 - Experimental

Square matrix multiply.

Usage

var squareMatrixMultiply = require('square-matrix-multiply');
var matrixA = [[a, b], [c, d]];
var matrixB = [[e, f], [g, h]];
...
var matrixC = squareMatrixMultiply(matrixA, matrixB, 'strassen' /*algorithm selector (default: naive)*/);

Algorithms

Naive

Time complexity: O(n^3)

Strassen

Time complexity: O(n^2.81)

Strassen algorithm implementation only accepts square matrices the size of a power of 2. For example: 1x1, 2x2, 4x4, 16x16, 32x32, etc...

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i square-matrix-multiply

    Weekly Downloads

    5

    Version

    0.2.2

    License

    MIT

    Last publish

    Collaborators

    • tristanls