stdlib
stdlib copied to clipboard
feat: add `blas/base/grot`
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.
-
Use of
eslint-disable-line no-underscore-dangle: This is used since we return the data buffer in case of an input accessor array. -
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
-
In accessor array implementation, we're using
@stdlib/complex/dtypeto find out the dtype of the input arrays and then conditionally setting it as a param for@stdlib/complex/cmplx. -
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.
-
Tests pertaining to accessor arrays are bifurcated to numeric array tests, accessor array (complex) tests, and accessor array (real) tests.
-
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.
- [x] Read, understood, and followed the contributing guidelines.
@stdlib-js/reviewers