diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js new file mode 100644 index 000000000000..b42ac285400e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'no-transpose', N, N, N, alpha, A, 1, N, 0, B, 1, N, 0, beta, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js new file mode 100644 index 000000000000..a104e04efc1f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'transpose', N, N, N, alpha, A, 1, N, 0, B, 1, N, 0, beta, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js new file mode 100644 index 000000000000..8a52d4a9734d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'no-transpose', N, N, N, alpha, A, 1, N, 0, B, 1, N, 0, beta, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js new file mode 100644 index 000000000000..fc635aa24aae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'transpose', N, N, N, alpha, A, 1, N, 0, B, 1, N, 0, beta, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js new file mode 100644 index 000000000000..bb80ab5d45a4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js new file mode 100644 index 000000000000..8aa77b69825c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js new file mode 100644 index 000000000000..c77e8bd8f8e1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js new file mode 100644 index 000000000000..6c7c32cd26a0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js new file mode 100644 index 000000000000..fa26356af701 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js new file mode 100644 index 000000000000..c199425b1996 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js new file mode 100644 index 000000000000..a239af765b6b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js new file mode 100644 index 000000000000..91067c92d732 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js new file mode 100644 index 000000000000..83226b079842 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js new file mode 100644 index 000000000000..55028621a1f8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js new file mode 100644 index 000000000000..1ca071048362 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js new file mode 100644 index 000000000000..68037d817605 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_nta_ntb.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_nta_ntb.js new file mode 100644 index 000000000000..d7556ca2d4de --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_nta_ntb.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/zgemm.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'column-major', 'no-transpose', 'no-transpose', N, N, N, alpha, A, N, B, N, beta, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_nta_tb.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_nta_tb.js new file mode 100644 index 000000000000..09ca9dede51a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_nta_tb.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/zgemm.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'column-major', 'no-transpose', 'transpose', N, N, N, alpha, A, N, B, N, beta, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_ta_ntb.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_ta_ntb.js new file mode 100644 index 000000000000..266cc4369915 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_ta_ntb.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/zgemm.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'column-major', 'transpose', 'no-transpose', N, N, N, alpha, A, N, B, N, beta, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_ta_tb.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_ta_tb.js new file mode 100644 index 000000000000..4323872607f4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_column_major_ta_tb.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/zgemm.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'column-major', 'transpose', 'transpose', N, N, N, alpha, A, N, B, N, beta, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js new file mode 100644 index 000000000000..d2e7404a501e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js new file mode 100644 index 000000000000..575d3c238acb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js new file mode 100644 index 000000000000..e254a7aaadb8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js new file mode 100644 index 000000000000..7fb12bfb2545 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js new file mode 100644 index 000000000000..6f3fff5bdf22 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js new file mode 100644 index 000000000000..2b9abc858c11 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.js @@ -0,0 +1,126 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); + diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js new file mode 100644 index 000000000000..2618d231dfbb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js new file mode 100644 index 000000000000..ad08b66b4708 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js new file mode 100644 index 000000000000..2703dd6f3428 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js new file mode 100644 index 000000000000..cbdb0787fd14 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js new file mode 100644 index 000000000000..8b2d411c3df5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js new file mode 100644 index 000000000000..888a74a57716 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var N; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js new file mode 100644 index 000000000000..1942c3c71f38 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js new file mode 100644 index 000000000000..baaeea88aa43 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js new file mode 100644 index 000000000000..c6a9a6ad7720 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js new file mode 100644 index 000000000000..98e23fb58898 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_nta_ntb.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_nta_ntb.js new file mode 100644 index 000000000000..f3fc109a17a9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_nta_ntb.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/zgemm.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'row-major', 'no-transpose', 'no-transpose', N, N, N, alpha, A, N, B, N, beta, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_nta_tb.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_nta_tb.js new file mode 100644 index 000000000000..cecda5a8e7ed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_nta_tb.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/zgemm.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'row-major', 'no-transpose', 'transpose', N, N, N, alpha, A, N, B, N, beta, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_ta_ntb.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_ta_ntb.js new file mode 100644 index 000000000000..45d3f94a7330 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_ta_ntb.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/zgemm.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'row-major', 'transpose', 'no-transpose', N, N, N, alpha, A, N, B, N, beta, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_ta_tb.js b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_ta_tb.js new file mode 100644 index 000000000000..098082279373 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/benchmark/benchmark_row_major_ta_tb.js @@ -0,0 +1,125 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var pkg = require( './../package.json' ).name; +var zgemm = require( './../lib/zgemm.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var alpha; + var beta; + var abuf; + var bbuf; + var cbuf; + var A; + var B; + var C; + + abuf = uniform( (N*N)*2, -100.0, 100.0, options ); + A = new Complex128Array( abuf.buffer ); + + bbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + B = new Complex128Array( bbuf.buffer ); + + cbuf = uniform( (N*N)*2, -100.0, 100.0, options ); + C = new Complex128Array( cbuf.buffer ); + + alpha = new Complex128( 1.0, 0.0 ); + beta = new Complex128( 0.0, 0.0 ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zgemm( 'row-major', 'transpose', 'transpose', N, N, N, alpha, A, N, B, N, beta, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/zgemm/docs/repl.txt new file mode 100644 index 000000000000..347f6d196fb1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/docs/repl.txt @@ -0,0 +1,177 @@ + +{{alias}}( ord, ta, tb, M, N, K, α, A, lda, B, ldb, β, C, ldc ) + Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` + is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, + and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by + `N` matrix, and `C` an `M` by `N` matrix. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `M` or `N` is equal to `0`, the function returns `C` unchanged. + + If `α` or `K` equals `0` and `β` equals `1`, the function returns `C` + unchanged. + + Parameters + ---------- + ord: string + Row-major (C-style) or column-major (Fortran-style) order. + + ta: string + Specifies whether `A` should be transposed, conjugate-transposed, or not + transposed. + + tb: string + Specifies whether `B` should be transposed, conjugate-transposed, or not + transposed. + + M: integer + Number of rows in the matrix `op(A)` and in the matrix `C`. + + N: integer + Number of columns in the matrix `op(B)` and in the matrix `C`. + + K: integer + Number of columns in the matrix `op(A)` and number of rows in the matrix + `op(B)`. + + α: number + Complex constant. + + A: Complex128Array + First matrix. + + lda: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + B: Complex128Array + Second matrix. + + ldb: integer + Stride of the first dimension of `B` (a.k.a., leading dimension of the + matrix `B`). + + β: number + Complex constant. + + C: Complex128Array + Third matrix. + + ldc: integer + Stride of the first dimension of `C` (a.k.a., leading dimension of the + matrix `C`). + + Returns + ------- + C: Complex128Array + Third matrix. + + Examples + -------- + // Standard usage: + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var B = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 0.0, 1.0 ] ); + > var C = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var ord = 'row-major'; + > var ta = 'no-transpose'; + > var tb = 'no-transpose'; + > var alpha = new {{alias:@stdlib/complex/float64/ctor}}( 1.0, 2.0 ); + > var beta = new {{alias:@stdlib/complex/float64/ctor}}( 1.0, 2.0 ); + > {{alias}}( ord, ta, tb, 2, 2, 2, alpha, A, 2, B, 2, beta, C, 2 ) + [ 2.0, 5.0, 6.0, 11.0 ] + + +{{alias}}.ndarray(ta,tb, M,N,K, α, A,sa1,sa2,oa, B,sb1,sb2,ob, β, C,sc1,sc2,oc) + Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C`, using + alternative indexing semantics and where `op(X)` is either `op(X) = X` or + `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with + `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by + `N` matrix. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + ta: string + Specifies whether `A` should be transposed, conjugate-transposed, or not + transposed. + + tb: string + Specifies whether `B` should be transposed, conjugate-transposed, or not + transposed. + + M: integer + Number of rows in the matrix `op(A)` and in the matrix `C`. + + N: integer + Number of columns in the matrix `op(B)` and in the matrix `C`. + + K: integer + Number of columns in the matrix `op(A)` and number of rows in the matrix + `op(B)`. + + α: number + Complex constant. + + A: Complex128Array + First matrix. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index for `A`. + + B: Complex128Array + Second matrix. + + sb1: integer + Stride of the first dimension of `B`. + + sb2: integer + Stride of the second dimension of `B`. + + ob: integer + Starting index for `B`. + + β: number + Complex constant. + + C: Complex128Array + Third matrix. + + sc1: integer + Stride of the first dimension of `C`. + + sc2: integer + Stride of the second dimension of `C`. + + oc: integer + Starting index for `C`. + + Returns + ------- + C: Complex128Array + Third matrix. + + Examples + -------- + > var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var B = new {{alias:@stdlib/array/complex128}}( [ 1.0, 1.0, 0.0, 1.0 ] ); + > var C = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0 ] ); + > var ta = 'no-transpose'; + > var tb = 'no-transpose'; + > var alpha = new {{alias:@stdlib/complex/float64/ctor}}( 1.0, 2.0 ); + > var beta = new {{alias:@stdlib/complex/float64/ctor}}( 1.0, 2.0 ); + > {{alias}}.ndarray( ta,tb, 2,2,2, alpha, A,2,1,0, B,2,1,0, beta, C,2,1,0 ) + [ 2.0, 5.0, 6.0, 11.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/zgemm/docs/types/index.d.ts new file mode 100644 index 000000000000..fbf84a4d33bf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/docs/types/index.d.ts @@ -0,0 +1,155 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout, TransposeOperation } from '@stdlib/types/blas'; +import { Complex128Array } from '@stdlib/types/array'; +import { Complex128 } from '@stdlib/types/complex'; + +/** +* Interface describing `zgemm`. +*/ +interface Routine { + /** + * Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. + * + * @param order - storage layout + * @param transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed + * @param transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed + * @param M - number of rows in the matrix `op(A)` and in the matrix `C` + * @param N - number of columns in the matrix `op(B)` and in the matrix `C` + * @param K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` + * @param alpha - scalar constant + * @param A - first matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param B - second matrix + * @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) + * @param beta - scalar constant + * @param C - third matrix + * @param LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) + * @returns `C` + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * + * var A = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); + * var B = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0 ] ); + * var C = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); + * var alpha = new Complex128( 1.0, 0.0 ); + * var beta = new Complex128( 0.0, 0.0 ); + * + * zgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, alpha, A, 2, B, 2, beta, C, 2 ); + * // C => [ 0.0, 2.0, 0.0, 6.0, 0.0, 6.0, 0.0, 14.0 ] + */ + ( order: Layout, transA: TransposeOperation, transB: TransposeOperation, M: number, N: number, K: number, alpha: Complex128, A: Complex128Array, LDA: number, B: Complex128Array, LDB: number, beta: Complex128, C: Complex128Array, LDC: number ): Complex128Array; + + /** + * Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C`, using alternative indexing semantics and where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. + * + * @param transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed + * @param transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed + * @param M - number of rows in the matrix `op(A)` and in the matrix `C` + * @param N - number of columns in the matrix `op(B)` and in the matrix `C` + * @param K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` + * @param alpha - scalar constant + * @param A - first matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - starting index for `A` + * @param B - second matrix + * @param strideB1 - stride of the first dimension of `B` + * @param strideB2 - stride of the second dimension of `B` + * @param offsetB - starting index for `B` + * @param beta - scalar constant + * @param C - third matrix + * @param strideC1 - stride of the first dimension of `C` + * @param strideC2 - stride of the second dimension of `C` + * @param offsetC - starting index for `C` + * @returns `C` + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * + * var A = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); + * var B = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0 ] ); + * var C = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); + * var alpha = new Complex128( 1.0, 0.0 ); + * var beta = new Complex128( 0.0, 0.0 ); + * + * zgemm.ndarray( 'no-transpose', 'no-transpose', 2, 2, 2, alpha, A, 2, 1, 0, B, 2, 1, 0, beta, C, 2, 1, 0 ); + * // C => [ 0.0, 2.0, 0.0, 6.0, 0.0, 6.0, 0.0, 14.0 ] + */ + ndarray( transA: TransposeOperation, transB: TransposeOperation, M: number, N: number, K: number, alpha: Complex128, A: Complex128Array, strideA1: number, strideA2: number, offsetA: number, B: Complex128Array, strideB1: number, strideB2: number, offsetB: number, beta: Complex128, C: Complex128Array, strideC1: number, strideC2: number, offsetC: number ): Complex128Array; +} + +/** +* Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. +* +* @param order - storage layout +* @param transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param M - number of rows in the matrix `op(A)` and in the matrix `C` +* @param N - number of columns in the matrix `op(B)` and in the matrix `C` +* @param K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` +* @param alpha - scalar constant +* @param A - first matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param B - second matrix +* @param LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) +* @param beta - scalar constant +* @param C - third matrix +* @param LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) +* @returns `C` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var B = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0 ] ); +* var C = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var alpha = new Complex128( 1.0, 0.0 ); +* var beta = new Complex128( 0.0, 0.0 ); +* +* zgemm( 'column-major', 'no-transpose', 'no-transpose', 2, 2, 2, alpha, A, 2, B, 2, beta, C, 2 ); +* // C => [ 0.0, 2.0, 0.0, 6.0, 0.0, 6.0, 0.0, 14.0 ] +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var B = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0 ] ); +* var C = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var alpha = new Complex128( 1.0, 0.0 ); +* var beta = new Complex128( 0.0, 0.0 ); +* +* zgemm.ndarray( 'no-transpose', 'no-transpose', 2, 2, 2, alpha, A, 1, 2, 0, B, 1, 2, 0, beta, C, 1, 2, 0 ); +* // C => [ 0.0, 2.0, 0.0, 6.0, 0.0, 6.0, 0.0, 14.0 ] +*/ +declare var zgemm: Routine; + + +// EXPORTS // + +export = zgemm; diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/zgemm/docs/types/test.ts new file mode 100644 index 000000000000..7c65f24c7c13 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/docs/types/test.ts @@ -0,0 +1,694 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import Complex128Array = require( '@stdlib/array/complex128' ); +import Complex128 = require( '@stdlib/complex/float64/ctor' ); +import zgemm = require( './index' ); + + +// TESTS // + +// The function returns a Complex128Array... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 10, 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( true, 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( false, 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( null, 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( undefined, 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( [], 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( {}, 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( ( A: number ): number => A, 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 10, 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', true, 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', false, 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', null, 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', undefined, 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', [ '1' ], 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', {}, 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', ( A: number ): number => A, 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 10, 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', true, 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', false, 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', null, 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', undefined, 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', [ '1' ], 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', {}, 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', ( A: number ): number => A, 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', '10', 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', true, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', false, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', null, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', undefined, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', [], 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', {}, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', ( A: number ): number => A, 5, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, '10', 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, true, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, false, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, null, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, undefined, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, [], 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, {}, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, ( A: number ): number => A, 5, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, '10', alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, true, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, false, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, null, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, undefined, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, [], alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, {}, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, ( A: number ): number => A, alpha, A, 5, B, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a complex number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, '10', A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, true, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, false, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, null, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, undefined, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, [], A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, {}, A, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, ( A: number ): number => A, A, 5, B, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a Complex128Array... +{ + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, 10, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, '10', 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, true, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, false, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, null, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, undefined, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, [ '1' ], 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, {}, 5, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, ( A: number ): number => A, 5, B, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, '10', B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, true, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, false, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, null, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, undefined, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, [], B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, {}, B, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, ( A: number ): number => A, B, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a Complex128Array... +{ + const A = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 10, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, '10', 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, true, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, false, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, null, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, undefined, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, [ '1' ], 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, {}, 5, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, ( A: number ): number => A, 5, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eleventh argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, '10', beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, true, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, false, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, null, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, undefined, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, [], beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, {}, beta, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, ( A: number ): number => A, beta, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a complex number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, '10', C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, true, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, false, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, null, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, undefined, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, [], C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, {}, C, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, ( A: number ): number => A, C, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a thirteenth argument which is not a Complex128Array... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, 10, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, '10', 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, true, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, false, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, null, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, undefined, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, [ '1' ], 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, {}, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, ( A: number ): number => A, 5 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourteenth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, '10' ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, true ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, false ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, null ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, undefined ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, [] ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, {} ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, ( A: number ): number => A ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm(); // $ExpectError + zgemm( 'row-major' ); // $ExpectError + zgemm( 'row-major', 'no-transpose' ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose' ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, 1.0 ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C ); // $ExpectError + zgemm( 'row-major', 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, B, 5, beta, C, 5, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Complex128Array... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 10, 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( true, 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( false, 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( null, 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( undefined, 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( [ '1' ], 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( {}, 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( ( A: number ): number => A, 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 10, 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', true, 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', false, 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', null, 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', undefined, 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', [ '1' ], 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', {}, 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', ( A: number ): number => A, 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', '10', 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', true, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', false, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', null, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', undefined, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', [], 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', {}, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', ( A: number ): number => A, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, '10', 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, true, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, false, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, null, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, undefined, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, [], 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, {}, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, ( A: number ): number => A, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, '10', alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, true, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, false, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, null, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, undefined, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, [], alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, {}, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, ( A: number ): number => A, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a complex number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, '10', A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, true, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, false, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, null, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, undefined, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, [], A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, {}, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, ( A: number ): number => A, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Complex128Array... +{ + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, 10, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, '10', 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, true, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, false, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, null, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, undefined, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, [ '1' ], 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, {}, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, ( A: number ): number => A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, '10', 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, true, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, false, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, null, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, undefined, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, [], 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, {}, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, ( A: number ): number => A, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, '10', 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, true, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, false, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, null, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, undefined, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, [], 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, {}, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, ( A: number ): number => A, 0, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, '10', B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, true, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, false, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, null, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, undefined, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, [], B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, {}, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, ( A: number ): number => A, B, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eleventh argument which is not a Complex128Array... +{ + const A = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, 10, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, '10', 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, true, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, false, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, null, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, undefined, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, [ '1' ], 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, {}, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, ( A: number ): number => A, 5, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, '10', 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, true, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, false, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, null, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, undefined, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, [], 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, {}, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, ( A: number ): number => A, 1, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a thirteenth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, '10', 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, true, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, false, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, null, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, undefined, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, [], 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, {}, 0, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, ( A: number ): number => A, 0, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourteenth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, '10', beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, true, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, false, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, null, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, undefined, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, [], beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, {}, beta, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, ( A: number ): number => A, beta, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifteenth argument which is not a complex number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, '10', C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, true, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, false, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, null, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, undefined, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, [], C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, {}, C, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, ( A: number ): number => A, C, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixteenth argument which is not a Complex128Array... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, 10, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, '10', 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, true, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, false, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, null, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, undefined, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, [ '1' ], 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, {}, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, ( A: number ): number => A, 5, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventeenth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, '10', 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, true, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, false, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, null, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, undefined, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, [], 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, {}, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, ( A: number ): number => A, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighteenth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, '10', 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, true, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, false, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, null, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, undefined, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, [], 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, {}, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, ( A: number ): number => A, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a nineteenth argument which is not a number... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, '10' ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, true ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, false ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, null ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, undefined ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, [] ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, {} ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, ( A: number ): number => A ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const A = new Complex128Array( 25 ); + const B = new Complex128Array( 25 ); + const C = new Complex128Array( 25 ); + const alpha = new Complex128( 2.0, 2.0 ); + const beta = new Complex128( 2.0, 2.0 ); + + zgemm.ndarray(); // $ExpectError + zgemm.ndarray( 'no-transpose' ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose' ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, 1.0 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1 ); // $ExpectError + zgemm.ndarray( 'no-transpose', 'no-transpose', 5, 5, 5, alpha, A, 5, 1, 0, B, 5, 1, 0, beta, C, 5, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/examples/index.js b/lib/node_modules/@stdlib/blas/base/zgemm/examples/index.js new file mode 100644 index 000000000000..e4921b8f8e32 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/examples/index.js @@ -0,0 +1,47 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var zgemm = require( './../lib' ); + +function rand() { + return new Complex128( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +var A = filledarrayBy( 16, 'complex128', rand ); +console.log( A.toString() ); + +var B = filledarrayBy( 16, 'complex128', rand ); +console.log( B.toString() ); + +var C = filledarrayBy( 16, 'complex128', rand ); +console.log( C.toString() ); + +var alpha = new Complex128( 2.0, 2.0 ); +console.log( alpha.toString() ); + +var beta = new Complex128( 2.0, 2.0 ); +console.log( beta.toString() ); + +zgemm( 'row-major', 'no-transpose', 'no-transpose', M, N, K, 1.0, A, K, B, N, 1.0, C, N ); +console.log( C ); + +zgemm.ndarray( 'no-transpose', 'no-transpose', M, N, K, 1.0, A, K, 1, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); +console.log( C ); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/lib/base.js b/lib/node_modules/@stdlib/blas/base/zgemm/lib/base.js new file mode 100644 index 000000000000..41988db6ca79 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/lib/base.js @@ -0,0 +1,475 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len, max-params */ + +'use strict'; + +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var ddot = require( '@stdlib/blas/base/ddot' ).ndarray; +var blockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' ); + + +// VARIABLES // + +var bsize = blockSize( 'float64', 'float64' ); // TODO: consider using a larger block size + + +// FUNCTIONS // + +/** +* Tests whether a provided string indicates to transpose a matrix. +* +* @private +* @param {string} str - input string +* @returns {boolean} boolean indicating whether to transpose a matrix +* +* @example +* var bool = isTransposed( 'transpose' ); +* // returns true +* +* @example +* var bool = isTransposed( 'conjugate-transpose' ); +* // returns true +* +* @example +* var bool = isTransposed( 'no-transpose' ); +* // returns false +*/ +function isTransposed( str ) { // TODO: consider moving to a separate helper utility package + return ( str !== 'no-transpose' ); +} + +/** +* Fills a matrix with zeros. +* +* @private +* @param {NonNegativeInteger} M - number of rows +* @param {NonNegativeInteger} N - number of columns +* @param {Float64Array} X - matrix to fill +* @param {integer} strideX1 - stride of the first dimension of `X` +* @param {integer} strideX2 - stride of the second dimension of `X` +* @param {NonNegativeInteger} offsetX - starting index for `X` +* @returns {Float64Array} input matrix +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var X = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* +* zeros( 2, 3, X, 3, 1, 0 ); +* // X => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var X = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* +* zeros( 2, 3, X, 1, 2, 0 ); +* // X => [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] +*/ +function zeros( M, N, X, strideX1, strideX2, offsetX ) { // TODO: consider moving to a separate package + var dx0; + var dx1; + var S0; + var S1; + var i0; + var i1; + var ix; + + if ( isRowMajor( [ strideX1, strideX2 ] ) ) { + // For row-major matrices, the last dimension has the fastest changing index... + S0 = N; + S1 = M; + dx0 = strideX2; // offset increment for innermost loop + dx1 = strideX1 - ( S0*strideX2 ); // offset increment for outermost loop + } else { // column-major + // For column-major matrices, the first dimension has the fastest changing index... + S0 = M; + S1 = N; + dx0 = strideX1; // offset increment for innermost loop + dx1 = strideX2 - ( S0*strideX1 ); // offset increment for outermost loop + } + ix = offsetX; + for ( i1 = 0; i1 < S1; i1++ ) { + for ( i0 = 0; i0 < S0; i0++ ) { + X[ ix ] = 0.0; + ix += dx0; + } + ix += dx1; + } + return X; +} + +/** +* Scales each element in a matrix by a scalar `β`. +* +* @private +* @param {NonNegativeInteger} M - number of rows +* @param {NonNegativeInteger} N - number of columns +* @param {number} beta - scalar +* @param {Float64Array} X - matrix to fill +* @param {integer} strideX1 - stride of the first dimension of `X` +* @param {integer} strideX2 - stride of the second dimension of `X` +* @param {NonNegativeInteger} offsetX - starting index for `X` +* @returns {Float64Array} input matrix +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var X = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* +* scal( 2, 3, 5.0, X, 3, 1, 0 ); +* // X => [ 5.0, 10.0, 15.0, 20.0, 25.0, 30.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var X = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); +* +* scal( 2, 3, 5.0, X, 1, 2, 0 ); +* // X => [ 5.0, 10.0, 15.0, 20.0, 25.0, 30.0 ] +*/ +function scal( M, N, beta, X, strideX1, strideX2, offsetX ) { // TODO: consider moving to a separate package + var dx0; + var dx1; + var S0; + var S1; + var i0; + var i1; + var ix; + + if ( isRowMajor( [ strideX1, strideX2 ] ) ) { + // For row-major matrices, the last dimension has the fastest changing index... + S0 = N; + S1 = M; + dx0 = strideX2; // offset increment for innermost loop + dx1 = strideX1 - ( S0*strideX2 ); // offset increment for outermost loop + } else { // column-major + // For column-major matrices, the first dimension has the fastest changing index... + S0 = M; + S1 = N; + dx0 = strideX1; // offset increment for innermost loop + dx1 = strideX2 - ( S0*strideX1 ); // offset increment for outermost loop + } + ix = offsetX; + for ( i1 = 0; i1 < S1; i1++ ) { + for ( i0 = 0; i0 < S0; i0++ ) { + X[ ix ] *= beta; + ix += dx0; + } + ix += dx1; + } + return X; +} + +/** +* Performs matrix multiplication using a naive algorithm which is cache-optimal when `A` is row-major and `B` is column-major. +* +* @private +* @param {NonNegativeInteger} M - number of rows in the matrix `op(A)` and in the matrix `C` +* @param {NonNegativeInteger} N - number of columns in the matrix `op(B)` and in the matrix `C` +* @param {NonNegativeInteger} K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` +* @param {number} alpha - scalar constant +* @param {Float64Array} A - first matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} B - second matrix +* @param {integer} strideB1 - stride of the first dimension of `B` +* @param {integer} strideB2 - stride of the second dimension of `B` +* @param {NonNegativeInteger} offsetB - starting index for `B` +* @param {Float64Array} C - third matrix +* @param {integer} strideC1 - stride of the first dimension of `C` +* @param {integer} strideC2 - stride of the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @returns {Float64Array} `C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var B = new Float64Array( [ 1.0, 1.0, 0.0, 1.0 ] ); +* var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* +* naive( 2, 2, 2, 1.0, A, 2, 1, 0, B, 2, 1, 0, C, 2, 1, 0 ); +* // C => [ 2.0, 5.0, 6.0, 11.0 ] +*/ +function naive( M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, C, strideC1, strideC2, offsetC ) { + var da0; + var db0; + var dc0; + var dc1; + var S0; + var S1; + var i0; + var i1; + var ia; + var ib; + var ic; + + // Note on variable naming convention: S#, da#, db#, dc#, i# where # corresponds to the loop number, with `0` being the innermost loop... + + S0 = N; + S1 = M; + da0 = strideA2; + db0 = strideB1; + dc0 = strideC2; // offset increment for innermost loop + dc1 = strideC1 - ( S0*strideC2 ); // offset increment for outermost loop + + ic = offsetC; + for ( i1 = 0; i1 < S1; i1++ ) { + ia = offsetA + ( i1*strideA1 ); + for ( i0 = 0; i0 < S0; i0++ ) { + ib = offsetB + ( i0*strideB2 ); + C[ ic ] += alpha * ddot( K, A, da0, ia, B, db0, ib ); + ic += dc0; + } + ic += dc1; + } + return C; +} + +/** +* Performs matrix multiplication using loop tiling. +* +* @private +* @param {NonNegativeInteger} M - number of rows in the matrix `op(A)` and in the matrix `C` +* @param {NonNegativeInteger} N - number of columns in the matrix `op(B)` and in the matrix `C` +* @param {NonNegativeInteger} K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` +* @param {number} alpha - scalar constant +* @param {Float64Array} A - first matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} B - second matrix +* @param {integer} strideB1 - stride of the first dimension of `B` +* @param {integer} strideB2 - stride of the second dimension of `B` +* @param {NonNegativeInteger} offsetB - starting index for `B` +* @param {Float64Array} C - third matrix +* @param {integer} strideC1 - stride of the first dimension of `C` +* @param {integer} strideC2 - stride of the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @returns {Float64Array} `C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var B = new Float64Array( [ 1.0, 1.0, 0.0, 1.0 ] ); +* var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* +* blocked( 2, 2, 2, 1.0, A, 2, 1, 0, B, 2, 1, 0, C, 2, 1, 0 ); +* // C => [ 2.0, 5.0, 6.0, 11.0 ] +*/ +function blocked( M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, C, strideC1, strideC2, offsetC ) { + var da0; + var db0; + var dc0; + var dc1; + var oa1; + var ob0; + var oc0; + var oc1; + var S0; + var S1; + var s0; + var s1; + var sk; + var i0; + var i1; + var j0; + var j1; + var ia; + var ib; + var ic; + var oa; + var ob; + var k; + + // Note on variable naming convention: S#, da#, db#, dc#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... + + S0 = N; + S1 = M; + + // Define increments for the innermost loop: + da0 = strideA2; + db0 = strideB1; + dc0 = strideC2; + + // Iterate over blocks... + for ( j1 = S1; j1 > 0; ) { + if ( j1 < bsize ) { + s1 = j1; + j1 = 0; + } else { + s1 = bsize; + j1 -= bsize; + } + oa1 = offsetA + ( j1*strideA1 ); + oc1 = offsetC + ( j1*strideC1 ); + for ( j0 = S0; j0 > 0; ) { + if ( j0 < bsize ) { + s0 = j0; + j0 = 0; + } else { + s0 = bsize; + j0 -= bsize; + } + ob0 = offsetB + ( j0*strideB2 ); + oc0 = oc1 + ( j0*strideC2 ); // index offset for `C` for the current block + dc1 = strideC1 - ( s0*strideC2 ); // loop offset increment for `C` + for ( k = K; k > 0; ) { + if ( k < bsize ) { + sk = k; + k = 0; + } else { + sk = bsize; + k -= bsize; + } + oa = oa1 + ( k*strideA2 ); + ob = ob0 + ( k*strideB1 ); + ic = oc0; + for ( i1 = 0; i1 < s1; i1++ ) { + ia = oa + ( i1*strideA1 ); + for ( i0 = 0; i0 < s0; i0++ ) { + ib = ob + ( i0*strideB2 ); + C[ ic ] += alpha * ddot( sk, A, da0, ia, B, db0, ib ); + ic += dc0; + } + ic += dc1; + } + } + } + } + return C; +} + + +// MAIN // + +/** +* Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. +* +* @private +* @param {string} transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param {NonNegativeInteger} M - number of rows in the matrix `op(A)` and in the matrix `C` +* @param {NonNegativeInteger} N - number of columns in the matrix `op(B)` and in the matrix `C` +* @param {NonNegativeInteger} K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` +* @param {number} alpha - scalar constant +* @param {Float64Array} A - first matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} B - second matrix +* @param {integer} strideB1 - stride of the first dimension of `B` +* @param {integer} strideB2 - stride of the second dimension of `B` +* @param {NonNegativeInteger} offsetB - starting index for `B` +* @param {number} beta - scalar constant +* @param {Float64Array} C - third matrix +* @param {integer} strideC1 - stride of the first dimension of `C` +* @param {integer} strideC2 - stride of the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @returns {Float64Array} `C` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var B = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0 ] ); +* var C = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var alpha = new Complex128( 1.0, 0.0 ); +* var beta = new Complex128( 0.0, 0.0 ); +* +* zgemm( 'no-transpose', 'no-transpose', 2, 2, 2, alpha, A, 2, 1, 0, B, 2, 1, 0, beta, C, 2, 1, 0 ); +* // C => [ 0.0, 2.0, 0.0, 6.0, 0.0, 6.0, 0.0, 14.0 ] +*/ +function dgemm( transA, transB, M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, beta, C, strideC1, strideC2, offsetC ) { + var isrma; + var isrmb; + var sa1; + var sa2; + var sb1; + var sb2; + + if ( M === 0 || N === 0 || ( ( beta === 1.0 ) && ( ( alpha === 0.0 ) || ( K === 0 ) ) ) ) { + return C; + } + // Form: C = β⋅C + if ( beta === 0.0 ) { + C = zeros( M, N, C, strideC1, strideC2, offsetC ); + } else if ( beta !== 1.0 ) { + C = scal( M, N, beta, C, strideC1, strideC2, offsetC ); + } + // Check whether we can early return... + if ( alpha === 0.0 ) { + return C; + } + // Determine the memory layouts of `A` and `B`... + isrma = isRowMajor( [ strideA1, strideA2 ] ); + isrmb = isRowMajor( [ strideB1, strideB2 ] ); + + // Check whether we can avoid loop tiling and simply use the "naive" (cache-optimal) algorithm for performing matrix multiplication... + if ( isrma ) { // orderA === 'row-major' + if ( !isTransposed( transA ) ) { + if ( !isrmb && !isTransposed( transB ) ) { // orderB === 'column-major' + // Form: C = α⋅A⋅B + C + return naive( M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, C, strideC1, strideC2, offsetC ); + } + if ( isrmb && isTransposed( transB ) ) { // orderB === 'row-major' + // Form: C = α⋅A⋅B^T + C + return naive( M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB2, strideB1, offsetB, C, strideC1, strideC2, offsetC ); + } + } + } else if ( isTransposed( transA ) ) { // orderA === 'column-major' + if ( isrmb && isTransposed( transB ) ) { // orderB === 'row-major' + // Form: C = α⋅A^T⋅B^T + C + return naive( M, N, K, alpha, A, strideA2, strideA1, offsetA, B, strideB2, strideB1, offsetB, C, strideC1, strideC2, offsetC ); + } + if ( !isrmb && !isTransposed( transB ) ) { // orderB === 'column-major' + // Form: C = α⋅A^T⋅B + C + return naive( M, N, K, alpha, A, strideA2, strideA1, offsetA, B, strideB1, strideB2, offsetB, C, strideC1, strideC2, offsetC ); + } + } + // Swap strides to perform transposes... + if ( isTransposed( transA ) ) { + sa1 = strideA2; + sa2 = strideA1; + } else { + sa1 = strideA1; + sa2 = strideA2; + } + if ( isTransposed( transB ) ) { + sb1 = strideB2; + sb2 = strideB1; + } else { + sb1 = strideB1; + sb2 = strideB2; + } + // Perform loop tiling to promote cache locality: + return blocked( M, N, K, alpha, A, sa1, sa2, offsetA, B, sb1, sb2, offsetB, C, strideC1, strideC2, offsetC ); +} + + +// EXPORTS // + +module.exports = dgemm; diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/lib/index.js b/lib/node_modules/@stdlib/blas/base/zgemm/lib/index.js new file mode 100644 index 000000000000..aa7851b80f78 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/lib/index.js @@ -0,0 +1,78 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* BLAS level 3 routine to perform the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. +* +* @module @stdlib/blas/base/zgemm +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* var zgemm = require( '@stdlib/blas/base/zgemm' ); +* +* var A = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var B = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0 ] ); +* var C = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var alpha = new Complex128( 1.0, 0.0 ); +* var beta = new Complex128( 0.0, 0.0 ); +* +* zgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, alpha, A, 2, B, 2, beta, C, 2 ); +* // C => [ 0.0, 2.0, 0.0, 6.0, 0.0, 6.0, 0.0, 14.0 ] +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* var zgemm = require( '@stdlib/blas/base/zgemm' ); +* +* var A = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var B = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0 ] ); +* var C = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var alpha = new Complex128( 1.0, 0.0 ); +* var beta = new Complex128( 0.0, 0.0 ); +* +* zgemm.ndarray( 'no-transpose', 'no-transpose', 2, 2, 2, alpha, A, 2, 1, 0, B, 2, 1, 0, beta, C, 2, 1, 0 ); +* // C => [ 0.0, 2.0, 0.0, 6.0, 0.0, 6.0, 0.0, 14.0 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var zgemm; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + zgemm = main; +} else { + zgemm = tmp; +} + + +// EXPORTS // + +module.exports = zgemm; + +// exports: { "ndarray": "zgemm.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/lib/main.js b/lib/node_modules/@stdlib/blas/base/zgemm/lib/main.js new file mode 100644 index 000000000000..460a9c66e467 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var zgemm = require( './zgemm.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( zgemm, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = zgemm; diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/lib/ndarray.js new file mode 100644 index 000000000000..fddb038771bb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/lib/ndarray.js @@ -0,0 +1,102 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. +* +* @param {string} transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param {NonNegativeInteger} M - number of rows in the matrix `op(A)` and in the matrix `C` +* @param {NonNegativeInteger} N - number of columns in the matrix `op(B)` and in the matrix `C` +* @param {NonNegativeInteger} K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` +* @param {number} alpha - scalar constant +* @param {Float64Array} A - first matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} B - second matrix +* @param {integer} strideB1 - stride of the first dimension of `B` +* @param {integer} strideB2 - stride of the second dimension of `B` +* @param {NonNegativeInteger} offsetB - starting index for `B` +* @param {number} beta - scalar constant +* @param {Float64Array} C - third matrix +* @param {integer} strideC1 - stride of the first dimension of `C` +* @param {integer} strideC2 - stride of the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @throws {TypeError} first argument must be a valid transpose operation +* @throws {TypeError} second argument must be a valid transpose operation +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} fourth argument must be a nonnegative integer +* @throws {RangeError} fifth argument must be a nonnegative integer +* @throws {RangeError} seventeenth argument must be non-zero +* @throws {RangeError} eighteenth argument must be non-zero +* @returns {Float64Array} `C` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var B = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0 ] ); +* var C = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var alpha = new Complex128( 1.0, 0.0 ); +* var beta = new Complex128( 0.0, 0.0 ); +* +* zgemm( 'no-transpose', 'no-transpose', 2, 2, 2, alpha, A, 2, 1, 0, B, 2, 1, 0, beta, C, 2, 1, 0 ); +* // C => [ 0.0, 2.0, 0.0, 6.0, 0.0, 6.0, 0.0, 14.0 ] +*/ +function zgemm( transA, transB, M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, beta, C, strideC1, strideC2, offsetC ) { // eslint-disable-line max-params, max-len + if ( !isMatrixTranspose( transA ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid transpose operation. Value: `%s`.', transA ) ); + } + if ( !isMatrixTranspose( transB ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', transB ) ); + } + if ( M < 0 ) { + throw new RangeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', M ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', M ) ); + } + if ( K < 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', K ) ); + } + if ( strideC1 === 0 ) { + throw new RangeError( format( 'invalid argument. Seventeenth argument must be non-zero. Value: `%d`.', strideC1 ) ); + } + if ( strideC2 === 0 ) { + throw new RangeError( format( 'invalid argument. Eighteenth argument must be non-zero. Value: `%d`.', strideC2 ) ); + } + return base( transA, transB, M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, beta, C, strideC1, strideC2, offsetC ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = zgemm; diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/lib/zgemm.js b/lib/node_modules/@stdlib/blas/base/zgemm/lib/zgemm.js new file mode 100644 index 000000000000..ee2aabc21875 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/lib/zgemm.js @@ -0,0 +1,159 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var max = require( '@stdlib/math/base/special/fast/max' ); +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. +* +* @param {string} order - storage layout +* @param {string} transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param {NonNegativeInteger} M - number of rows in the matrix `op(A)` and in the matrix `C` +* @param {NonNegativeInteger} N - number of columns in the matrix `op(B)` and in the matrix `C` +* @param {NonNegativeInteger} K - number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)` +* @param {number} alpha - scalar constant +* @param {Complex128Array} A - first matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Complex128Array} B - second matrix +* @param {PositiveInteger} LDB - stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`) +* @param {number} beta - scalar constant +* @param {Complex128Array} C - third matrix +* @param {PositiveInteger} LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must be a valid transpose operation +* @throws {TypeError} third argument must be a valid transpose operation +* @throws {RangeError} fourth argument must be a nonnegative integer +* @throws {RangeError} fifth argument must be a nonnegative integer +* @throws {RangeError} sixth argument must be a nonnegative integer +* @throws {RangeError} ninth argument must be greater than or equal to max(1,M) when `A` is not transposed and max(1,K) otherwise +* @throws {RangeError} eleventh argument must be greater than or equal to max(1,K) when `B` is not transposed and max(1,N) otherwise +* @throws {RangeError} fourteenth argument must be greater than or equal to max(1,M) +* @returns {Complex128Array} `C` +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var A = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var B = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0 ] ); +* var C = new Complex128Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ] ); +* var alpha = new Complex128( 1.0, 0.0 ); +* var beta = new Complex128( 0.0, 0.0 ); +* +* zgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, alpha, A, 2, B, 2, beta, C, 2 ); +* // C => [ 0.0, 2.0, 0.0, 6.0, 0.0, 6.0, 0.0, 14.0 ] +*/ +function zgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, LDC ) { // eslint-disable-line max-params, max-len + var nrowsa; + var nrowsb; + var valc; + var isrm; + var iscm; + var sa1; + var sa2; + var sb1; + var sb2; + var sc1; + var sc2; + + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( !isMatrixTranspose( transA ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', transA ) ); + } + if ( !isMatrixTranspose( transB ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', transB ) ); + } + if ( M < 0 ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', M ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', M ) ); + } + if ( K < 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be a nonnegative integer. Value: `%d`.', K ) ); + } + isrm = isRowMajor( order ); + iscm = isColumnMajor( order ); + if ( + ( isrm && transA === 'no-transpose' ) || + ( iscm && transA === 'transpose' ) + ) { + nrowsa = K; + } else { + nrowsa = M; + } + if ( + ( isrm && transB === 'no-transpose' ) || + ( iscm && transB === 'transpose' ) + ) { + nrowsb = N; + } else { + nrowsb = K; + } + if ( LDA < max( 1, nrowsa ) ) { + throw new RangeError( format( 'invalid argument. Ninth argument must be greater than or equal to max(1,%d). Value: `%d`.', nrowsa, LDA ) ); + } + if ( LDB < max( 1, nrowsb ) ) { + throw new RangeError( format( 'invalid argument. Eleventh argument must be greater than or equal to max(1,%d). Value: `%d`.', nrowsb, LDB ) ); + } + if ( isrm ) { + valc = N; + } else { + valc = M; + } + if ( LDC < max( 1, valc ) ) { + throw new RangeError( format( 'invalid argument. Fourteenth argument must be greater than or equal to max(1,%d). Value: `%d`.', valc, LDC ) ); + } + if ( iscm ) { + sa1 = 1; + sa2 = LDA; + sb1 = 1; + sb2 = LDB; + sc1 = 1; + sc2 = LDC; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + sb1 = LDB; + sb2 = 1; + sc1 = LDC; + sc2 = 1; + } + return base( transA, transB, M, N, K, alpha, A, sa1, sa2, 0, B, sb1, sb2, 0, beta, C, sc1, sc2, 0 ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = zgemm; diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/package.json b/lib/node_modules/@stdlib/blas/base/zgemm/package.json new file mode 100644 index 000000000000..da141b9caf76 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/blas/base/zgemm", + "version": "0.0.0", + "description": "Perform the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is either `op(X) = X` or `op(X) = X^T`.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "level 3", + "zgemm", + "gemm", + "matmul", + "matrix multiplication", + "matrix", + "multiplication", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "complex128", + "double", + "complex128array" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_nta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_nta_ntb.json new file mode 100644 index 000000000000..1576b29f46e9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_nta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 1, + "strideB2": 3, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_nta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_nta_tb.json new file mode 100644 index 000000000000..34027da6cd7c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_nta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 1, + "strideB2": 4, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_ta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_ta_ntb.json new file mode 100644 index 000000000000..ae76353c7900 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_ta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 1, + "strideB2": 3, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_ta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_ta_tb.json new file mode 100644 index 000000000000..7657fe2675c1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_cc_ta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 1, + "strideB2": 4, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_nta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_nta_ntb.json new file mode 100644 index 000000000000..c177bd00f705 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_nta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 1, + "strideB2": 3, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0 ], + [ 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_nta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_nta_tb.json new file mode 100644 index 000000000000..b0ad86012fba --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_nta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 1, + "strideB2": 4, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0 ], + [ 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ] + ], + "ldc": 4, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_ta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_ta_ntb.json new file mode 100644 index 000000000000..cfe7b9bbd12c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_ta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 1, + "strideB2": 3, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 4, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_ta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_ta_tb.json new file mode 100644 index 000000000000..49bb8a527105 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_cb_rc_ta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 1, + "strideB2": 4, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 4, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_nta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_nta_ntb.json new file mode 100644 index 000000000000..7c1dfe62bc16 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_nta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 4, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_nta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_nta_tb.json new file mode 100644 index 000000000000..40321bfc32ee --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_nta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 3, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1_sa2.json new file mode 100644 index 000000000000..e37b68c265e2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1_sa2.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 0.0, 0.0, 3.0, 3.0, 0.0, 0.0, 5.0, 5.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 4.0, 4.0, 0.0, 0.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 5.0, 5.0, 4.0, 4.0 ], + [ 3.0, 3.0, 2.0, 2.0, 6.0, 6.0 ] + ], + "lda": 4, + "strideA1": 2, + "strideA2": 4, + "offsetA": 1, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 4, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1_sa2n.json new file mode 100644 index 000000000000..f80c147c8144 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1_sa2n.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 4.0, 4.0, 6.0, 6.0, 0.0, 0.0, 0.0, 0.0, 5.0, 5.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 3.0, 3.0 ], + "A_mat": [ + [ 1.0, 1.0, 5.0, 5.0, 4.0, 4.0 ], + [ 3.0, 3.0, 2.0, 2.0, 6.0, 6.0 ] + ], + "lda": 4, + "strideA1": 1, + "strideA2": -4, + "offsetA": 8, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 4, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1n_sa2.json new file mode 100644 index 000000000000..4815229a7f0c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1n_sa2.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 3.0, 3.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 6.0, 6.0, 4.0, 4.0 ], + "A_mat": [ + [ 1.0, 1.0, 5.0, 5.0, 4.0, 4.0 ], + [ 3.0, 3.0, 2.0, 2.0, 6.0, 6.0 ] + ], + "lda": 4, + "strideA1": -1, + "strideA2": 4, + "offsetA": 1, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 4, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1n_sa2n.json new file mode 100644 index 000000000000..0ed0c1444867 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_ntb_sa1n_sa2n.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 6.0, 6.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 1.0, 1.0 ], + "A_mat": [ + [ 1.0, 1.0, 5.0, 5.0, 4.0, 4.0 ], + [ 3.0, 3.0, 2.0, 2.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": -2, + "strideA2": -1, + "offsetA": 5, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 4, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_tb.json new file mode 100644 index 000000000000..20965a0013fe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_cc_ta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 3, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_nta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_nta_ntb.json new file mode 100644 index 000000000000..c1ccda136c0a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_nta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 4, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 4, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_nta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_nta_tb.json new file mode 100644 index 000000000000..480e39787b9b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_nta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 3, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 4, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_ta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_ta_ntb.json new file mode 100644 index 000000000000..c0363c3a7b0e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_ta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 4, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 4, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_ta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_ta_tb.json new file mode 100644 index 000000000000..b3e173d01aee --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ca_rb_rc_ta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 3, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 4, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_nta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_nta_ntb.json new file mode 100644 index 000000000000..25cfc833409b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_nta_ntb.json @@ -0,0 +1,39 @@ +{ + "order": "column-major", + "transA": "no-transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "StrideA1": 1, + "StrideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "StrideB1": 1, + "StrideB2": 3, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "StrideC1": 1, + "StrideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_nta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_nta_tb.json new file mode 100644 index 000000000000..55199ca91e50 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_nta_tb.json @@ -0,0 +1,39 @@ +{ + "order": "column-major", + "transA": "no-transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 1, + "strideB2": 4, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_ta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_ta_ntb.json new file mode 100644 index 000000000000..66293835d884 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_ta_ntb.json @@ -0,0 +1,39 @@ +{ + "order": "column-major", + "transA": "transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 3, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_ta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_ta_tb.json new file mode 100644 index 000000000000..785eea4d108e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/column_major_ta_tb.json @@ -0,0 +1,39 @@ +{ + "order": "column-major", + "transA": "transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 3.0, 3.0, 5.0, 5.0 ], + [ 2.0, 2.0, 4.0, 4.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 2, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 4, + "strideB2": 1, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_nta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_nta_ntb.json new file mode 100644 index 000000000000..8689f12cbed2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_nta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 1, + "strideB2": 3, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_nta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_nta_tb.json new file mode 100644 index 000000000000..1f91c0f66a3d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_nta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 1, + "strideB2": 4, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_ta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_ta_ntb.json new file mode 100644 index 000000000000..37f94a45305b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_ta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0 ], + [ 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 1, + "strideB2": 3, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_ta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_ta_tb.json new file mode 100644 index 000000000000..576a4a721842 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_cc_ta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0, 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 4.0, 4.0, 2.0, 2.0 ], + [ 5.0, 5.0, 3.0, 3.0, 6.0, 6.0 ] + ], + "lda": 2, + "strideA1": 2, + "strideA2": 1, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 1, + "strideB2": 4, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 5.0, 5.0, 2.0, 2.0, 6.0, 6.0, 3.0, 3.0, 7.0, 7.0, 4.0, 4.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 2, + "strideC1": 1, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 20.0, 8.0, 21.0, 9.0, 22.0, 10.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_ntb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_ntb.json new file mode 100644 index 000000000000..182236f4e0b4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_ntb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "no-transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 3, + "strideB1": 1, + "strideB2": 3, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 4, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_tb.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_tb.json new file mode 100644 index 000000000000..6c6e60835aa2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_tb.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 1, + "strideB2": 4, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 4, + "strideC1": 4, + "strideC2": 1, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_tb_sc1_sc2.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_tb_sc1_sc2.json new file mode 100644 index 000000000000..dd6622ad6030 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_tb_sc1_sc2.json @@ -0,0 +1,38 @@ +{ + "transA": "no-transpose", + "transB": "transpose", + "M": 2, + "N": 4, + "K": 3, + "alpha": [ 1.0, 0.0 ], + "A": [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ], + "A_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ], + [ 4.0, 4.0, 5.0, 5.0, 6.0, 6.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + "B_mat": [ + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], + [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] + ], + "ldb": 4, + "strideB1": 1, + "strideB2": 4, + "offsetB": 0, + "beta": [ 0.0, 0.0 ], + "C": [ 1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 0.0, 0.0, 5.0, 5.0, 0.0, 0.0, 6.0, 6.0, 0.0, 0.0, 7.0, 7.0, 0.0, 0.0, 8.0, 8.0 ], + "C_mat": [ + [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0 ], + [ 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0 ] + ], + "ldc": 8, + "strideC1": 8, + "strideC2": 2, + "offsetC": 0, + "C_out": [ 7.0, 8.0, 9.0, 10.0, 20.0, 21.0, 22.0, 23.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_tb_sc1_sc2n.json b/lib/node_modules/@stdlib/blas/base/zgemm/test/fixtures/ra_cb_rc_nta_tb_sc1_sc2n.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/test.js b/lib/node_modules/@stdlib/blas/base/zgemm/test/test.js new file mode 100644 index 000000000000..bc4f8913ab2f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zgemm/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var zgemm = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof zgemm, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof zgemm.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var zgemm = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( zgemm, mock, 'returns expected value' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var zgemm; + var main; + + main = require( './../lib/zgemm.js' ); + + zgemm = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( zgemm, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/zgemm/test/test.ndarray.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/lib/node_modules/@stdlib/blas/base/zgemm/test/test.zgemm.js b/lib/node_modules/@stdlib/blas/base/zgemm/test/test.zgemm.js new file mode 100644 index 000000000000..e69de29bb2d1