JSPM

ndarray-scratch

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 100971
  • Score
    100M100P100Q156085F
  • License MIT

Pooled memory for ndarrays

Package Exports

  • ndarray-scratch

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ndarray-scratch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ndarray-scratch

A simple wrapper for typedarray-pool. I got tired of manually constructing ndarrays from typedarrays, and so this module saves some keystrokes/sanity.

Example

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)

Install

npm install ndarray-scratch

API

var pool = require("ndarray-pool")

pool.malloc(shape[, dtype])

Allocates a temporary ndarray

  • shape is the shape of the array to allocate
  • dtype is the dtype of the array to allocate (default double)

Returns a temporary ndarray

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 ndarray

Returns A temporary copy of array

Credits

(c) 2013 Mikola Lysenko. MIT License