Skip to content

tristanls/node-square-matrix-multiply

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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...

About

Square matrix multiply.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published