Skip to content

Commit

Permalink
test: add test suite for stpmv
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-095 committed Aug 23, 2024
1 parent c805cb5 commit fcb71c8
Show file tree
Hide file tree
Showing 34 changed files with 2,160 additions and 21 deletions.
42 changes: 21 additions & 21 deletions lib/node_modules/@stdlib/blas/base/stpmv/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ import stpmv = require( './index' );

// The function returns a Float32Array...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, x, 1 ); // $ExpectType Float32Array
}

// The compiler throws an error if the function is provided a first argument which is not a string...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv( 10, 'upper', 'no-transpose', 'unit', 10, AP, x, 1 ); // $ExpectError
stpmv( true, 'upper', 'no-transpose', 'unit', 10, AP, x, 1 ); // $ExpectError
Expand All @@ -46,8 +46,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a second argument which is not a string...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv( 'row-major', 10, 'no-transpose', 'unit', 10, AP, x, 1 ); // $ExpectError
stpmv( 'row-major', true, 'no-transpose', 'unit', 10, AP, x, 1 ); // $ExpectError
Expand All @@ -61,8 +61,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a third argument which is not a string...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv( 'row-major', 'upper', 10, 'unit', 10, AP, x, 1 ); // $ExpectError
stpmv( 'row-major', 'upper', true, 'unit', 10, AP, x, 1 ); // $ExpectError
Expand All @@ -76,8 +76,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a fourth argument which is not a string...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv( 'row-major', 'upper', 'no-transpose', 10, 10, AP, x, 1 ); // $ExpectError
stpmv( 'row-major', 'upper', 'no-transpose', true, 10, AP, x, 1 ); // $ExpectError
Expand All @@ -91,8 +91,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a fifth argument which is not a number...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv( 'row-major', 'upper', 'no-transpose', 'unit', '10', AP, x, 1 ); // $ExpectError
stpmv( 'row-major', 'upper', 'no-transpose', 'unit', true, AP, x, 1 ); // $ExpectError
Expand All @@ -119,7 +119,7 @@ import stpmv = require( './index' );
stpmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, x, 1 ); // $ExpectError
}

// The compiler throws an error if the function is provided an seventh argument which is not a Float32Array...
// The compiler throws an error if the function is provided a seventh argument which is not a Float32Array...
{
const AP = new Float32Array( 55 );

Expand All @@ -134,10 +134,10 @@ import stpmv = require( './index' );
stpmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, ( x: number ): number => x, 1 ); // $ExpectError
}

// The compiler throws an error if the function is provided a eighth argument which is not a number...
// The compiler throws an error if the function is provided an eighth argument which is not a number...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, x, '10' ); // $ExpectError
stpmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, x, true ); // $ExpectError
Expand All @@ -151,8 +151,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided an unsupported number of arguments...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv(); // $ExpectError
stpmv( 'row-major' ); // $ExpectError
Expand All @@ -167,16 +167,16 @@ import stpmv = require( './index' );

// Attached to main export is an `ndarray` method which returns a Float32Array...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, 1, 0, x, 1, 0 ); // $ExpectType Float32Array
}

// The compiler throws an error if the function is provided a first argument which is not a string...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 10, 'upper', 'no-transpose', 'unit', 10, AP, 1, 0, x, 1, 0 ); // $ExpectError
stpmv.ndarray( true, 'upper', 'no-transpose', 'unit', 10, AP, 1, 0, x, 1, 0 ); // $ExpectError
Expand All @@ -190,8 +190,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a second argument which is not a string...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 'row-major', 10, 'no-transpose', 'unit', 10, AP, 1, 0, x, 1, 0 ); // $ExpectError
stpmv.ndarray( 'row-major', true, 'no-transpose', 'unit', 10, AP, 1, 0, x, 1, 0 ); // $ExpectError
Expand All @@ -205,8 +205,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a third argument which is not a string...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 'row-major', 'upper', 10, 'unit', 10, AP, 1, 0, x, 1, 0 ); // $ExpectError
stpmv.ndarray( 'row-major', 'upper', true, 'unit', 10, AP, 1, 0, x, 1, 0 ); // $ExpectError
Expand All @@ -220,8 +220,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a fourth argument which is not a string...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 10, 10, AP, 1, 0, x, 1, 0 ); // $ExpectError
stpmv.ndarray( 'row-major', 'upper', 'no-transpose', true, 10, AP, 1, 0, x, 1, 0 ); // $ExpectError
Expand All @@ -235,8 +235,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a fifth argument which is not a number...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', '10', AP, 1, 0, x, 1, 0 ); // $ExpectError
stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', true, AP, 1, 0, x, 1, 0 ); // $ExpectError
Expand Down Expand Up @@ -265,8 +265,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a seventh argument which is not a number...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, '10', 0, x, 1, 0 ); // $ExpectError
stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, true, 0, x, 1, 0 ); // $ExpectError
Expand All @@ -280,8 +280,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided an eighth argument which is not a number...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, 1, '10', x, 1, 0 ); // $ExpectError
stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, 1, true, x, 1, 0 ); // $ExpectError
Expand Down Expand Up @@ -310,8 +310,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided a tenth argument which is not a number...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, 1, 0, x, '10', 0 ); // $ExpectError
stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, 1, 0, x, true, 0 ); // $ExpectError
Expand All @@ -325,8 +325,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided an eleventh argument which is not a number...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, 1, 0, x, 1, '10' ); // $ExpectError
stpmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, AP, 1, 0, x, 1, true ); // $ExpectError
Expand All @@ -340,8 +340,8 @@ import stpmv = require( './index' );

