$ npm install ndarray-matrix-vector-productDense matrix-vector multiply for ndarrays.
var mvp = require("ndarray-matrix-vector-product")
var zeros = require("zeros")
//Initialize some vectors and a matrix
var x = zeros([16])
var M = zeros([16, 8])
var y = zeros([8])
M.set(1,2, 10.0)
y.set(2, 3)
//Multiply y by M storing result in x
mvp(x, M, y)
Install using npm:
npm install ndarray-matrix-vector-product
require("ndarray-matrix-vector-product")(out, M, y)Multiplies a matrix by a vector
out is an 1D ndarray with shape [n]M is a 2D ndarray with shape [n,m]v is a 1D ndarray with shape [m](c) 2013 Mikola Lysenko. MIT License