
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@cablanchard/matrix
Advanced tools
import { Matrix } from "@cablanchard/matrix";
new Matrix(2,3); // Create 2x3 numeric matrix
// [
// 0, 0, 0,
// 0, 0, 0,
// ]
new Matrix(2, 2).fill(1);
// [
// 1, 1,
// 1, 1,
// ]
new Matrix(2, 2).map((elem, i, j) => i)
// [
// 0, 0,
// 1, 1,
// ]
new Matrix(2,2).fromArray([0,1,2,3]);
// [
// 0, 1,
// 2, 3,
// ]
M.rows // Returns an array of 1D matrices representing rows
M.columns // Returns an array of 1D matrices representing columns
M.diagonal // Returns main diagonal
M.antiDiagonal // Returns main antidiagonal
M.transpose // Returns a new matrix which is a transpose of m
Throws if elems are out of bounds
M.iRow(i) // Returns i'th row
M.jCol(j) // Returns j'th column
M.kDiagonal(k) // Returns k'th diagonal
M.get(i, j) // Gets value at position i, j
M.forEach((elem, i, j)) // Iterates over all values n of matrix in positions i, j
Throws if 2 matrices are incompatible
M.equals(N) // Compares M and N
M.eq(N) // Shorthand for equals
M.add(N)
M.subtract(N) // Subtracts N from M
M.multiply(N) // Multiplies M (LHS) by N (RHS)
M.x(N) // Shorthand for multiply
M.scale(n) // Scale by factor n
M.toString()
MIT
FAQs
Containers for some kind of number
We found that @cablanchard/matrix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.