Skip to content
NeaByteLabPublic

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Numerix

Numerical library for arrays, transforms, sampling, and linear algebra

Deno Module type: Deno/ESM License

What is Numerix?

Numerix is a numeric library for JavaScript and TypeScript that follows the NumPy API. It gives you arrays, arithmetic, statistics, linear algebra, signal transforms, and random sampling under one consistent namespace. Operations work on nested arrays and broadcast operands the way NumPy does, so a scalar combines with a matrix without manual looping.

Installation

The package is not published to any registry yet, so clone it from source.

git clone https://github.com/NeaByteLab/Numerix.git
cd Numerix

Usage

import Numeric from '@neabyte/numerix'

// Creates a 2x2 matrix filled with zeros.
Numeric.create.zero([2, 2])

// Adds two vectors element by element.
Numeric.math.add([1, 2, 3], [10, 20, 30]) // [11, 22, 33]

// Reshapes a flat vector into a matrix.
Numeric.shape.reshape([1, 2, 3, 4], [2, 2])

// Computes the sum of every entry.
Numeric.reduce.sum([1, 2, 3, 4]) // 10

Every method, with examples, is documented in docs/README.md.

API

Every method lives in the namespace that matches its group in the contract.

Namespace Methods Covers
create 14 array creation, range, mesh, diagonal, vandermonde
shape 17 reshape, transpose, broadcast, join, split, pad, roll, flip
index 8 where, select, take, put, ravel, unravel, mask, slide
math 34 arithmetic, powers, rounding, gcd, convolution, gradients
trig 16 sin, cos, tan, inverses, hyperbolic, deg, rad, unwrap
complex 4 real, imag, angle, conj
reduce 12 sum, prod, cumulative forms, min, max, argmin, argmax
stat 11 mean, average, median, quantile, variance, std, cov, corr
sort 5 order, argsort, partition, argpartition, search
set 6 unique, union, intersect, diff, xor, member
logic 16 comparisons, boolean operators, finiteness checks
bit 8 bitwise operators, shifts, popcount, pack, unpack
linalg 20 dot, matmul, einsum, norm, det, inv, solve, qr, svd, eig
fft 8 forward, inverse, real transforms, frequency, shift
random 32 28 distributions plus seed, choice, shuffle, permute
poly 19 evaluate, fit, roots, derivatives, bases, integration
window 5 bartlett, blackman, hamming, hanning, kaiser
string 26 concatenation, case, padding, searching, splitting, encoding
dtype 4 cast, check, info, endian
util 4 apply, memory, format, io

Acknowledgements

This project follows the NumPy 2.5.4 API, see NOTICE for the full attribution.

License

This project is distributed under the BSD 3-Clause license. See the LICENSE file for the full text.