ndarray-scratch

WebJar for ndarray-scratch

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

ndarray-scratch
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

ndarray-scratch
WebJar for ndarray-scratch
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/scijs/ndarray-scratch

Download ndarray-scratch

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/ndarray-scratch/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>ndarray-scratch</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/ndarray-scratch/
implementation 'org.webjars.npm:ndarray-scratch:1.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/ndarray-scratch/
implementation ("org.webjars.npm:ndarray-scratch:1.2.0")
'org.webjars.npm:ndarray-scratch:jar:1.2.0'
<dependency org="org.webjars.npm" name="ndarray-scratch" rev="1.2.0">
  <artifact name="ndarray-scratch" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='ndarray-scratch', version='1.2.0')
)
libraryDependencies += "org.webjars.npm" % "ndarray-scratch" % "1.2.0"
[org.webjars.npm/ndarray-scratch "1.2.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : ndarray jar [1.0.14,2)
org.webjars.npm : typedarray-pool jar [1.0.2,2)
org.webjars.npm : ndarray-ops jar [1.2.1,2)

Project Modules

There are no modules declared in this project.

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.

testling badge

build status

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.zeros(shape[,dtype])

Creates a scratch ndarray initialized to 0

  • shape is the shape of the resulting array
  • dtype 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 array
  • dtype 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 array
  • dtype 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 ndarray

Returns A temporary copy of array

Credits

(c) 2013-2014 Mikola Lysenko. MIT License

org.webjars.npm

Versions

Version
1.2.0