@@ -77,20 +77,20 @@ tape( 'the function multiplies `x` by a constant and adds the result to `y` (acc
7777 var y ;
7878
7979 alpha = new Complex128 ( 2.0 , 2.0 ) ;
80- x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 , 10.0 ] ) ;
81- y = new Complex128Array ( [ 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ] ) ;
80+ x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 , 10.0 ] ) ;
81+ y = new Complex128Array ( [ 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ] ) ;
8282
83- expected = new Float64Array ( [ - 1.0 , 7.0 , - 1.0 , 15.0 , - 1.0 , 23.0 , - 1.0 , 31.0 , - 1.0 , 39.0 ] ) ;
83+ expected = new Float64Array ( [ - 1.0 , 7.0 , - 1.0 , 15.0 , - 1.0 , 23.0 , - 1.0 , 31.0 , - 1.0 , 39.0 ] ) ;
8484
8585 gaxpy ( x . length , alpha , x , 1 , y , 1 ) ;
8686
8787 t . deepEqual ( reinterpret128 ( y , 0 ) , expected , 'returns expected value' ) ;
8888
8989 // Short datasets:
90- x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 ] ) ;
91- y = new Complex128Array ( [ 1.0 , 1.0 , 1.0 , 1.0 ] ) ;
90+ x = new Complex128Array ( [ 1.0 , 2.0 , 3.0 , 4.0 ] ) ;
91+ y = new Complex128Array ( [ 1.0 , 1.0 , 1.0 , 1.0 ] ) ;
9292
93- expected = new Float64Array ( [ - 1.0 , 7.0 , - 1.0 , 15.0 ] ) ;
93+ expected = new Float64Array ( [ - 1.0 , 7.0 , - 1.0 , 15.0 ] ) ;
9494
9595 gaxpy ( x . length , alpha , x , 1 , y , 1 ) ;
9696
@@ -149,11 +149,12 @@ tape( 'the function supports an `x` stride', function test( t ) {
149149
150150tape ( 'the function supports an `x` stride (accessors)' , function test ( t ) {
151151 var expected ;
152+ var alpha ;
152153 var x ;
153154 var y ;
154155 var N ;
155156
156- x = new Complex128Array ( [
157+ x = new Complex128Array ( [
157158 1.0 , // 0
158159 2.0 , // 0
159160 3.0 ,
@@ -164,8 +165,8 @@ tape( 'the function supports an `x` stride (accessors)', function test( t ) {
164165 8.0 ,
165166 9.0 , // 2
166167 10.0 // 2
167- ] ) ;
168- y = new Complex128Array ( [
168+ ] ) ;
169+ y = new Complex128Array ( [
169170 1.0 , // 0
170171 1.0 , // 0
171172 1.0 , // 1
@@ -176,13 +177,13 @@ tape( 'the function supports an `x` stride (accessors)', function test( t ) {
176177 1.0 ,
177178 1.0 ,
178179 1.0
179- ] ) ;
180+ ] ) ;
180181 alpha = new Complex128 ( 2.0 , 2.0 ) ;
181182 N = 3 ;
182183
183184 gaxpy ( N , alpha , x , 2 , y , 1 ) ;
184185
185- expected = new Float64Array ( [ - 1.0 , 7.0 , - 1.0 , 23.0 , - 1.0 , 39.0 , 1.0 , 1.0 , 1.0 , 1.0 ] ) ;
186+ expected = new Float64Array ( [ - 1.0 , 7.0 , - 1.0 , 23.0 , - 1.0 , 39.0 , 1.0 , 1.0 , 1.0 , 1.0 ] ) ;
186187
187188 t . deepEqual ( reinterpret128 ( y , 0 ) , expected , 'returns expected value' ) ;
188189 t . end ( ) ;
@@ -220,11 +221,12 @@ tape( 'the function supports a `y` stride', function test( t ) {
220221
221222tape ( 'the function supports a `y` stride (accessors)' , function test ( t ) {
222223 var expected ;
224+ var alpha ;
223225 var x ;
224226 var y ;
225227 var N ;
226228
227- x = new Complex128Array ( [
229+ x = new Complex128Array ( [
228230 1.0 , // 0
229231 2.0 , // 0
230232 3.0 , // 1
@@ -235,8 +237,8 @@ tape( 'the function supports a `y` stride (accessors)', function test( t ) {
235237 8.0 ,
236238 9.0 ,
237239 10.0
238- ] ) ;
239- y = new Complex128Array ( [
240+ ] ) ;
241+ y = new Complex128Array ( [
240242 1.0 , // 0
241243 1.0 , // 0
242244 1.0 ,
@@ -247,13 +249,13 @@ tape( 'the function supports a `y` stride (accessors)', function test( t ) {
247249 1.0 ,
248250 1.0 , // 2
249251 1.0 // 2
250- ] ) ;
252+ ] ) ;
251253 alpha = new Complex128 ( 2.0 , 2.0 ) ;
252254 N = 3 ;
253255
254256 gaxpy ( N , alpha , x , 1 , y , 2 ) ;
255257
256- expected = new Float64Array ( [ - 1.0 , 7.0 , 1.0 , 1.0 , - 1.0 , 23.0 , 1.0 , 1.0 , - 1.0 , 39.0 ] ) ;
258+ expected = new Float64Array ( [ - 1.0 , 7.0 , 1.0 , 1.0 , - 1.0 , 23.0 , 1.0 , 1.0 , - 1.0 , 39.0 ] ) ;
257259
258260 t . deepEqual ( reinterpret128 ( y , 0 ) , expected , 'returns expected value' ) ;
259261 t . end ( ) ;
@@ -324,11 +326,12 @@ tape( 'the function supports negative strides', function test( t ) {
324326
325327tape ( 'the function supports negative strides (accessors)' , function test ( t ) {
326328 var expected ;
329+ var alpha ;
327330 var x ;
328331 var y ;
329332 var N ;
330333
331- x = new Complex128Array ( [
334+ x = new Complex128Array ( [
332335 1.0 , // 2
333336 2.0 , // 2
334337 3.0 ,
@@ -339,8 +342,8 @@ tape( 'the function supports negative strides (accessors)', function test( t ) {
339342 8.0 ,
340343 9.0 , // 0
341344 10.0 // 0
342- ] ) ;
343- y = new Complex128Array ( [
345+ ] ) ;
346+ y = new Complex128Array ( [
344347 11.0 , // 2
345348 12.0 , // 2
346349 13.0 , // 1
@@ -351,13 +354,13 @@ tape( 'the function supports negative strides (accessors)', function test( t ) {
351354 18.0 ,
352355 19.0 ,
353356 20.0
354- ] ) ;
357+ ] ) ;
355358 alpha = new Complex128 ( 2.0 , 2.0 ) ;
356359 N = 3 ;
357360
358361 gaxpy ( N , alpha , x , - 2 , y , - 1 ) ;
359362
360- expected = new Float64Array ( [ 9.0 , 18.0 , 11.0 , 36.0 , 13.0 , 54.0 , 15.0 , 72.0 , 17.0 , 90.0 ] ) ;
363+ expected = new Float64Array ( [ 9.0 , 18.0 , 11.0 , 36.0 , 13.0 , 54.0 , 15.0 , 72.0 , 17.0 , 90.0 ] ) ;
361364
362365 t . deepEqual ( reinterpret128 ( y , 0 ) , expected , 'returns expected value' ) ;
363366 t . end ( ) ;
@@ -447,9 +450,9 @@ tape( 'if both strides are equal to `1`, the function efficiently multiplies `x`
447450
448451 alpha = 3.0 ;
449452
450- x = new Array ( 100 ) ;
451- y = new Array ( x . length ) ;
452- expected = new Array ( x . length ) ;
453+ x = new Float64Array ( 100 ) ;
454+ y = new Float64Array ( x . length ) ;
455+ expected = new Float64Array ( x . length ) ;
453456 for ( i = 0 ; i < x . length ; i ++ ) {
454457 x [ i ] = i ;
455458 y [ i ] = x . length - i ;
@@ -460,9 +463,9 @@ tape( 'if both strides are equal to `1`, the function efficiently multiplies `x`
460463
461464 t . deepEqual ( y , expected , 'returns expected value' ) ;
462465
463- x = new Array ( 123 ) ;
464- y = new Array ( x . length ) ;
465- expected = new Array ( x . length ) ;
466+ x = new Float64Array ( 123 ) ;
467+ y = new Float64Array ( x . length ) ;
468+ expected = new Float64Array ( x . length ) ;
466469 for ( i = 0 ; i < x . length ; i ++ ) {
467470 x [ i ] = i * 2 ;
468471 y [ i ] = x . length - i ;
0 commit comments