JSPM

ndarray-tile

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

Repeat an ndarray

Package Exports

  • ndarray-tile

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-tile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ndarray-tile Build Status

Repeat an ndarray

Introduction

This module takes an input ndarray and repeats it some number of times in each dimension.

Examples

var tile = require('ndarray-tile')
var ndarray = require('ndarray')

// Repeat a vector:
tile(ndarray(new Float64Array([1, 2, 3])), [2])
// => 1 2 3 1 2 3


// Repeat a vector in a second dimension:
tile(ndarray(new Float64Array([1, 2, 3])), [1, 2])
// => 1 1
//    2 2
//    3 3


// Tile a matrix in two dimensions:
tile(ndarray(new Float64Array([1, 2, 3, 4]), 2, 2]), [2, 2])
// => 1 2 1 2
//    3 4 3 4
//    1 2 1 2
//    3 4 3 4

Installation

$ npm install ndarray-tile

API

require('ndarray-tile')([output,] input, reps)

Tile ndarray input a number of times according to reps in each dimension.

Arguments:

  • output (optional): Optional output array. If not provided, storage is allocated using ndarray-scratch.
  • input: The input ndarray to be tiled
  • reps: An Array containing The number of repetitions in each dimension. Each entry must be an integer greater than zero.
    • If the length of reps is less than the dimemsionality of input, the ommitted dimensions are implicitly assumed to be one.
    • If the length of reps is greater than the dimensionality of input, then input is tiled in the new dimensions as specified.

License

© 2016 Ricky Reusser. MIT License.