// The compiler throws an error if the function is provided an unsupported number of arguments...
{
const x = new Float32Array( 10 );
const AP = new Float32Array( 55 );
const x = new Float32Array( 10 );

stpmv.ndarray(); // $ExpectError
stpmv.ndarray( 'row-major', 'upper' ); // $ExpectError
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "transpose",
"diag": "unit",
"uplo": "lower",
"strideX": -2,
"offsetX": 5,
"strideAP": -2,
"offsetAP": 11,
"N": 3,
"AP": [ 0.0, 1.0, 0.0, 2.0, 0.0, 1.0, 0.0, 3.0, 0.0, 2.0, 0.0, 1.0 ],
"x": [ 0.0, 3.0, 0.0, 2.0, 0.0, 1.0 ],
"x_out": [ 0.0, 3.0, 0.0, 8.0, 0.0, 14.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "no-transpose",
"diag": "non-unit",
"uplo": "lower",
"strideX": 1,
"offsetX": 0,
"strideAP": 1,
"offsetAP": 0,
"N": 3,
"AP": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 1.0, 10.0, 31.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "no-transpose",
"diag": "unit",
"uplo": "lower",
"strideX": 1,
"offsetX": 0,
"strideAP": 1,
"offsetAP": 0,
"N": 3,
"AP": [ 1.0, 2.0, 2.0, 1.0, 1.0, 1.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 1.0, 4.0, 7.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "transpose",
"diag": "non-unit",
"uplo": "lower",
"strideX": 1,
"offsetX": 0,
"strideAP": 1,
"offsetAP": 0,
"N": 3,
"AP": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 14.0, 23.0, 18.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "transpose",
"diag": "unit",
"uplo": "lower",
"strideX": 1,
"offsetX": 0,
"strideAP": 1,
"offsetAP": 0,
"N": 3,
"AP": [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 14.0, 8.0, 3.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "no-transpose",
"diag": "non-unit",
"uplo": "lower",
"strideAP": 2,
"offsetAP": 7,
"strideX": 1,
"offsetX": 0,
"N": 3,
"AP": [ 999, 999, 999, 999, 999, 999, 999, 1, 999, 2, 999, 3, 999, 4, 999, 5, 999, 6 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 1.0, 10.0, 31.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "transpose",
"diag": "unit",
"uplo": "lower",
"strideX": 1,
"offsetX": 2,
"strideAP": 1,
"offsetAP": 0,
"N": 3,
"AP": [ 1.0, 2.0, 3.0, 1.0, 2.0, 1.0 ],
"x": [ 0.0, 0.0, 1.0, 2.0, 3.0 ],
"x_out": [ 0.0, 0.0, 14.0, 8.0, 3.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "transpose",
"diag": "unit",
"uplo": "lower",
"strideX": 1,
"offsetX": 0,
"strideAP": 2,
"offsetAP": 1,
"N": 3,
"AP": [ 0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 1.0, 0.0, 2.0, 0.0, 1.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 14.0, 8.0, 3.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "transpose",
"diag": "unit",
"uplo": "lower",
"strideX": 1,
"offsetX": 0,
"strideAP": -2,
"offsetAP": 11,
"N": 3,
"AP": [ 0.0, 1.0, 0.0, 2.0, 0.0, 1.0, 0.0, 3.0, 0.0, 2.0, 0.0, 1.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 14.0, 8.0, 3.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "no-transpose",
"diag": "non-unit",
"uplo": "upper",
"strideX": 1,
"offsetX": 0,
"strideAP": 1,
"offsetAP": 0,
"N": 3,
"AP": [ 1.0, 2.0, 4.0, 3.0, 5.0, 6.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 14.0, 23.0, 18.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "no-transpose",
"diag": "unit",
"uplo": "upper",
"strideX": 1,
"offsetX": 0,
"strideAP": 1,
"offsetAP": 0,
"N": 3,
"AP": [ 1.0, 2.0, 1.0, 3.0, 2.0, 1.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 14.0, 8.0, 3.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "transpose",
"diag": "non-unit",
"uplo": "upper",
"strideX": 1,
"offsetX": 0,
"strideAP": 1,
"offsetAP": 0,
"N": 3,
"AP": [ 1.0, 2.0, 4.0, 3.0, 5.0, 6.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 1.0, 10.0, 31.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"order": "column-major",
"trans": "transpose",
"diag": "unit",
"uplo": "upper",
"strideX": 1,
"offsetX": 0,
"strideAP": 1,
"offsetAP": 0,
"N": 3,
"AP": [ 1.0, 2.0, 1.0, 3.0, 2.0, 1.0 ],
"x": [ 1.0, 2.0, 3.0 ],
"x_out": [ 1.0, 4.0, 10.0 ]
}
Loading

0 comments on commit fcb71c8

Please sign in to comment.