SkillAgentSearch skills...

Blasjs

Pure Javascript manually written :ok_hand: implementation of BLAS, Many numerical software applications use BLAS computations, including Armadillo, LAPACK, LINPACK, GNU Octave, Mathematica, MATLAB, NumPy, R, and Julia.

Install / Use

/learn @R-js/Blasjs

README

BLASjs (<span style="font-size:small" ><span style="color:red; font-weight: bold;">B</span>asic <span style="color:red; font-weight: bold;">L</span>inear <span style="color:red; font-weight: bold;">A</span>lgebra <span style="color:red; font-weight: bold;">S</span>ubprograms</span>)

This is a 100% Pure Javascript ( TypeScript ) re-write of the reference implementation Basic Linear Algebra SubPrograms (BLAS) numerical library found [here][blas-site]. This is a full manual re-write, "emscripten" was not used.

summary

BLASjs contains all the functions (Complex, Real) of the reference implementation capable for 32 bit and 64 bit floating point arithmatic:

  • :ok_hand: 100% code coverage
  • 1005 tests
  • Output off all tests equal to the BLAS FORTRAN reference implementation.
  • Level 1: all vector-vector operations implemented.
  • Level 2: all vector-matrix operations implemented.
  • Level 3: all matrix-matrix operations implemented.
  • Helper functions to ease the porting of FORTRAN BLAS usage to Javascript.

Node and Web

The resulting bundled blasjs file is an agnostic UMD library, it can be used in a web client as-well as in a server side node environment.

Slack

Installation

node

$ npm i blasjs

Usage:

//node
   const blas = require('blasjs');
//or typescript
   import * as blas from 'blasjs';

web

The module directory contains a standalone bundle for use in html <script> insertion. The library assigns window.BLAS after loading.

<!-- <script src="your_server_url/blasjs.min.js"></script> -->
<!-- this example uses unpkg as CDN -->
<script src="https://unpkg.com/blasjs@latest/dist/lib/blasjs.min.js"></script>
<script>
  const blas = window.BLAS; //UMD exposes it as BLAS

  //fetch some level3 complex 64 bit precision matrix-matrix operations
  const {
      level3: { zsyrk, ztrmm, ztrsm }
   } = blas;
</script>

Table of Contents

View on GitHub
GitHub Stars294
CategoryEducation
Updated6mo ago
Forks20

Languages

TypeScript

Security Score

92/100

Audited on Sep 28, 2025

No findings