diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/benchmark/benchmark.js new file mode 100644 index 000000000000..d85886f1ada7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/benchmark/benchmark.js @@ -0,0 +1,145 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 zeros = require( '@stdlib/array/zeros' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var Float64Array = require( '@stdlib/array/float64' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dorm2r = require( './../lib/dorm2r.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var SIDES = [ + 'left', + 'right' +]; +var TRANS = [ + 'no-transpose', + 'transpose' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {string} side - specifies the side of multiplication +* @param {string} trans - specifies the operation to be performed +* @param {PositiveInteger} N - number of rows/columns in matrix C +* @returns {Function} benchmark function +*/ +function createBenchmark( order, side, trans, N ) { + var opts; + var work; + var tau; + var A; + var C; + + opts = { + 'dtype': 'float64' + }; + + A = zeros( N*N, 'float64' ); + C = uniform( N*N, -10.0, 10.0, opts ); + tau = uniform( N, 0.0, 2.0, opts ); + work = new Float64Array( N ); + + 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 = dorm2r( order, side, trans, N, N, N, A, N, tau, C, N, work ); + 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 trans; + var side; + var ord; + var min; + var max; + var N; + var f; + var i; + var j; + var k; + + min = 1; // 10^min + max = 3; // 10^max + + for ( i = 0; i < LAYOUTS.length; i++ ) { + ord = LAYOUTS[ i ]; + for ( j = 0; j < SIDES.length; j++ ) { + side = SIDES[ j ]; + for ( k = 0; k < TRANS.length; k++ ) { + trans = TRANS[ k ]; + for ( N = min; N <= max; N++ ) { + f = createBenchmark( ord, side, trans, floor( pow( pow( 10, N ), 1.0/2.0 ) ) ); + bench( format( '%s:order=%s,side=%s,trans=%s,size=%d', pkg, ord, side, trans, N*N ), f ); + } + } + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..43c18c744d4f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/benchmark/benchmark.ndarray.js @@ -0,0 +1,135 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 zeros = require( '@stdlib/array/zeros' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var Float64Array = require( '@stdlib/array/float64' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dorm2r = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var SIDES = [ + 'left', + 'right' +]; +var TRANS = [ + 'no-transpose', + 'transpose' +]; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} side - specifies the side of multiplication +* @param {string} trans - specifies the operation to be performed +* @param {PositiveInteger} N - number of rows/columns in matrix C +* @returns {Function} benchmark function +*/ +function createBenchmark( side, trans, N ) { + var opts; + var work; + var tau; + var A; + var C; + + opts = { + 'dtype': 'float64' + }; + + A = zeros( N*N, 'float64' ); + C = uniform( N*N, -10.0, 10.0, opts ); + tau = uniform( N, 0.0, 2.0, opts ); + work = new Float64Array( N ); + + 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 = dorm2r( side, trans, N, N, N, A, N, 1, 0, tau, 1, 0, C, N, 1, 0, work, 1, 0 ); // eslint-disable-line max-len + 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 trans; + var side; + var min; + var max; + var N; + var f; + var i; + var j; + + min = 1; // 10^min + max = 3; // 10^max + + for ( i = 0; i < SIDES.length; i++ ) { + side = SIDES[ i ]; + for ( j = 0; j < TRANS.length; j++ ) { + trans = TRANS[ j ]; + for ( N = min; N <= max; N++ ) { + f = createBenchmark( side, trans, floor( pow( pow( 10, N ), 1.0/2.0 ) ) ); + bench( format( '%s:ndarray:side=%s,trans=%s,size=%d', pkg, side, trans, N*N ), f ); + } + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dorm2r/docs/types/index.d.ts new file mode 100644 index 000000000000..98f84988c41f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/docs/types/index.d.ts @@ -0,0 +1,174 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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, OperationSide, TransposeOperation } from '@stdlib/types/blas'; + +/** +* Interface describing `dorm2r`. +*/ +interface Routine { + /** + * Multiplies a matrix `C` by an orthogonal matrix `Q` from a QR factorization. + * + * ## Notes + * + * `dorm2r` overwrites the general real M by N matrix C with + * + * - `Q * C` if side = 'left' and trans = 'no-transpose' + * - `Q^T * C` if side = 'left' and trans = 'transpose' + * - `C * Q` if side = 'right' and trans = 'no-transpose' + * - `C * Q^T` if side = 'right' and trans = 'transpose' + * + * where Q is a real orthogonal matrix defined as the product of K elementary reflectors `Q = H(1) H(2) ... H(K)` as returned by `dgeqrf`. Q is of order M if side = 'left' and of order N if side = 'right'. + * + * @param order - storage layout + * @param side - specifies the side of multiplication with `C` + * @param trans - specifies the operation to be performed + * @param M - number of rows in matrix `C` + * @param N - number of columns in matrix `C` + * @param K - number of elementary reflectors whose product defines the matrix `Q` + * @param A - input matrix containing the elementary reflectors + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param tau - array containing the scalar factors of the elementary reflectors + * @param C - input/output matrix to be multiplied + * @param LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) + * @param work - workspace array for intermediate calculations + * @returns the modified matrix `C` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + * var tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + * var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + * var work = new Float64Array( 3 ); + * + * dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); + * // C => [ -261638.0, -298618.0, -335598.0, -521066.0, -594715.0, -668364.0, -773933.0, -883324.0, -992715.0 ] + */ + ( order: Layout, side: OperationSide, trans: TransposeOperation, M: number, N: number, K: number, A: Float64Array, LDA: number, tau: Float64Array, C: Float64Array, LDC: number, work: Float64Array ): Float64Array; + + /** + * Multiplies a matrix `C` by an orthogonal matrix `Q` from a QR factorization using alternative indexing semantics. + * + * ## Notes + * + * `dorm2r` overwrites the general real M by N matrix C with + * + * - `Q * C` if side = 'left' and trans = 'no-transpose' + * - `Q^T * C` if side = 'left' and trans = 'transpose' + * - `C * Q` if side = 'right' and trans = 'no-transpose' + * - `C * Q^T` if side = 'right' and trans = 'transpose' + * + * where Q is a real orthogonal matrix defined as the product of K elementary reflectors `Q = H(1) H(2) ... H(K)` as returned by `dgeqrf`. Q is of order M if side = 'left' and of order N if side = 'right'. + * + * @param side - specifies the side of multiplication with `C` + * @param trans - specifies the operation to be performed + * @param M - number of rows in matrix `C` + * @param N - number of columns in matrix `C` + * @param K - number of elementary reflectors whose product defines the matrix `Q` + * @param A - input matrix containing the elementary reflectors + * @param strideA1 - stride length for the first dimension of `A` + * @param strideA2 - stride length for the second dimension of `A` + * @param offsetA - starting index for `A` + * @param tau - array containing the scalar factors of the elementary reflectors + * @param strideTau - stride length for `tau` + * @param offsetTau - starting index for `tau` + * @param C - input/output matrix to be multiplied + * @param strideC1 - stride length for the first dimension of `C` + * @param strideC2 - stride length for the second dimension of `C` + * @param offsetC - starting index for `C` + * @param work - workspace array for intermediate calculations + * @param strideWork - stride length for `work` + * @param offsetWork - starting index for `work` + * @returns the modified matrix `C` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + * var tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + * var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + * var work = new Float64Array( 3 ); + * + * dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); + * // C => [ -261638.0, -298618.0, -335598.0, -521066.0, -594715.0, -668364.0, -773933.0, -883324.0, -992715.0 ] + */ + ndarray( side: OperationSide, trans: TransposeOperation, M: number, N: number, K: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, tau: Float64Array, strideTau: number, offsetTau: number, C: Float64Array, strideC1: number, strideC2: number, offsetC: number, work: Float64Array, strideWork: number, offsetWork: number ): Float64Array; +} + +/** +* Multiplies a matrix `C` by an orthogonal matrix `Q` from a QR factorization. +* +* ## Notes +* +* `dorm2r` overwrites the general real M by N matrix C with +* +* - `Q * C` if side = 'left' and trans = 'no-transpose' +* - `Q^T * C` if side = 'left' and trans = 'transpose' +* - `C * Q` if side = 'right' and trans = 'no-transpose' +* - `C * Q^T` if side = 'right' and trans = 'transpose' +* +* where Q is a real orthogonal matrix defined as the product of K elementary reflectors `Q = H(1) H(2) ... H(K)` as returned by `dgeqrf`. Q is of order M if side = 'left' and of order N if side = 'right'. +* +* @param order - storage layout +* @param side - specifies the side of multiplication with `C` +* @param trans - specifies the operation to be performed +* @param M - number of rows in matrix `C` +* @param N - number of columns in matrix `C` +* @param K - number of elementary reflectors whose product defines the matrix `Q` +* @param A - input matrix containing the elementary reflectors +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param tau - array containing the scalar factors of the elementary reflectors +* @param C - input/output matrix to be multiplied +* @param LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) +* @param work - workspace array for intermediate calculations +* @returns the modified matrix `C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); +* var tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); +* var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); +* var work = new Float64Array( 3 ); +* +* dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); +* // C => [ -261638.0, -298618.0, -335598.0, -521066.0, -594715.0, -668364.0, -773933.0, -883324.0, -992715.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); +* var tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); +* var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); +* var work = new Float64Array( 3 ); +* +* dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); +* // C => [ -261638.0, -298618.0, -335598.0, -521066.0, -594715.0, -668364.0, -773933.0, -883324.0, -992715.0 ] +*/ +declare var dorm2r: Routine; + + +// EXPORTS // + +export = dorm2r; diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dorm2r/docs/types/test.ts new file mode 100644 index 000000000000..bc02cc976312 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/docs/types/test.ts @@ -0,0 +1,620 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 dorm2r = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 5, 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( true, 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( false, 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( null, 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( void 0, 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( [], 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( {}, 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( ( x: number ): number => x, 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 5, 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', true, 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', false, 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', null, 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', void 0, 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', [], 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', {}, 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', ( x: number ): number => x, 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 5, 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', true, 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', false, 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', null, 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', void 0, 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', [], 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', {}, 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', ( x: number ): number => x, 3, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 'no-transpose', '5', 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', true, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', false, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', null, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', void 0, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', [], 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', {}, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', ( x: number ): number => x, 3, 3, A, 3, tau, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 'no-transpose', 3, '5', 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, true, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, false, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, null, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, void 0, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, [], 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, {}, 3, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, ( x: number ): number => x, 3, A, 3, tau, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, '5', A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, true, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, false, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, null, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, void 0, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, [], A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, {}, A, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, ( x: number ): number => x, A, 3, tau, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Float64Array... +{ + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, '5', 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, 5, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, true, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, false, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, null, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, void 0, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, [], 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, {}, 3, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, ( x: number ): number => x, 3, tau, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, '5', tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, true, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, false, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, null, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, void 0, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, [], tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, {}, tau, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, ( x: number ): number => x, tau, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... +{ + const A = new Float64Array( 9 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, '5', C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, 5, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, true, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, false, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, null, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, void 0, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, [], C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, {}, C, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, ( x: number ): number => x, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a Float64Array... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, '5', 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, 5, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, true, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, false, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, null, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, void 0, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, [], 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, {}, 3, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, ( x: number ): number => x, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eleventh argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, '5', work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, true, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, false, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, null, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, void 0, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, [], work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, {}, work ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, ( x: number ): number => x, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a Float64Array... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, '5' ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, 5 ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, true ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, false ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, null ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, void 0 ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, [] ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, {} ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r(); // $ExpectError + dorm2r( 'row-major' ); // $ExpectError + dorm2r( 'row-major', 'left' ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose' ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3 ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3 ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3 ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3 ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3 ); // $ExpectError + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 5, 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( true, 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( false, 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( null, 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( void 0, 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( [], 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( {}, 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( ( x: number ): number => x, 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 5, 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', true, 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', false, 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', null, 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', void 0, 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', [], 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', {}, 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', ( x: number ): number => x, 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', '5', 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', true, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', false, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', null, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', void 0, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', [], 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', {}, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', ( x: number ): number => x, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, '5', 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, true, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, false, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, null, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, void 0, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, [], 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, {}, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, ( x: number ): number => x, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, '5', A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, true, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, false, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, null, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, void 0, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, [], A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, {}, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, ( x: number ): number => x, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Float64Array... +{ + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, '5', 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, 5, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, true, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, false, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, null, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, void 0, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, [], 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, {}, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, ( x: number ): number => x, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, '5', 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, true, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, false, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, null, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, void 0, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, [], 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, {}, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, ( x: number ): number => x, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, '5', 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, true, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, false, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, null, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, void 0, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, [], 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, {}, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, ( x: number ): number => x, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, '5', tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, true, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, false, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, null, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, void 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, [], tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, {}, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, ( x: number ): number => x, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a Float64Array... +{ + const A = new Float64Array( 9 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, '5', 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, 5, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, true, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, false, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, null, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, void 0, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, [], 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, {}, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, ( x: number ): number => x, 1, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eleventh argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, '5', 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, true, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, false, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, null, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, void 0, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, [], 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, {}, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, ( x: number ): number => x, 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a twelfth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, '5', C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, true, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, false, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, null, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, void 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, [], C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, {}, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, ( x: number ): number => x, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a thirteenth argument which is not a Float64Array... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, '5', 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, 5, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, true, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, false, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, null, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, void 0, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, [], 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, {}, 3, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, ( x: number ): number => x, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourteenth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, '5', 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, true, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, false, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, null, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, void 0, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, [], 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, {}, 1, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, ( x: number ): number => x, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifteenth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, '5', 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, true, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, false, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, null, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, void 0, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, [], 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, {}, 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, ( x: number ): number => x, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixteenth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, '5', work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, true, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, false, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, null, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, void 0, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, [], work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, {}, work, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, ( x: number ): number => x, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventeenth argument which is not a Float64Array... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, '5', 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, 5, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, true, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, false, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, null, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, void 0, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, [], 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, {}, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighteenth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, '5', 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, true, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, false, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, null, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, void 0, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, [], 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, {}, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a nineteenth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, '5' ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, true ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, false ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, null ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, void 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, [] ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, {} ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const A = new Float64Array( 9 ); + const tau = new Float64Array( 3 ); + const C = new Float64Array( 9 ); + const work = new Float64Array( 3 ); + + dorm2r.ndarray(); // $ExpectError + dorm2r.ndarray( 'left' ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose' ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1 ); // $ExpectError + dorm2r.ndarray( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/examples/index.js new file mode 100644 index 000000000000..944cc776db45 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/examples/index.js @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 Float64Array = require( '@stdlib/array/float64' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var dorm2r = require( './../lib' ); + +// Specify matrix meta data: +var shape = [ 3, 3 ]; +var strides = [ 1, 3 ]; +var offset = 0; +var order = 'column-major'; + +// Create matrices stored in linear memory: +var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); +var tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); +var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); +var work = new Float64Array( 3 ); + +console.log( 'Input matrix C:' ); +console.log( ndarray2array( C, shape, strides, offset, order ) ); + +// Multiply C by Q from the left (no transpose): +dorm2r( order, 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); +console.log( 'Output matrix C (Q * C):' ); +console.log( ndarray2array( C, shape, strides, offset, order ) ); diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/base.js new file mode 100644 index 000000000000..5a83b630bae8 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/base.js @@ -0,0 +1,146 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 dlarf1f = require( '@stdlib/lapack/base/dlarf1f' ).ndarray; + + +// MAIN // + +/** +* Multiplies a matrix `C` by an orthogonal matrix `Q` from a QR factorization. +* +* ## Notes +* +* `dorm2r` overwrites the general real M by N matrix C with +* +* - `Q * C` if side = 'left' and trans = 'no-transpose' +* - `Q^T * C` if side = 'left' and trans = 'transpose' +* - `C * Q` if side = 'right' and trans = 'no-transpose' +* - `C * Q^T` if side = 'right' and trans = 'transpose' +* +* where Q is a real orthogonal matrix defined as the product of K elementary reflectors `Q = H(1) H(2) ... H(K)` as returned by `dgeqrf`. Q is of order M if side = 'left' and of order N if side = 'right'. +* +* @private +* @param {string} side - specifies the side of multiplication with `C` +* @param {string} trans - specifies the operation to be performed +* @param {NonNegativeInteger} M - number of rows in matrix `C` +* @param {NonNegativeInteger} N - number of columns in matrix `C` +* @param {NonNegativeInteger} K - number of elementary reflectors whose product defines the matrix `Q` +* @param {Float64Array} A - input matrix containing the elementary reflectors +* @param {integer} strideA1 - stride length for the first dimension of `A` +* @param {integer} strideA2 - stride length for the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} tau - array containing the scalar factors of the elementary reflectors +* @param {integer} strideTau - stride length for `tau` +* @param {NonNegativeInteger} offsetTau - starting index for `tau` +* @param {Float64Array} C - input/output matrix to be multiplied +* @param {integer} strideC1 - stride length for the first dimension of `C` +* @param {integer} strideC2 - stride length for the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @param {Float64Array} work - workspace array for intermediate calculations +* @param {integer} strideWork - stride length for `work` +* @param {NonNegativeInteger} offsetWork - starting index for `work` +* @returns {Float64Array} the modified matrix `C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); +* var tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); +* var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); +* var work = new Float64Array( 3 ); +* +* dorm2r( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); +* // C => [ -261638.0, -298618.0, -335598.0, -521066.0, -594715.0, -668364.0, -773933.0, -883324.0, -992715.0 ] +*/ +function dorm2r( side, trans, M, N, K, A, strideA1, strideA2, offsetA, tau, strideTau, offsetTau, C, strideC1, strideC2, offsetC, work, strideWork, offsetWork ) { // eslint-disable-line max-params, max-len + var aOffset; + var cOffset; + var tauVal; + var notran; + var passC1; + var passC2; + var passA; + var left; + var i1; + var i2; + var i3; + var mi; + var ni; + var ic; + var jc; + var i; + + // Quick return if possible + if ( M === 0 || N === 0 || K === 0 ) { + return C; + } + + left = ( side === 'left' ); + notran = ( trans === 'no-transpose' ); + + // Determine loop indices based on side and trans + if ( ( left && !notran ) || ( !left && notran ) ) { + i1 = 1; + i2 = K; + i3 = 1; + } else { + i1 = K; + i2 = 1; + i3 = -1; + } + + // Initialize dimensions + if ( left ) { + ni = N; + jc = 1; + } else { + mi = M; + ic = 1; + } + + for ( i = i1; ( i3 > 0 ) ? ( i <= i2 ) : ( i >= i2 ); i += i3 ) { // loop going from 1..K or K..1 + if ( left ) { + mi = M - i + 1; + ic = i; + } else { + ni = N - i + 1; + jc = i; + } + + tauVal = tau[ offsetTau + ( ( i - 1 ) * strideTau ) ]; + aOffset = offsetA + ( ( i - 1 ) * strideA1 ) + ( ( i - 1 ) * strideA2 ); + passA = strideA1; + passC1 = strideC1; + passC2 = strideC2; + cOffset = offsetC + ( (ic-1) * strideC1 ) + ( (jc-1) * strideC2 ); + + dlarf1f( side, mi, ni, A, passA, aOffset, tauVal, C, passC1, passC2, cOffset, work, strideWork, offsetWork ); // eslint-disable-line max-len + } + + return C; +} + + +// EXPORTS // + +module.exports = dorm2r; diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/dorm2r.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/dorm2r.js new file mode 100644 index 000000000000..f423cb61d86c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/dorm2r.js @@ -0,0 +1,127 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); +var isTransposeOperation = 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 max = require( '@stdlib/math/base/special/max' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Multiplies a matrix `C` by an orthogonal matrix `Q` from a QR factorization. +* +* ## Notes +* +* `dorm2r` overwrites the general real M by N matrix C with +* +* - `Q * C` if side = 'left' and trans = 'no-transpose' +* - `Q^T * C` if side = 'left' and trans = 'transpose' +* - `C * Q` if side = 'right' and trans = 'no-transpose' +* - `C * Q^T` if side = 'right' and trans = 'transpose' +* +* where Q is a real orthogonal matrix defined as the product of K elementary reflectors `Q = H(1) H(2) ... H(K)` as returned by `dgeqrf`. Q is of order M if side = 'left' and of order N if side = 'right'. +* +* @param {string} order - storage layout +* @param {string} side - specifies the side of multiplication with `C` +* @param {string} trans - specifies the operation to be performed +* @param {NonNegativeInteger} M - number of rows in matrix `C` +* @param {NonNegativeInteger} N - number of columns in matrix `C` +* @param {NonNegativeInteger} K - number of elementary reflectors whose product defines the matrix `Q` +* @param {Float64Array} A - input matrix containing the elementary reflectors +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float64Array} tau - array containing the scalar factors of the elementary reflectors +* @param {Float64Array} C - input/output matrix to be multiplied +* @param {PositiveInteger} LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) +* @param {Float64Array} work - workspace array for intermediate calculations +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must be a valid operation side +* @throws {TypeError} third argument must be a valid transpose operation +* @throws {RangeError} eighth argument must be greater than or equal to max(1,M) when side is 'left' or max(1,N) when side is 'right' +* @throws {RangeError} twelfth argument must be greater than or equal to max(1,M) +* @returns {Float64Array} the modified matrix `C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); +* var tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); +* var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); +* var work = new Float64Array( 3 ); +* +* dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); +* // C => [ -261638.0, -298618.0, -335598.0, -521066.0, -594715.0, -668364.0, -773933.0, -883324.0, -992715.0 ] +*/ +function dorm2r( order, side, trans, M, N, K, A, LDA, tau, C, LDC, work ) { // eslint-disable-line max-params + var sa1; + var sa2; + var sc1; + var sc2; + + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( !isOperationSide( side ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid operation side. Value: `%s`.', side ) ); + } + if ( !isTransposeOperation( trans ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', trans ) ); + } + if ( isColumnMajor( order ) ) { + if ( side === 'left' && LDA < max( 1, M ) ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be greater than or equal to max(1,%d). Value: `%d`.', M, LDA ) ); + } + if ( side === 'right' && LDA < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); + } + } else if ( LDA < max( 1, K ) ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be greater than or equal to max(1,%d). Value: `%d`.', K, LDA ) ); + } + if ( isRowMajor( order ) && LDC < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Twelfth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDC ) ); + } + if ( isColumnMajor( order ) && LDC < max( 1, M ) ) { + throw new RangeError( format( 'invalid argument. Twelfth argument must be greater than or equal to max(1,%d). Value: `%d`.', M, LDC ) ); + } + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = LDA; + sc1 = 1; + sc2 = LDC; + } else { + sa1 = LDA; + sa2 = 1; + sc1 = LDC; + sc2 = 1; + } + return base( side, trans, M, N, K, A, sa1, sa2, 0, tau, 1, 0, C, sc1, sc2, 0, work, 1, 0 ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = dorm2r; diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/index.js new file mode 100644 index 000000000000..9b15ae757bcb --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/index.js @@ -0,0 +1,71 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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'; + +/** +* LAPACK routine to multiply a matrix by an orthogonal matrix from a QR factorization. +* +* ## Notes +* +* `dorm2r` overwrites the general real M by N matrix C with +* +* - `Q * C` if side = 'left' and trans = 'no-transpose' +* - `Q^T * C` if side = 'left' and trans = 'transpose' +* - `C * Q` if side = 'right' and trans = 'no-transpose' +* - `C * Q^T` if side = 'right' and trans = 'transpose' +* +* where Q is a real orthogonal matrix defined as the product of K elementary reflectors `Q = H(1) H(2) ... H(K)` as returned by `dgeqrf`. Q is of order M if side = 'left' and of order N if side = 'right'. +* +* @module @stdlib/lapack/base/dorm2r +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dorm2r = require( '@stdlib/lapack/base/dorm2r' ); +* +* var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); +* var tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); +* var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); +* var work = new Float64Array( 3 ); +* +* dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); +* // C => [ -261638.0, -298618.0, -335598.0, -521066.0, -594715.0, -668364.0, -773933.0, -883324.0, -992715.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 dorm2r; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dorm2r = main; +} else { + dorm2r = tmp; +} + + +// EXPORTS // + +module.exports = dorm2r; diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/main.js new file mode 100644 index 000000000000..1d4981b50aee --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 dorm2r = require( './dorm2r.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dorm2r, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dorm2r; diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/ndarray.js new file mode 100644 index 000000000000..33aaaa88195d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/lib/ndarray.js @@ -0,0 +1,92 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isOperationSide = require( '@stdlib/blas/base/assert/is-operation-side' ); +var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Multiplies a matrix `C` by an orthogonal matrix `Q` from a QR factorization. +* +* ## Notes +* +* `dorm2r` overwrites the general real M by N matrix C with +* +* - `Q * C` if side = 'left' and trans = 'no-transpose' +* - `Q^T * C` if side = 'left' and trans = 'transpose' +* - `C * Q` if side = 'right' and trans = 'no-transpose' +* - `C * Q^T` if side = 'right' and trans = 'transpose' +* +* where Q is a real orthogonal matrix defined as the product of K elementary reflectors `Q = H(1) H(2) ... H(K)` as returned by `dgeqrf`. Q is of order M if side = 'left' and of order N if side = 'right'. +* +* @param {string} side - specifies the side of multiplication with `C` +* @param {string} trans - specifies the operation to be performed +* @param {NonNegativeInteger} M - number of rows in matrix `C` +* @param {NonNegativeInteger} N - number of columns in matrix `C` +* @param {NonNegativeInteger} K - number of elementary reflectors whose product defines the matrix `Q` +* @param {Float64Array} A - input matrix containing the elementary reflectors +* @param {integer} strideA1 - stride length for the first dimension of `A` +* @param {integer} strideA2 - stride length for the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} tau - array containing the scalar factors of the elementary reflectors +* @param {integer} strideTau - stride length for `tau` +* @param {NonNegativeInteger} offsetTau - starting index for `tau` +* @param {Float64Array} C - input/output matrix to be multiplied +* @param {integer} strideC1 - stride length for the first dimension of `C` +* @param {integer} strideC2 - stride length for the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @param {Float64Array} work - workspace array for intermediate calculations +* @param {integer} strideWork - stride length for `work` +* @param {NonNegativeInteger} offsetWork - starting index for `work` +* @throws {TypeError} first argument must be a valid operation side +* @throws {TypeError} second argument must be a valid transpose operation +* @returns {Float64Array} the modified matrix `C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); +* var tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); +* var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); +* var work = new Float64Array( 3 ); +* +* dorm2r( 'left', 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); +* // C => [ -261638.0, -298618.0, -335598.0, -521066.0, -594715.0, -668364.0, -773933.0, -883324.0, -992715.0 ] +*/ +function dorm2r( side, trans, M, N, K, A, strideA1, strideA2, offsetA, tau, strideTau, offsetTau, C, strideC1, strideC2, offsetC, work, strideWork, offsetWork ) { // eslint-disable-line max-len, max-params + if ( !isOperationSide( side ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid operation side. Value: `%s`.', side ) ); + } + if ( !isTransposeOperation( trans ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', trans ) ); + } + return base( side, trans, M, N, K, A, strideA1, strideA2, offsetA, tau, strideTau, offsetTau, C, strideC1, strideC2, offsetC, work, strideWork, offsetWork ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = dorm2r; diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/package.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/package.json new file mode 100644 index 000000000000..d064af3582b5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/lapack/base/dorm2r", + "version": "0.0.0", + "description": "Multiply a matrix by an orthogonal matrix from a QR factorization.", + "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", + "lapack", + "dorm2r", + "orthogonal", + "matrix", + "multiplication", + "qr", + "factorization", + "reflector", + "elementary", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float64", + "double", + "float64array" + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_notrans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_notrans_col_major.json new file mode 100644 index 000000000000..ac5167f1e496 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_notrans_col_major.json @@ -0,0 +1,147 @@ +{ + "order": "column-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 1, + 0, + 0 + ], + [ + 2, + 4, + 0 + ], + [ + 3, + 5, + 6 + ] + ], + "LDA": 3, + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "A": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 0, + 9999, + 4, + 9999, + 5, + 9999, + 0, + 9999, + 0, + 9999, + 6, + 9999 + ], + "tau": [ + 7, + 9999, + 8, + 9999, + 9, + 9999 + ], + "strideTau": 2, + "offsetTau": 0, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "LDC": 3, + "strideC1": 2, + "strideC2": 6, + "offsetC": 0, + "C": [ + 1, + 9999, + 4, + 9999, + 7, + 9999, + 2, + 9999, + 5, + 9999, + 8, + 9999, + 3, + 9999, + 6, + 9999, + 9, + 9999 + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out_mat": [ + [ + -261638, + -298618, + -335598 + ], + [ + -521066, + -594715, + -668364 + ], + [ + -773933, + -883324, + -992715 + ] + ], + "C_out": [ + -261638, + 9999, + -521066, + 9999, + -773933, + 9999, + -298618, + 9999, + -594715, + 9999, + -883324, + 9999, + -335598, + 9999, + -668364, + 9999, + -992715, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_notrans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_notrans_row_major.json new file mode 100644 index 000000000000..615839ee2d50 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_notrans_row_major.json @@ -0,0 +1,147 @@ +{ + "order": "row-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 1, + 0, + 0 + ], + [ + 2, + 4, + 0 + ], + [ + 3, + 5, + 6 + ] + ], + "LDA": 3, + "strideA1": 6, + "strideA2": 2, + "offsetA": 0, + "A": [ + 1, + 9999, + 0, + 9999, + 0, + 9999, + 2, + 9999, + 4, + 9999, + 0, + 9999, + 3, + 9999, + 5, + 9999, + 6, + 9999 + ], + "tau": [ + 7, + 9999, + 8, + 9999, + 9, + 9999 + ], + "strideTau": 2, + "offsetTau": 0, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "LDC": 3, + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "C": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999 + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out_mat": [ + [ + -261638, + -298618, + -335598 + ], + [ + -521066, + -594715, + -668364 + ], + [ + -773933, + -883324, + -992715 + ] + ], + "C_out": [ + -261638, + 9999, + -298618, + 9999, + -335598, + 9999, + -521066, + 9999, + -594715, + 9999, + -668364, + 9999, + -773933, + 9999, + -883324, + 9999, + -992715, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_trans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_trans_col_major.json new file mode 100644 index 000000000000..2001ddfa7648 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_trans_col_major.json @@ -0,0 +1,147 @@ +{ + "order": "column-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 10, + 200, + 123 + ], + [ + 20, + 30, + 200 + ], + [ + 40, + 50, + 60 + ] + ], + "LDA": 3, + "strideA1": 2, + "strideA2": 6, + "offsetA": 0, + "A": [ + 10, + 9999, + 20, + 9999, + 40, + 9999, + 200, + 9999, + 30, + 9999, + 50, + 9999, + 123, + 9999, + 200, + 9999, + 60, + 9999 + ], + "tau": [ + 2, + 9999, + 3, + 9999, + 4, + 9999 + ], + "strideTau": 2, + "offsetTau": 0, + "C_mat": [ + [ + 7, + 9, + 11 + ], + [ + 12, + 14, + 16 + ], + [ + 17, + 19, + 21 + ] + ], + "LDC": 3, + "strideC1": 2, + "strideC2": 6, + "offsetC": 0, + "C": [ + 7, + 9999, + 12, + 9999, + 17, + 9999, + 9, + 9999, + 14, + 9999, + 19, + 9999, + 11, + 9999, + 16, + 9999, + 21, + 9999 + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out_mat": [ + [ + -1847, + -2089, + -2331 + ], + [ + 11195586, + 12669042, + 14142498 + ], + [ + -1684675671, + -1906396497, + -2128117323 + ] + ], + "C_out": [ + -1847, + 9999, + 11195586, + 9999, + -1684675671, + 9999, + -2089, + 9999, + 12669042, + 9999, + -1906396497, + 9999, + -2331, + 9999, + 14142498, + 9999, + -2128117323, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_trans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_trans_row_major.json new file mode 100644 index 000000000000..a33a2c88cb0f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/large_strides/left_trans_row_major.json @@ -0,0 +1,147 @@ +{ + "order": "row-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 10, + 200, + 123 + ], + [ + 20, + 30, + 200 + ], + [ + 40, + 50, + 60 + ] + ], + "LDA": 3, + "strideA1": 6, + "strideA2": 2, + "offsetA": 0, + "A": [ + 10, + 9999, + 200, + 9999, + 123, + 9999, + 20, + 9999, + 30, + 9999, + 200, + 9999, + 40, + 9999, + 50, + 9999, + 60, + 9999 + ], + "tau": [ + 2, + 9999, + 3, + 9999, + 4, + 9999 + ], + "strideTau": 2, + "offsetTau": 0, + "C_mat": [ + [ + 7, + 9, + 11 + ], + [ + 12, + 14, + 16 + ], + [ + 17, + 19, + 21 + ] + ], + "LDC": 3, + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "C": [ + 7, + 9999, + 9, + 9999, + 11, + 9999, + 12, + 9999, + 14, + 9999, + 16, + 9999, + 17, + 9999, + 19, + 9999, + 21, + 9999 + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out_mat": [ + [ + -1847, + -2089, + -2331 + ], + [ + 11195586, + 12669042, + 14142498 + ], + [ + -1684675671, + -1906396497, + -2128117323 + ] + ], + "C_out": [ + -1847, + 9999, + -2089, + 9999, + -2331, + 9999, + 11195586, + 9999, + 12669042, + 9999, + 14142498, + 9999, + -1684675671, + 9999, + -1906396497, + 9999, + -2128117323, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_notrans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_notrans_col_major.json new file mode 100644 index 000000000000..f26f8d91df17 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_notrans_col_major.json @@ -0,0 +1,45 @@ +{ + "order": "column-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 2.0, 4.0, 0.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ], + + "tau": [ 7.0, 8.0, 9.0 ], + "strideTau": 1, + "offsetTau": 0, + + "C_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + "LDC": 3, + "strideC1": 1, + "strideC2": 3, + "offsetC": 0, + "C": [ 1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0 ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out_mat": [ + [ -261638.0, -298618.0, -335598.0 ], + [ -521066.0, -594715.0, -668364.0 ], + [ -773933.0, -883324.0, -992715.0 ] + ], + "C_out": [ -261638.0, -521066.0, -773933.0, -298618.0, -594715.0, -883324.0, -335598.0, -668364.0, -992715.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_notrans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_notrans_row_major.json new file mode 100644 index 000000000000..51e06b1a92b9 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_notrans_row_major.json @@ -0,0 +1,45 @@ +{ + "order": "row-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 2.0, 4.0, 0.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ], + + "tau": [ 7.0, 8.0, 9.0 ], + "strideTau": 1, + "offsetTau": 0, + + "C_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + "LDC": 3, + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out_mat": [ + [ -261638.0, -298618.0, -335598.0 ], + [ -521066.0, -594715.0, -668364.0 ], + [ -773933.0, -883324.0, -992715.0 ] + ], + "C_out": [ -261638.0, -298618.0, -335598.0, -521066.0, -594715.0, -668364.0, -773933.0, -883324.0, -992715.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_trans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_trans_col_major.json new file mode 100644 index 000000000000..9a8ea643f058 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_trans_col_major.json @@ -0,0 +1,45 @@ +{ + "order": "column-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + + "A_mat": [ + [ 10.0, 200.0, 123.0 ], + [ 20.0, 30.0, 200.0 ], + [ 40.0, 50.0, 60.0 ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "A": [ 10.0, 20.0, 40.0, 200.0, 30.0, 50.0, 123.0, 200.0, 60.0 ], + + "tau": [ 2.0, 3.0, 4.0 ], + "strideTau": 1, + "offsetTau": 0, + + "C_mat": [ + [ 7.0, 9.0, 11.0 ], + [ 12.0, 14.0, 16.0 ], + [ 17.0, 19.0, 21.0 ] + ], + "LDC": 3, + "strideC1": 1, + "strideC2": 3, + "offsetC": 0, + "C": [ 7.0, 12.0, 17.0, 9.0, 14.0, 19.0, 11.0, 16.0, 21.0 ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out_mat": [ + [ -1847.0, -2089.0, -2331.0 ], + [ 11195586.0, 12669042.0, 14142498.0 ], + [ -1684675671.0, -1906396497.0, -2128117323.0 ] + ], + "C_out": [ -1847.0, 11195586.0, -1684675671.0, -2089.0, 12669042.0, -1906396497.0, -2331.0, 14142498.0, -2128117323.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_trans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_trans_row_major.json new file mode 100644 index 000000000000..b7485a4d8feb --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/left_trans_row_major.json @@ -0,0 +1,45 @@ +{ + "order": "row-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + + "A_mat": [ + [ 10.0, 200.0, 123.0 ], + [ 20.0, 30.0, 200.0 ], + [ 40.0, 50.0, 60.0 ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "A": [ 10.0, 200.0, 123.0, 20.0, 30.0, 200.0, 40.0, 50.0, 60.0 ], + + "tau": [ 2.0, 3.0, 4.0 ], + "strideTau": 1, + "offsetTau": 0, + + "C_mat": [ + [ 7.0, 9.0, 11.0 ], + [ 12.0, 14.0, 16.0 ], + [ 17.0, 19.0, 21.0 ] + ], + "LDC": 3, + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "C": [ 7.0, 9.0, 11.0, 12.0, 14.0, 16.0, 17.0, 19.0, 21.0 ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out_mat": [ + [ -1847.0, -2089.0, -2331.0 ], + [ 11195586.0, 12669042.0, 14142498.0 ], + [ -1684675671.0, -1906396497.0, -2128117323.0 ] + ], + "C_out": [ -1847.0, -2089.0, -2331.0, 11195586.0, 12669042.0, 14142498.0, -1684675671.0, -1906396497.0, -2128117323.0 ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_notrans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_notrans_col_major.json new file mode 100644 index 000000000000..96528a123a1b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_notrans_col_major.json @@ -0,0 +1,114 @@ +{ + "order": "column-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 1, + 0, + 0 + ], + [ + 2, + 4, + 0 + ], + [ + 3, + 5, + 6 + ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": -3, + "offsetA": 6, + "A": [ + 0, + 0, + 6, + 0, + 4, + 5, + 1, + 2, + 3 + ], + "tau": [ + 7, + 8, + 9 + ], + "strideTau": 1, + "offsetTau": 0, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "LDC": 3, + "strideC1": 1, + "strideC2": -3, + "offsetC": 6, + "C": [ + 3, + 6, + 9, + 2, + 5, + 8, + 1, + 4, + 7 + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out_mat": [ + [ + -261638, + -298618, + -335598 + ], + [ + -521066, + -594715, + -668364 + ], + [ + -773933, + -883324, + -992715 + ] + ], + "C_out": [ + -335598, + -668364, + -992715, + -298618, + -594715, + -883324, + -261638, + -521066, + -773933 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_notrans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_notrans_row_major.json new file mode 100644 index 000000000000..0b4884825708 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_notrans_row_major.json @@ -0,0 +1,114 @@ +{ + "order": "row-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 1, + 0, + 0 + ], + [ + 2, + 4, + 0 + ], + [ + 3, + 5, + 6 + ] + ], + "LDA": 3, + "strideA1": -3, + "strideA2": 1, + "offsetA": 6, + "A": [ + 3, + 5, + 6, + 2, + 4, + 0, + 1, + 0, + 0 + ], + "tau": [ + 7, + 8, + 9 + ], + "strideTau": 1, + "offsetTau": 0, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "LDC": 3, + "strideC1": -3, + "strideC2": 1, + "offsetC": 6, + "C": [ + 7, + 8, + 9, + 4, + 5, + 6, + 1, + 2, + 3 + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out_mat": [ + [ + -261638, + -298618, + -335598 + ], + [ + -521066, + -594715, + -668364 + ], + [ + -773933, + -883324, + -992715 + ] + ], + "C_out": [ + -773933, + -883324, + -992715, + -521066, + -594715, + -668364, + -261638, + -298618, + -335598 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_trans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_trans_col_major.json new file mode 100644 index 000000000000..18ee12fe2387 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_trans_col_major.json @@ -0,0 +1,114 @@ +{ + "order": "column-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 10, + 200, + 123 + ], + [ + 20, + 30, + 200 + ], + [ + 40, + 50, + 60 + ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": -3, + "offsetA": 6, + "A": [ + 123, + 200, + 60, + 200, + 30, + 50, + 10, + 20, + 40 + ], + "tau": [ + 2, + 3, + 4 + ], + "strideTau": 1, + "offsetTau": 0, + "C_mat": [ + [ + 7, + 9, + 11 + ], + [ + 12, + 14, + 16 + ], + [ + 17, + 19, + 21 + ] + ], + "LDC": 3, + "strideC1": 1, + "strideC2": -3, + "offsetC": 6, + "C": [ + 11, + 16, + 21, + 9, + 14, + 19, + 7, + 12, + 17 + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out_mat": [ + [ + -1847, + -2089, + -2331 + ], + [ + 11195586, + 12669042, + 14142498 + ], + [ + -1684675671, + -1906396497, + -2128117323 + ] + ], + "C_out": [ + -2331, + 14142498, + -2128117323, + -2089, + 12669042, + -1906396497, + -1847, + 11195586, + -1684675671 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_trans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_trans_row_major.json new file mode 100644 index 000000000000..c21103fcff86 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/mixed_strides/left_trans_row_major.json @@ -0,0 +1,114 @@ +{ + "order": "row-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 10, + 200, + 123 + ], + [ + 20, + 30, + 200 + ], + [ + 40, + 50, + 60 + ] + ], + "LDA": 3, + "strideA1": -3, + "strideA2": 1, + "offsetA": 6, + "A": [ + 40, + 50, + 60, + 20, + 30, + 200, + 10, + 200, + 123 + ], + "tau": [ + 2, + 3, + 4 + ], + "strideTau": 1, + "offsetTau": 0, + "C_mat": [ + [ + 7, + 9, + 11 + ], + [ + 12, + 14, + 16 + ], + [ + 17, + 19, + 21 + ] + ], + "LDC": 3, + "strideC1": -3, + "strideC2": 1, + "offsetC": 6, + "C": [ + 17, + 19, + 21, + 12, + 14, + 16, + 7, + 9, + 11 + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out_mat": [ + [ + -1847, + -2089, + -2331 + ], + [ + 11195586, + 12669042, + 14142498 + ], + [ + -1684675671, + -1906396497, + -2128117323 + ] + ], + "C_out": [ + -1684675671, + -1906396497, + -2128117323, + 11195586, + 12669042, + 14142498, + -1847, + -2089, + -2331 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_notrans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_notrans_col_major.json new file mode 100644 index 000000000000..b3215c73c45d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_notrans_col_major.json @@ -0,0 +1,114 @@ +{ + "order": "column-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 1, + 0, + 0 + ], + [ + 2, + 4, + 0 + ], + [ + 3, + 5, + 6 + ] + ], + "LDA": 3, + "strideA1": -1, + "strideA2": -3, + "offsetA": 8, + "A": [ + 6, + 0, + 0, + 5, + 4, + 0, + 3, + 2, + 1 + ], + "tau": [ + 9, + 8, + 7 + ], + "strideTau": -1, + "offsetTau": 2, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "LDC": 3, + "strideC1": -1, + "strideC2": -3, + "offsetC": 8, + "C": [ + 9, + 6, + 3, + 8, + 5, + 2, + 7, + 4, + 1 + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out_mat": [ + [ + -261638, + -298618, + -335598 + ], + [ + -521066, + -594715, + -668364 + ], + [ + -773933, + -883324, + -992715 + ] + ], + "C_out": [ + -992715, + -668364, + -335598, + -883324, + -594715, + -298618, + -773933, + -521066, + -261638 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_notrans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_notrans_row_major.json new file mode 100644 index 000000000000..6ac04d19a622 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_notrans_row_major.json @@ -0,0 +1,114 @@ +{ + "order": "row-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 1, + 0, + 0 + ], + [ + 2, + 4, + 0 + ], + [ + 3, + 5, + 6 + ] + ], + "LDA": 3, + "strideA1": -3, + "strideA2": -1, + "offsetA": 8, + "A": [ + 6, + 5, + 3, + 0, + 4, + 2, + 0, + 0, + 1 + ], + "tau": [ + 9, + 8, + 7 + ], + "strideTau": -1, + "offsetTau": 2, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "LDC": 3, + "strideC1": -3, + "strideC2": -1, + "offsetC": 8, + "C": [ + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out_mat": [ + [ + -261638, + -298618, + -335598 + ], + [ + -521066, + -594715, + -668364 + ], + [ + -773933, + -883324, + -992715 + ] + ], + "C_out": [ + -992715, + -883324, + -773933, + -668364, + -594715, + -521066, + -335598, + -298618, + -261638 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_trans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_trans_col_major.json new file mode 100644 index 000000000000..37cfa5b3b2c1 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_trans_col_major.json @@ -0,0 +1,114 @@ +{ + "order": "column-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 10, + 200, + 123 + ], + [ + 20, + 30, + 200 + ], + [ + 40, + 50, + 60 + ] + ], + "LDA": 3, + "strideA1": -1, + "strideA2": -3, + "offsetA": 8, + "A": [ + 60, + 200, + 123, + 50, + 30, + 200, + 40, + 20, + 10 + ], + "tau": [ + 4, + 3, + 2 + ], + "strideTau": -1, + "offsetTau": 2, + "C_mat": [ + [ + 7, + 9, + 11 + ], + [ + 12, + 14, + 16 + ], + [ + 17, + 19, + 21 + ] + ], + "LDC": 3, + "strideC1": -1, + "strideC2": -3, + "offsetC": 8, + "C": [ + 21, + 16, + 11, + 19, + 14, + 9, + 17, + 12, + 7 + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out_mat": [ + [ + -1847, + -2089, + -2331 + ], + [ + 11195586, + 12669042, + 14142498 + ], + [ + -1684675671, + -1906396497, + -2128117323 + ] + ], + "C_out": [ + -2128117323, + 14142498, + -2331, + -1906396497, + 12669042, + -2089, + -1684675671, + 11195586, + -1847 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_trans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_trans_row_major.json new file mode 100644 index 000000000000..f33e3ed24e6d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/negative_strides/left_trans_row_major.json @@ -0,0 +1,114 @@ +{ + "order": "row-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 10, + 200, + 123 + ], + [ + 20, + 30, + 200 + ], + [ + 40, + 50, + 60 + ] + ], + "LDA": 3, + "strideA1": -3, + "strideA2": -1, + "offsetA": 8, + "A": [ + 60, + 50, + 40, + 200, + 30, + 20, + 123, + 200, + 10 + ], + "tau": [ + 4, + 3, + 2 + ], + "strideTau": -1, + "offsetTau": 2, + "C_mat": [ + [ + 7, + 9, + 11 + ], + [ + 12, + 14, + 16 + ], + [ + 17, + 19, + 21 + ] + ], + "LDC": 3, + "strideC1": -3, + "strideC2": -1, + "offsetC": 8, + "C": [ + 21, + 19, + 17, + 16, + 14, + 12, + 11, + 9, + 7 + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out_mat": [ + [ + -1847, + -2089, + -2331 + ], + [ + 11195586, + 12669042, + 14142498 + ], + [ + -1684675671, + -1906396497, + -2128117323 + ] + ], + "C_out": [ + -2128117323, + -1906396497, + -1684675671, + 14142498, + 12669042, + 11195586, + -2331, + -2089, + -1847 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_notrans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_notrans_col_major.json new file mode 100644 index 000000000000..0ad2e824545f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_notrans_col_major.json @@ -0,0 +1,119 @@ +{ + "order": "column-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 1, + 0, + 0 + ], + [ + 2, + 4, + 0 + ], + [ + 3, + 5, + 6 + ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "A": [ + 9999, + 1, + 2, + 3, + 0, + 4, + 5, + 0, + 0, + 6 + ], + "tau": [ + 9999, + 7, + 8, + 9 + ], + "strideTau": 1, + "offsetTau": 1, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "LDC": 3, + "strideC1": 1, + "strideC2": 3, + "offsetC": 1, + "C": [ + 9999, + 1, + 4, + 7, + 2, + 5, + 8, + 3, + 6, + 9 + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out_mat": [ + [ + -261638, + -298618, + -335598 + ], + [ + -521066, + -594715, + -668364 + ], + [ + -773933, + -883324, + -992715 + ] + ], + "C_out": [ + 9999, + -261638, + -521066, + -773933, + -298618, + -594715, + -883324, + -335598, + -668364, + -992715 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_notrans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_notrans_row_major.json new file mode 100644 index 000000000000..1f957a15c4a0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_notrans_row_major.json @@ -0,0 +1,119 @@ +{ + "order": "row-major", + "side": "left", + "trans": "no-transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 1, + 0, + 0 + ], + [ + 2, + 4, + 0 + ], + [ + 3, + 5, + 6 + ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 1, + "A": [ + 9999, + 1, + 0, + 0, + 2, + 4, + 0, + 3, + 5, + 6 + ], + "tau": [ + 9999, + 7, + 8, + 9 + ], + "strideTau": 1, + "offsetTau": 1, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ] + ], + "LDC": 3, + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "C": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out_mat": [ + [ + -261638, + -298618, + -335598 + ], + [ + -521066, + -594715, + -668364 + ], + [ + -773933, + -883324, + -992715 + ] + ], + "C_out": [ + 9999, + -261638, + -298618, + -335598, + -521066, + -594715, + -668364, + -773933, + -883324, + -992715 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_trans_col_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_trans_col_major.json new file mode 100644 index 000000000000..371be11e48c2 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_trans_col_major.json @@ -0,0 +1,119 @@ +{ + "order": "column-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 10, + 200, + 123 + ], + [ + 20, + 30, + 200 + ], + [ + 40, + 50, + 60 + ] + ], + "LDA": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 1, + "A": [ + 9999, + 10, + 20, + 40, + 200, + 30, + 50, + 123, + 200, + 60 + ], + "tau": [ + 9999, + 2, + 3, + 4 + ], + "strideTau": 1, + "offsetTau": 1, + "C_mat": [ + [ + 7, + 9, + 11 + ], + [ + 12, + 14, + 16 + ], + [ + 17, + 19, + 21 + ] + ], + "LDC": 3, + "strideC1": 1, + "strideC2": 3, + "offsetC": 1, + "C": [ + 9999, + 7, + 12, + 17, + 9, + 14, + 19, + 11, + 16, + 21 + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out_mat": [ + [ + -1847, + -2089, + -2331 + ], + [ + 11195586, + 12669042, + 14142498 + ], + [ + -1684675671, + -1906396497, + -2128117323 + ] + ], + "C_out": [ + 9999, + -1847, + 11195586, + -1684675671, + -2089, + 12669042, + -1906396497, + -2331, + 14142498, + -2128117323 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_trans_row_major.json b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_trans_row_major.json new file mode 100644 index 000000000000..0cd828076ca0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/fixtures/offsets/left_trans_row_major.json @@ -0,0 +1,119 @@ +{ + "order": "row-major", + "side": "left", + "trans": "transpose", + "M": 3, + "N": 3, + "K": 3, + "A_mat": [ + [ + 10, + 200, + 123 + ], + [ + 20, + 30, + 200 + ], + [ + 40, + 50, + 60 + ] + ], + "LDA": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 1, + "A": [ + 9999, + 10, + 200, + 123, + 20, + 30, + 200, + 40, + 50, + 60 + ], + "tau": [ + 9999, + 2, + 3, + 4 + ], + "strideTau": 1, + "offsetTau": 1, + "C_mat": [ + [ + 7, + 9, + 11 + ], + [ + 12, + 14, + 16 + ], + [ + 17, + 19, + 21 + ] + ], + "LDC": 3, + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "C": [ + 9999, + 7, + 9, + 11, + 12, + 14, + 16, + 17, + 19, + 21 + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out_mat": [ + [ + -1847, + -2089, + -2331 + ], + [ + 11195586, + 12669042, + 14142498 + ], + [ + -1684675671, + -1906396497, + -2128117323 + ] + ], + "C_out": [ + 9999, + -1847, + -2089, + -2331, + 11195586, + 12669042, + 14142498, + -1684675671, + -1906396497, + -2128117323 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.dorm2r.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.dorm2r.js new file mode 100644 index 000000000000..dd6a276a1502 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.dorm2r.js @@ -0,0 +1,365 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var dorm2r = require( './../lib/dorm2r.js' ); + + +// FIXTURES // + +var LEFT_NOTRANS_ROW_MAJOR = require( './fixtures/left_notrans_row_major.json' ); +var LEFT_NOTRANS_COL_MAJOR = require( './fixtures/left_notrans_col_major.json' ); +var LEFT_TRANS_ROW_MAJOR = require( './fixtures/left_trans_row_major.json' ); +var LEFT_TRANS_COL_MAJOR = require( './fixtures/left_trans_col_major.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dorm2r, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( dorm2r.length, 12, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid order', function test( t ) { + var values; + var work; + var tau; + var A; + var C; + var i; + + A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + work = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dorm2r( value, 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is not a valid side', function test( t ) { + var values; + var work; + var tau; + var A; + var C; + var i; + + A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + work = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dorm2r( 'row-major', value, 'no-transpose', 3, 3, 3, A, 3, tau, C, 3, work ); + }; + } +}); + +tape( 'the function throws an error if provided a third argument which is not a valid trans', function test( t ) { + var values; + var work; + var tau; + var A; + var C; + var i; + + A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + work = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dorm2r( 'row-major', 'left', value, 3, 3, 3, A, 3, tau, C, 3, work ); + }; + } +}); + +tape( 'the function throws an error if provided an eighth argument which is not a valid `LDA` value (row-major)', function test( t ) { + var values; + var work; + var tau; + var A; + var C; + var i; + + A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + work = new Float64Array( 3 ); + + values = [ + 0, + 1, + 2 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, value, tau, C, 3, work ); + }; + } +}); + +tape( 'the function throws an error if provided a twelfth argument which is not a valid `LDC` value (row-major)', function test( t ) { + var values; + var work; + var tau; + var A; + var C; + var i; + + A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + work = new Float64Array( 3 ); + + values = [ + 0, + 1, + 2 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dorm2r( 'row-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, value, work ); + }; + } +}); + +tape( 'the function throws an error if provided a twelfth argument which is not a valid `LDC` value (column-major)', function test( t ) { + var values; + var work; + var tau; + var A; + var C; + var i; + + A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + work = new Float64Array( 3 ); + + values = [ + 0, + 1, + 2 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dorm2r( 'column-major', 'left', 'no-transpose', 3, 3, 3, A, 3, tau, C, value, work ); + }; + } +}); + +tape( 'the function applies Q from the left without transpose (row-major)', function test( t ) { + var expected; + var work; + var data; + var tau; + var out; + var A; + var C; + + data = LEFT_NOTRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.order, data.side, data.trans, data.M, data.N, data.K, A, data.LDA, tau, C, data.LDC, work ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (column-major)', function test( t ) { + var expected; + var work; + var data; + var tau; + var out; + var A; + var C; + + data = LEFT_NOTRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.order, data.side, data.trans, data.M, data.N, data.K, A, data.LDA, tau, C, data.LDC, work ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (row-major)', function test( t ) { + var expected; + var work; + var data; + var tau; + var out; + var A; + var C; + + data = LEFT_TRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.order, data.side, data.trans, data.M, data.N, data.K, A, data.LDA, tau, C, data.LDC, work ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (column-major)', function test( t ) { + var expected; + var work; + var data; + var tau; + var out; + var A; + var C; + + data = LEFT_TRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.order, data.side, data.trans, data.M, data.N, data.K, A, data.LDA, tau, C, data.LDC, work ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.js new file mode 100644 index 000000000000..1243475c2c71 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 dorm2r = 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 dorm2r, '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 dorm2r.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 dorm2r = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dorm2r, 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 dorm2r; + var main; + + main = require( './../lib/dorm2r.js' ); + + dorm2r = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dorm2r, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.ndarray.js new file mode 100644 index 000000000000..0d3f80515ae2 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dorm2r/test/test.ndarray.js @@ -0,0 +1,645 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 Float64Array = require( '@stdlib/array/float64' ); +var dorm2r = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var LEFT_NOTRANS_ROW_MAJOR = require( './fixtures/left_notrans_row_major.json' ); +var LEFT_NOTRANS_COL_MAJOR = require( './fixtures/left_notrans_col_major.json' ); +var LEFT_TRANS_ROW_MAJOR = require( './fixtures/left_trans_row_major.json' ); +var LEFT_TRANS_COL_MAJOR = require( './fixtures/left_trans_col_major.json' ); +var LARGE_STRIDES_LEFT_NOTRANS_ROW_MAJOR = require( './fixtures/large_strides/left_notrans_row_major.json' ); +var LARGE_STRIDES_LEFT_NOTRANS_COL_MAJOR = require( './fixtures/large_strides/left_notrans_col_major.json' ); +var LARGE_STRIDES_LEFT_TRANS_ROW_MAJOR = require( './fixtures/large_strides/left_trans_row_major.json' ); +var LARGE_STRIDES_LEFT_TRANS_COL_MAJOR = require( './fixtures/large_strides/left_trans_col_major.json' ); +var MIXED_STRIDES_LEFT_NOTRANS_ROW_MAJOR = require( './fixtures/mixed_strides/left_notrans_row_major.json' ); +var MIXED_STRIDES_LEFT_NOTRANS_COL_MAJOR = require( './fixtures/mixed_strides/left_notrans_col_major.json' ); +var MIXED_STRIDES_LEFT_TRANS_ROW_MAJOR = require( './fixtures/mixed_strides/left_trans_row_major.json' ); +var MIXED_STRIDES_LEFT_TRANS_COL_MAJOR = require( './fixtures/mixed_strides/left_trans_col_major.json' ); +var NEGATIVE_STRIDES_LEFT_NOTRANS_ROW_MAJOR = require( './fixtures/negative_strides/left_notrans_row_major.json' ); +var NEGATIVE_STRIDES_LEFT_NOTRANS_COL_MAJOR = require( './fixtures/negative_strides/left_notrans_col_major.json' ); +var NEGATIVE_STRIDES_LEFT_TRANS_ROW_MAJOR = require( './fixtures/negative_strides/left_trans_row_major.json' ); +var NEGATIVE_STRIDES_LEFT_TRANS_COL_MAJOR = require( './fixtures/negative_strides/left_trans_col_major.json' ); +var OFFSETS_LEFT_NOTRANS_ROW_MAJOR = require( './fixtures/offsets/left_notrans_row_major.json' ); +var OFFSETS_LEFT_NOTRANS_COL_MAJOR = require( './fixtures/offsets/left_notrans_col_major.json' ); +var OFFSETS_LEFT_TRANS_ROW_MAJOR = require( './fixtures/offsets/left_trans_row_major.json' ); +var OFFSETS_LEFT_TRANS_COL_MAJOR = require( './fixtures/offsets/left_trans_col_major.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dorm2r, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 19', function test( t ) { + t.strictEqual( dorm2r.length, 19, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid side', function test( t ) { + var values; + var work; + var tau; + var A; + var C; + var i; + + A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + work = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dorm2r( value, 'no-transpose', 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is not a valid trans', function test( t ) { + var values; + var work; + var tau; + var A; + var C; + var i; + + A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ] ); + tau = new Float64Array( [ 7.0, 8.0, 9.0 ] ); + C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] ); + work = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dorm2r( 'left', value, 3, 3, 3, A, 3, 1, 0, tau, 1, 0, C, 3, 1, 0, work, 1, 0 ); + }; + } +}); + +tape( 'the function applies Q from the left without transpose (row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = LEFT_NOTRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = LEFT_NOTRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = LEFT_TRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = LEFT_TRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (large strides, row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = LARGE_STRIDES_LEFT_NOTRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (large strides, column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = LARGE_STRIDES_LEFT_NOTRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (large strides, row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = LARGE_STRIDES_LEFT_TRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (large strides, column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = LARGE_STRIDES_LEFT_TRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (mixed strides, row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = MIXED_STRIDES_LEFT_NOTRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (mixed strides, column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = MIXED_STRIDES_LEFT_NOTRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (mixed strides, row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = MIXED_STRIDES_LEFT_TRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (mixed strides, column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = MIXED_STRIDES_LEFT_TRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (negative strides, row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = NEGATIVE_STRIDES_LEFT_NOTRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (negative strides, column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = NEGATIVE_STRIDES_LEFT_NOTRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (negative strides, row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = NEGATIVE_STRIDES_LEFT_TRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (negative strides, column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = NEGATIVE_STRIDES_LEFT_TRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (offsets, row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = OFFSETS_LEFT_NOTRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left without transpose (offsets, column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = OFFSETS_LEFT_NOTRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (offsets, row-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = OFFSETS_LEFT_TRANS_ROW_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function applies Q from the left with transpose (offsets, column-major)', function test( t ) { + var expected; + var data; + var work; + var tau; + var out; + var A; + var C; + + data = OFFSETS_LEFT_TRANS_COL_MAJOR; + + A = new Float64Array( data.A ); + tau = new Float64Array( data.tau ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + expected = new Float64Array( data.C_out ); + + out = dorm2r( data.side, data.trans, data.M, data.N, data.K, A, data.strideA1, data.strideA2, data.offsetA, tau, data.strideTau, data.offsetTau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + t.strictEqual( out, C, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +});