Socket
Book a DemoInstallSign in
Socket

ndarray-blas-gemv

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndarray-blas-gemv

BLAS Level 2 GEMV (Matrix-Vector multiply) for ndarrays

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

ndarray-blas-gemv

Build Status npm version Dependency Status

BLAS Level 2 GEMV (matrix-vector multiply) for ndarrays

Usage

gemv( alpha, A, x, beta, y )

Calculate y <- alpha * A * x + beta * y for scalar alpha, matrix A, vector x, scalar beta, and vector y. Result is overwritten in vector y. All other inputs are unchanged.

Example

var gemv = require('ndarray-blas-gemv')

var A = ndarray([1,2,5,3], [2,2]),
    x = ndarray([-4,7]),
    y = ndarray([3,-2])

gemv( -4, A, x, 2, y )

// Result: y = [-34, -8]

To multiply using the transpose of A, you can simply use .transpose(1,0) to transpose the input (note that this calculates new strides and offsets but does not rearrange the physical memory).

var A = ndarray([1,2,5,3], [2,2]),
    x = ndarray([-4,7]),
    y = ndarray([3,-2])

gemv( -4, A.transpose(1,0), x, 2, y )

// Result: y = [-118, -56]

Credits

(c) 2015 Ricky Reusser. MIT License

Keywords

blas

FAQs

Package last updated on 14 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts