stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

feat: add `blas/base/grot`

Open performant23 opened this issue 1 year ago • 0 comments

If applied, this commit will add the package blas/base/grot

Description

What is the purpose of this pull request?

Add the package, blas/base/grot which serves as a generic JavaScript interface to handle array types such as numeric arrays and accessor arrays.

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves #2190

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

  1. Use of eslint-disable-line no-underscore-dangle: This is used since we return the data buffer in case of an input accessor array.

  2. We are typecasting input arrays to accessor arrays while passing it to the grot function e.g.

x = xbuf.slice();
y = ybuf.slice();
out = grot( N[ i ], toAccessorArray( x ), 1, toAccessorArray( y ), 1, 0.8, 0.6 ); // eslint-disable-line max-len

Please do let me know in case it is preferred to cast it before it is passed as an argument e.g.

x = toAccessorArray( xbuf.slice() );
y = toAccessorArray( ybuf.slice() );
out = grot( N[ i ], x, 1, y, 1, 0.8, 0.6 ); // eslint-disable-line max-len
  1. In accessor array implementation, we're using @stdlib/complex/dtype to find out the dtype of the input arrays and then conditionally setting it as a param for @stdlib/complex/cmplx.

  2. Also, accessor array implementation works on one index at a time from each array similar to numeric array implementation but the complex array implementation works on 2 indexes from each array at a time since they're stored in pairs.

  3. Tests pertaining to accessor arrays are bifurcated to numeric array tests, accessor array (complex) tests, and accessor array (real) tests.

  4. Also, tests pertaining to accessor arrays testing if it applies plane rotation correctly have headings like : tape( '...(sx=1, sy=1) (accessors - complex)', ..... I'm not sure whether using parenthesis after parenthesis is the correct way.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

performant23 avatar Apr 21 '24 22:04 performant23