Skip to content

Commit 3f05266

Browse files
committed
test: add ts test file
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent b516efd commit 3f05266

File tree

1 file changed

+379
-0
lines changed
  • lib/node_modules/@stdlib/lapack/base/dgebal/docs/types

1 file changed

+379
-0
lines changed
Lines changed: 379 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,379 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
import dgebal = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number...
25+
{
26+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
27+
const out = new Int32Array( 2 );
28+
const scale = new Float64Array( 2 );
29+
30+
dgebal( 'row-major', 'both', 2, A, 2, out, scale ); // $ExpectType number
31+
}
32+
33+
// The compiler throws an error if the function is provided a first argument which is not a string...
34+
{
35+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
36+
const out = new Int32Array( 2 );
37+
const scale = new Float64Array( 2 );
38+
39+
dgebal( 5, 'both', 2, A, 2, out, scale ); // $ExpectError
40+
dgebal( true, 'both', 2, A, 2, out, scale ); // $ExpectError
41+
dgebal( false, 'both', 2, A, 2, out, scale ); // $ExpectError
42+
dgebal( null, 'both', 2, A, 2, out, scale ); // $ExpectError
43+
dgebal( void 0, 'both', 2, A, 2, out, scale ); // $ExpectError
44+
dgebal( [], 'both', 2, A, 2, out, scale ); // $ExpectError
45+
dgebal( {}, 'both', 2, A, 2, out, scale ); // $ExpectError
46+
dgebal( ( x: number ): number => x, 'both', 2, A, 2, out, scale ); // $ExpectError
47+
}
48+
49+
// The compiler throws an error if the function is provided a second argument which is not a string...
50+
{
51+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
52+
const out = new Int32Array( 2 );
53+
const scale = new Float64Array( 2 );
54+
55+
dgebal( 'row-major', 5, 2, A, 2, out, scale ); // $ExpectError
56+
dgebal( 'row-major', true, 2, A, 2, out, scale ); // $ExpectError
57+
dgebal( 'row-major', false, 2, A, 2, out, scale ); // $ExpectError
58+
dgebal( 'row-major', null, 2, A, 2, out, scale ); // $ExpectError
59+
dgebal( 'row-major', void 0, 2, A, 2, out, scale ); // $ExpectError
60+
dgebal( 'row-major', [], 2, A, 2, out, scale ); // $ExpectError
61+
dgebal( 'row-major', {}, 2, A, 2, out, scale ); // $ExpectError
62+
dgebal( 'row-major', ( x: number ): number => x, 2, A, 2, out, scale ); // $ExpectError
63+
}
64+
65+
66+
// The compiler throws an error if the function is provided a third argument which is not a number...
67+
{
68+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
69+
const out = new Int32Array( 2 );
70+
const scale = new Float64Array( 2 );
71+
72+
dgebal( 'row-major', 'both', '5', A, 2, out, scale ); // $ExpectError
73+
dgebal( 'row-major', 'both', true, A, 2, out, scale ); // $ExpectError
74+
dgebal( 'row-major', 'both', false, A, 2, out, scale ); // $ExpectError
75+
dgebal( 'row-major', 'both', null, A, 2, out, scale ); // $ExpectError
76+
dgebal( 'row-major', 'both', void 0, A, 2, out, scale ); // $ExpectError
77+
dgebal( 'row-major', 'both', [], A, 2, out, scale ); // $ExpectError
78+
dgebal( 'row-major', 'both', {}, A, 2, out, scale ); // $ExpectError
79+
dgebal( 'row-major', 'both', ( x: number ): number => x, A, 2, out, scale ); // $ExpectError
80+
}
81+
82+
// The compiler throws an error if the function is provided a fourth argument which is not a Float64Array...
83+
{
84+
const out = new Int32Array( 2 );
85+
const scale = new Float64Array( 2 );
86+
87+
dgebal( 'row-major', 'both', 2, '5', 2, out, scale ); // $ExpectError
88+
dgebal( 'row-major', 'both', 2, 5, 2, out, scale ); // $ExpectError
89+
dgebal( 'row-major', 'both', 2, true, 2, out, scale ); // $ExpectError
90+
dgebal( 'row-major', 'both', 2, false, 2, out, scale ); // $ExpectError
91+
dgebal( 'row-major', 'both', 2, null, 2, out, scale ); // $ExpectError
92+
dgebal( 'row-major', 'both', 2, void 0, 2, out, scale ); // $ExpectError
93+
dgebal( 'row-major', 'both', 2, [], 2, out, scale ); // $ExpectError
94+
dgebal( 'row-major', 'both', 2, {}, 2, out, scale ); // $ExpectError
95+
dgebal( 'row-major', 'both', 2, ( x: number ): number => x, 2, out, scale ); // $ExpectError
96+
}
97+
98+
// The compiler throws an error if the function is provided a fifth argument which is not a number...
99+
{
100+
const out = new Int32Array( 2 );
101+
const scale = new Float64Array( 2 );
102+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
103+
104+
dgebal( 'row-major', 'both', 2, A, '5', out, scale ); // $ExpectError
105+
dgebal( 'row-major', 'both', 2, A, true, out, scale ); // $ExpectError
106+
dgebal( 'row-major', 'both', 2, A, false, out, scale ); // $ExpectError
107+
dgebal( 'row-major', 'both', 2, A, null, out, scale ); // $ExpectError
108+
dgebal( 'row-major', 'both', 2, A, void 0, out, scale ); // $ExpectError
109+
dgebal( 'row-major', 'both', 2, A, [], out, scale ); // $ExpectError
110+
dgebal( 'row-major', 'both', 2, A, {}, out, scale ); // $ExpectError
111+
dgebal( 'row-major', 'both', 2, A, ( x: number ): number => x, out, scale ); // $ExpectError
112+
}
113+
114+
// The compiler throws an error if the function is provided a sixth argument which is not a Int32Array...
115+
{
116+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
117+
const scale = new Float64Array( 2 );
118+
119+
dgebal( 'row-major', 'both', 2, A, 2, '5', scale ); // $ExpectError
120+
dgebal( 'row-major', 'both', 2, A, 2, true, scale ); // $ExpectError
121+
dgebal( 'row-major', 'both', 2, A, 2, false, scale ); // $ExpectError
122+
dgebal( 'row-major', 'both', 2, A, 2, null, scale ); // $ExpectError
123+
dgebal( 'row-major', 'both', 2, A, 2, void 0, scale ); // $ExpectError
124+
dgebal( 'row-major', 'both', 2, A, 2, [], scale ); // $ExpectError
125+
dgebal( 'row-major', 'both', 2, A, 2, {}, scale ); // $ExpectError
126+
dgebal( 'row-major', 'both', 2, A, 2, ( x: number ): number => x, scale ); // $ExpectError
127+
}
128+
129+
// The compiler throws an error if the function is provided a seventh argument which is not a Float64Array...
130+
{
131+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
132+
const out = new Int32Array( 2 );
133+
134+
dgebal( 'row-major', 'both', 2, A, 2, out, '5' ); // $ExpectError
135+
dgebal( 'row-major', 'both', 2, A, 2, out, true ); // $ExpectError
136+
dgebal( 'row-major', 'both', 2, A, 2, out, false ); // $ExpectError
137+
dgebal( 'row-major', 'both', 2, A, 2, out, null ); // $ExpectError
138+
dgebal( 'row-major', 'both', 2, A, 2, out, void 0 ); // $ExpectError
139+
dgebal( 'row-major', 'both', 2, A, 2, out, [] ); // $ExpectError
140+
dgebal( 'row-major', 'both', 2, A, 2, out, {} ); // $ExpectError
141+
dgebal( 'row-major', 'both', 2, A, 2, out, ( x: number ): number => x ); // $ExpectError
142+
}
143+
144+
// The compiler throws an error if the function is provided an unsupported number of arguments...
145+
{
146+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
147+
const out = new Int32Array( 2 );
148+
const scale = new Float64Array( 2 );
149+
150+
dgebal(); // $ExpectError
151+
dgebal( 'row-major' ); // $ExpectError
152+
dgebal( 'row-major', 'both' ); // $ExpectError
153+
dgebal( 'row-major', 'both', 2 ); // $ExpectError
154+
dgebal( 'row-major', 'both', 2, A ); // $ExpectError
155+
dgebal( 'row-major', 'both', 2, A, 2 ); // $ExpectError
156+
dgebal( 'row-major', 'both', 2, A, 2, out ); // $ExpectError
157+
dgebal( 'row-major', 'both', 2, A, 2, out, scale, 10 ); // $ExpectError
158+
}
159+
160+
// Attached to main export is an `ndarray` method which returns a number...
161+
{
162+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
163+
const out = new Int32Array( 2 );
164+
const scale = new Float64Array( 2 );
165+
166+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectType number
167+
}
168+
169+
// The compiler throws an error if the function is provided a first argument which is not a string...
170+
{
171+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
172+
const out = new Int32Array( 2 );
173+
const scale = new Float64Array( 2 );
174+
175+
dgebal.ndarray( 5, 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
176+
dgebal.ndarray( true, 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
177+
dgebal.ndarray( false, 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
178+
dgebal.ndarray( null, 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
179+
dgebal.ndarray( void 0, 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
180+
dgebal.ndarray( [], 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
181+
dgebal.ndarray( {}, 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
182+
dgebal.ndarray( ( x: number ): number => x, 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
183+
}
184+
185+
// The compiler throws an error if the function is provided a second argument which is not a number...
186+
{
187+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
188+
const out = new Int32Array( 2 );
189+
const scale = new Float64Array( 2 );
190+
191+
dgebal.ndarray( 'both', '5', A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
192+
dgebal.ndarray( 'both', true, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
193+
dgebal.ndarray( 'both', false, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
194+
dgebal.ndarray( 'both', null, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
195+
dgebal.ndarray( 'both', void 0, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
196+
dgebal.ndarray( 'both', [], A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
197+
dgebal.ndarray( 'both', {}, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
198+
dgebal.ndarray( 'both', ( x: number ): number => x, A, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
199+
}
200+
201+
// The compiler throws an error if the function is provided a third argument which is not a Float64Array...
202+
{
203+
const out = new Int32Array( 2 );
204+
const scale = new Float64Array( 2 );
205+
206+
dgebal.ndarray( 'both', 2, '5', 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
207+
dgebal.ndarray( 'both', 2, true, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
208+
dgebal.ndarray( 'both', 2, false, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
209+
dgebal.ndarray( 'both', 2, null, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
210+
dgebal.ndarray( 'both', 2, void 0, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
211+
dgebal.ndarray( 'both', 2, [], 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
212+
dgebal.ndarray( 'both', 2, {}, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
213+
dgebal.ndarray( 'both', 2, ( x: number ): number => x, 2, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
214+
}
215+
216+
// The compiler throws an error if the function is provided a fourth argument which is not a number...
217+
{
218+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
219+
const out = new Int32Array( 2 );
220+
const scale = new Float64Array( 2 );
221+
222+
dgebal.ndarray( 'both', 2, A, '5', 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
223+
dgebal.ndarray( 'both', 2, A, true, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
224+
dgebal.ndarray( 'both', 2, A, false, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
225+
dgebal.ndarray( 'both', 2, A, null, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
226+
dgebal.ndarray( 'both', 2, A, void 0, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
227+
dgebal.ndarray( 'both', 2, A, [], 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
228+
dgebal.ndarray( 'both', 2, A, {}, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
229+
dgebal.ndarray( 'both', 2, A, ( x: number ): number => x, 1, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
230+
}
231+
232+
// The compiler throws an error if the function is provided a fifth argument which is not a number...
233+
{
234+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
235+
const out = new Int32Array( 2 );
236+
const scale = new Float64Array( 2 );
237+
238+
dgebal.ndarray( 'both', 2, A, 2, '5', 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
239+
dgebal.ndarray( 'both', 2, A, 2, true, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
240+
dgebal.ndarray( 'both', 2, A, 2, false, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
241+
dgebal.ndarray( 'both', 2, A, 2, null, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
242+
dgebal.ndarray( 'both', 2, A, 2, void 0, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
243+
dgebal.ndarray( 'both', 2, A, 2, [], 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
244+
dgebal.ndarray( 'both', 2, A, 2, {}, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
245+
dgebal.ndarray( 'both', 2, A, 2, ( x: number ): number => x, 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
246+
}
247+
248+
// The compiler throws an error if the function is provided a sixth argument which is not a number...
249+
{
250+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
251+
const out = new Int32Array( 2 );
252+
const scale = new Float64Array( 2 );
253+
254+
dgebal.ndarray( 'both', 2, A, 2, 1, '5', out, 1, 0, scale, 1, 0 ); // $ExpectError
255+
dgebal.ndarray( 'both', 2, A, 2, 1, true, out, 1, 0, scale, 1, 0 ); // $ExpectError
256+
dgebal.ndarray( 'both', 2, A, 2, 1, false, out, 1, 0, scale, 1, 0 ); // $ExpectError
257+
dgebal.ndarray( 'both', 2, A, 2, 1, null, out, 1, 0, scale, 1, 0 ); // $ExpectError
258+
dgebal.ndarray( 'both', 2, A, 2, 1, void 0, out, 1, 0, scale, 1, 0 ); // $ExpectError
259+
dgebal.ndarray( 'both', 2, A, 2, 1, [], out, 1, 0, scale, 1, 0 ); // $ExpectError
260+
dgebal.ndarray( 'both', 2, A, 2, 1, {}, out, 1, 0, scale, 1, 0 ); // $ExpectError
261+
dgebal.ndarray( 'both', 2, A, 2, 1, ( x: number ): number => x, out, 1, 0, scale, 1, 0 ); // $ExpectError
262+
}
263+
264+
// The compiler throws an error if the function is provided a seventh argument which is not a Int32Array...
265+
{
266+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
267+
const scale = new Float64Array( 2 );
268+
269+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, '5', 1, 0, scale, 1, 0 ); // $ExpectError
270+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, 5, 1, 0, scale, 1, 0 ); // $ExpectError
271+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, true, 1, 0, scale, 1, 0 ); // $ExpectError
272+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, false, 1, 0, scale, 1, 0 ); // $ExpectError
273+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, null, 1, 0, scale, 1, 0 ); // $ExpectError
274+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, void 0, 1, 0, scale, 1, 0 ); // $ExpectError
275+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, [], 1, 0, scale, 1, 0 ); // $ExpectError
276+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, {}, 1, 0, scale, 1, 0 ); // $ExpectError
277+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, ( x: number ): number => x, 1, 0, scale, 1, 0 ); // $ExpectError
278+
}
279+
280+
// The compiler throws an error if the function is provided an eighth argument which is not a Int32Array...
281+
{
282+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
283+
const scale = new Float64Array( 2 );
284+
285+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, '5', 1, 0, scale, 1, 0 ); // $ExpectError
286+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, 5, 1, 0, scale, 1, 0 ); // $ExpectError
287+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, true, 1, 0, scale, 1, 0 ); // $ExpectError
288+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, false, 1, 0, scale, 1, 0 ); // $ExpectError
289+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, null, 1, 0, scale, 1, 0 ); // $ExpectError
290+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, void 0, 1, 0, scale, 1, 0 ); // $ExpectError
291+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, [], 1, 0, scale, 1, 0 ); // $ExpectError
292+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, {}, 1, 0, scale, 1, 0 ); // $ExpectError
293+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, ( x: number ): number => x, 1, 0, scale, 1, 0 ); // $ExpectError
294+
}
295+
296+
// The compiler throws an error if the function is provided a ninth argument which is not a number...
297+
{
298+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
299+
const out = new Int32Array( 2 );
300+
const scale = new Float64Array( 2 );
301+
302+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, '5', scale, 1, 0 ); // $ExpectError
303+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, true, scale, 1, 0 ); // $ExpectError
304+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, false, scale, 1, 0 ); // $ExpectError
305+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, null, scale, 1, 0 ); // $ExpectError
306+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, void 0, scale, 1, 0 ); // $ExpectError
307+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, [], scale, 1, 0 ); // $ExpectError
308+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, {}, scale, 1, 0 ); // $ExpectError
309+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, ( x: number ): number => x, scale, 1, 0 ); // $ExpectError
310+
}
311+
312+
// The compiler throws an error if the function is provided a tenth argument which is not a Float64Array...
313+
{
314+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
315+
const out = new Int32Array( 2 );
316+
317+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, '5', 1, 0 ); // $ExpectError
318+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, 5, 1, 0 ); // $ExpectError
319+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, true, 1, 0 ); // $ExpectError
320+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, false, 1, 0 ); // $ExpectError
321+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, null, 1, 0 ); // $ExpectError
322+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, void 0, 1, 0 ); // $ExpectError
323+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, [], 1, 0 ); // $ExpectError
324+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, {}, 1, 0 ); // $ExpectError
325+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError
326+
}
327+
328+
// The compiler throws an error if the function is provided an eleventh argument which is not a number...
329+
{
330+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
331+
const out = new Int32Array( 2 );
332+
const scale = new Float64Array( 2 );
333+
334+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, '5', 0 ); // $ExpectError
335+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, true, 0 ); // $ExpectError
336+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, false, 0 ); // $ExpectError
337+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, null, 0 ); // $ExpectError
338+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, void 0, 0 ); // $ExpectError
339+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, [], 0 ); // $ExpectError
340+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, {}, 0 ); // $ExpectError
341+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, ( x: number ): number => x, 0 ); // $ExpectError
342+
}
343+
344+
// The compiler throws an error if the function is provided a twelfth argument which is not a number...
345+
{
346+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
347+
const out = new Int32Array( 2 );
348+
const scale = new Float64Array( 2 );
349+
350+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, '5' ); // $ExpectError
351+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, true ); // $ExpectError
352+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, false ); // $ExpectError
353+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, null ); // $ExpectError
354+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, void 0 ); // $ExpectError
355+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, [] ); // $ExpectError
356+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, {} ); // $ExpectError
357+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, ( x: number ): number => x ); // $ExpectError
358+
}
359+
360+
// The compiler throws an error if the function is provided an unsupported number of arguments...
361+
{
362+
const A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
363+
const out = new Int32Array( 2 );
364+
const scale = new Float64Array( 2 );
365+
366+
dgebal.ndarray(); // $ExpectError
367+
dgebal.ndarray( 'none' ); // $ExpectError
368+
dgebal.ndarray( 'permute', 2 ); // $ExpectError
369+
dgebal.ndarray( 'scale', 2, A ); // $ExpectError
370+
dgebal.ndarray( 'both', 2, A, 2 ); // $ExpectError
371+
dgebal.ndarray( 'none', 2, A, 2, 1 ); // $ExpectError
372+
dgebal.ndarray( 'permute', 2, A, 2, 1, 0 ); // $ExpectError
373+
dgebal.ndarray( 'scale', 2, A, 2, 1, 0, out ); // $ExpectError
374+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1 ); // $ExpectError
375+
dgebal.ndarray( 'none', 2, A, 2, 1, 0, out, 1, 0 ); // $ExpectError
376+
dgebal.ndarray( 'permute', 2, A, 2, 1, 0, out, 1, 0, scale ); // $ExpectError
377+
dgebal.ndarray( 'scale', 2, A, 2, 1, 0, out, 1, 0, scale, 1 ); // $ExpectError
378+
dgebal.ndarray( 'both', 2, A, 2, 1, 0, out, 1, 0, scale, 1, 0, 10 ); // $ExpectError
379+
}

0 commit comments

Comments
 (0)