scijs/ndarray-tile

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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

Repeat an ndarray

Introduction

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

Examples
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
Installation
m install ndarray-tile
API
require('ndarray-tile')([output,] input, reps)

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

Arguments:

Returns: a reference to the tiled output

License

© 2016 Ricky Reusser. MIT License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.