21
21
// MODULES //
22
22
23
23
var tape = require ( 'tape' ) ;
24
+ var toAccessorArray = require ( '@stdlib/array/base/to-accessor-array' ) ;
24
25
var gcopy = require ( '@stdlib/blas/base/gcopy' ) . ndarray ;
25
26
var EPS = require ( '@stdlib/constants/float64/eps' ) ;
26
27
var abs = require ( '@stdlib/math/base/special/abs' ) ;
27
28
var grot = require ( './../lib/ndarray.js' ) ;
28
- const toAccessorArray = require ( '@stdlib/array/base/to-accessor-array' ) ;
29
29
30
30
31
31
// FUNCTIONS //
@@ -119,6 +119,7 @@ tape( 'the function applies a plane rotation (sx=1, sy=1) (accessors)', function
119
119
var xbuf ;
120
120
var ybuf ;
121
121
var out ;
122
+ var yob ;
122
123
var xe ;
123
124
var ye ;
124
125
var ox ;
@@ -152,10 +153,11 @@ tape( 'the function applies a plane rotation (sx=1, sy=1) (accessors)', function
152
153
for ( i = 0 ; i < N . length ; i ++ ) {
153
154
x = xbuf . slice ( ) ;
154
155
y = ybuf . slice ( ) ;
155
- out = grot ( N [ i ] , toAccessorArray ( x ) , 1 , ox [ i ] , toAccessorArray ( y ) , 1 , oy [ i ] , 0.8 , 0.6 ) ;
156
+ yob = toAccessorArray ( y ) ;
157
+ out = grot ( N [ i ] , toAccessorArray ( x ) , 1 , ox [ i ] , yob , 1 , oy [ i ] , 0.8 , 0.6 ) ;
156
158
isApprox ( t , x , xe [ i ] , 6.0 ) ;
157
159
isApprox ( t , y , ye [ i ] , 6.0 ) ;
158
- t . strictEqual ( out . _buffer , y , 'returns expected value' ) ;
160
+ t . strictEqual ( out , yob , 'returns expected value' ) ;
159
161
}
160
162
t . end ( ) ;
161
163
} ) ;
@@ -209,6 +211,7 @@ tape( 'the function applies a plane rotation (sx=2, sy=-2) (accessors)', functio
209
211
var xbuf ;
210
212
var ybuf ;
211
213
var out ;
214
+ var yob ;
212
215
var xe ;
213
216
var ye ;
214
217
var ox ;
@@ -242,10 +245,11 @@ tape( 'the function applies a plane rotation (sx=2, sy=-2) (accessors)', functio
242
245
for ( i = 0 ; i < N . length ; i ++ ) {
243
246
x = xbuf . slice ( ) ;
244
247
y = ybuf . slice ( ) ;
245
- out = grot ( N [ i ] , toAccessorArray ( x ) , 2 , ox [ i ] , toAccessorArray ( y ) , - 2 , oy [ i ] , 0.8 , 0.6 ) ;
248
+ yob = toAccessorArray ( y ) ;
249
+ out = grot ( N [ i ] , toAccessorArray ( x ) , 2 , ox [ i ] , yob , - 2 , oy [ i ] , 0.8 , 0.6 ) ;
246
250
isApprox ( t , x , xe [ i ] , 20.0 ) ;
247
251
isApprox ( t , y , ye [ i ] , 20.0 ) ;
248
- t . strictEqual ( out . _buffer , y , 'returns expected value' ) ;
252
+ t . strictEqual ( out , yob , 'returns expected value' ) ;
249
253
}
250
254
t . end ( ) ;
251
255
} ) ;
@@ -298,6 +302,7 @@ tape( 'the function applies a plane rotation (sx=-2, sy=1) (accessors)', functio
298
302
var xbuf ;
299
303
var ybuf ;
300
304
var out ;
305
+ var yob ;
301
306
var xe ;
302
307
var ye ;
303
308
var ox ;
@@ -330,10 +335,11 @@ tape( 'the function applies a plane rotation (sx=-2, sy=1) (accessors)', functio
330
335
for ( i = 0 ; i < N . length ; i ++ ) {
331
336
x = xbuf . slice ( ) ;
332
337
y = ybuf . slice ( ) ;
333
- out = grot ( N [ i ] , toAccessorArray ( x ) , - 2 , ox [ i ] , toAccessorArray ( y ) , 1 , oy [ i ] , 0.8 , 0.6 ) ;
338
+ yob = toAccessorArray ( y ) ;
339
+ out = grot ( N [ i ] , toAccessorArray ( x ) , - 2 , ox [ i ] , yob , 1 , oy [ i ] , 0.8 , 0.6 ) ;
334
340
isApprox ( t , x , xe [ i ] , 20.0 ) ;
335
341
isApprox ( t , y , ye [ i ] , 20.0 ) ;
336
- t . strictEqual ( out . _buffer , y , 'returns expected value' ) ;
342
+ t . strictEqual ( out , yob , 'returns expected value' ) ;
337
343
}
338
344
t . end ( ) ;
339
345
} ) ;
@@ -387,6 +393,7 @@ tape( 'the function applies a plane rotation (sx=-1, sy=-2) (accessors)', functi
387
393
var xbuf ;
388
394
var ybuf ;
389
395
var out ;
396
+ var yob ;
390
397
var xe ;
391
398
var ye ;
392
399
var ox ;
@@ -420,10 +427,11 @@ tape( 'the function applies a plane rotation (sx=-1, sy=-2) (accessors)', functi
420
427
for ( i = 0 ; i < N . length ; i ++ ) {
421
428
x = xbuf . slice ( ) ;
422
429
y = ybuf . slice ( ) ;
423
- out = grot ( N [ i ] , toAccessorArray ( x ) , - 1 , ox [ i ] , toAccessorArray ( y ) , - 2 , oy [ i ] , 0.8 , 0.6 ) ;
430
+ yob = toAccessorArray ( y ) ;
431
+ out = grot ( N [ i ] , toAccessorArray ( x ) , - 1 , ox [ i ] , yob , - 2 , oy [ i ] , 0.8 , 0.6 ) ;
424
432
isApprox ( t , x , xe [ i ] , 4.0 ) ;
425
433
isApprox ( t , y , ye [ i ] , 4.0 ) ;
426
- t . strictEqual ( out . _buffer , y , 'returns expected value' ) ;
434
+ t . strictEqual ( out , yob , 'returns expected value' ) ;
427
435
}
428
436
t . end ( ) ;
429
437
} ) ;
@@ -721,10 +729,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav
721
729
x = [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ] ;
722
730
y = [ 6.0 , 7.0 , 8.0 , 9.0 , 10.0 ] ;
723
731
724
- xe = [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ]
732
+ xe = [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] ;
725
733
gcopy ( x . length , x , 1 , 0 , xe , 1 , 0 ) ;
726
734
727
- ye = [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ]
735
+ ye = [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] ;
728
736
gcopy ( y . length , y , 1 , 0 , ye , 1 , 0 ) ;
729
737
730
738
grot ( - 1 , x , 1 , 0 , y , 1 , 0 , 0.8 , 0.6 ) ;
@@ -747,10 +755,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav
747
755
x = [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ] ;
748
756
y = [ 6.0 , 7.0 , 8.0 , 9.0 , 10.0 ] ;
749
757
750
- xe = [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ]
758
+ xe = [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] ;
751
759
gcopy ( x . length , x , 1 , 0 , xe , 1 , 0 ) ;
752
760
753
- ye = [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ]
761
+ ye = [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] ;
754
762
gcopy ( y . length , y , 1 , 0 , ye , 1 , 0 ) ;
755
763
756
764
grot ( - 1 , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 , 0.8 , 0.6 ) ;
0 commit comments