Skip to content

[RFC]: add blas/ext/base/greplicate #249

@kgryte

Description

@kgryte

This is the strided array equivalent of https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/iter/replicate, where each element is replicated a specified number of times.

API signatures:

greplicate( N, k, x, strideX, out, strideOut )
greplicate.ndarray( N, k, x, strideX, offsetX, out, strideOut, offsetOut )

where out is assumed to have N * k indexed elements.

Example output:

var x = [ 1, 2, 3, 4 ];
var out = [ 0, 0, 0, 0, 0, 0, 0, 0 ];

greplicate( x.length, 2, x, 1, out, 1 );
// out => [ 1, 1, 2, 2, 3, 3, 4, 4 ]

Follow-on Work

Once created and the PR is merged, then the following packages can be created:

  • blas/ext/base/dreplicate
  • blas/ext/base/sreplicate
  • blas/ext/base/zreplicate
  • blas/ext/base/creplicate

Metadata

Metadata

Assignees

Labels

FeatureTask to add a new feature.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.estimate: <2hrsTask which should take less than 2 hours.🤖 AIAllowed to use AI.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions