
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
ndarray-scratch
Advanced tools
A simple wrapper for typedarray-pool. I got tired of manually constructing ndarrays from typedarrays, and so this module saves some keystrokes/sanity.
var pool = require("ndarray-scratch")
//Create a temporary typed array
var x = pool.malloc([100,100])
//Do stuff with x
//Release x
pool.free(x)
npm install ndarray-scratch
var pool = require("ndarray-pool")
pool.malloc(shape[, dtype])
Allocates a temporary ndarray
shape
is the shape of the array to allocatedtype
is the dtype of the array to allocate (default "double"
)Returns a temporary ndarray
pool.zeros(shape[,dtype])
Creates a scratch ndarray initialized to 0
shape
is the shape of the resulting arraydtype
is the datatype of the array (default "double"
)Returns A temporary ndarray initialized to 0
pool.ones(shape[,dtype])
Creates a scratch ndarray initialized to 1
shape
is the shape of the resulting arraydtype
is the datatype of the array (default "double"
)Returns A temporary ndarray initialized to 1
pool.eye(shape[,dtype])
Creates a scratch ndarray initialized to 1
if all indices equal, 0
otherwise.
shape
is the shape of the resulting arraydtype
is the datatype of the array (default "double"
)Returns A temporary ndarray initialized to the identity matrix
pool.free(array)
Releases a temporary ndarray
array
is the ndarray to release.pool.clone(array)
Creates a copy of an ndarray with row-major order.
array
is an ndarrayReturns A temporary copy of array
(c) 2013-2014 Mikola Lysenko. MIT License
FAQs
Pooled memory for ndarrays
The npm package ndarray-scratch receives a total of 94,407 weekly downloads. As such, ndarray-scratch popularity was classified as popular.
We found that ndarray-scratch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.