Socket
Book a DemoInstallSign in
Socket

ndarray-linspace

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndarray-linspace

Fill an ndarray with equally spaced values

latest
Source
npmnpm
Version
2.0.3
Version published
Maintainers
4
Created
Source

ndarray-linspace Build Status npm version js-standard-style

Fill an ndarray with equally spaced values

Example

var ndarray = require('ndarray');
var linspace = require('ndarray-linspace');

linspace(ndarray([], [5]), 2, 3);
// => ndarray([2, 2.25, 2.5, 2.75, 3])

linspace(ndarray([], [5]), 2, 3, {endpoint: false});
// => ndarray([2, 2.25, 2.5, 2.75])

linspace(ndarray([], [2, 2]), 0, 1)
// y => [ 0, 0 ]
//      [ 1, 1 ]

linspace(ndarray([], [2, 2]), 0, 1, {axis: 1})
// y => [ 0, 1 ]
//      [ 0, 1 ]

Installation

npm install ndarray-linspace

API

require('ndarray-linspace')(output, start, end[, options])

An array of equally spaced values.

Arguments:

  • output The destination array to be filled with values.
  • start: starting value of the interval
  • end: ending value of the interval
  • options (optional): A hash of options. Options are:
    • endpoint (default: true): whether the output contains the endpoint of the interval
    • axis (default: 0): the dimension along which to fill the array. Must be an integer less than or equal to the dimension of the input.

Returns: A reference to the output

License

© 2015 Ricky Reusser. MIT License.

Keywords

ndarray

FAQs

Package last updated on 12 Jan 2017

Did you know?

Socket

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.

Install

Related posts