Name: ndarray-tile
Owner: scijs
Description: Repeat an ndarray
Created: 2016-01-03 14:22:01.0
Updated: 2016-12-21 01:58:38.0
Pushed: 2016-01-04 13:16:06.0
Homepage: null
Size: 11
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Repeat an ndarray
This module takes an input ndarray and repeats it some number of times in each dimension.
tile = require('ndarray-tile')
ndarray = require('ndarray')
epeat a vector:
(ndarray(new Float64Array([1, 2, 3])), [2])
> 1 2 3 1 2 3
epeat a vector in a second dimension:
(ndarray(new Float64Array([1, 2, 3])), [1, 2])
> 1 1
2 2
3 3
ile a matrix in two dimensions:
(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
m install ndarray-tile
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 tiledreps
: An Array
containing The number of repetitions in each dimension. Each entry must be an integer greater than zero.reps
is less than the dimemsionality of input
, the ommitted dimensions are implicitly assumed to be one.input
, then input
is tiled in the new dimensions as specified.Returns: a reference to the tiled output
© 2016 Ricky Reusser. MIT License.