File tree 2 files changed +428
-0
lines changed
lib/node_modules/@stdlib/math/tools/unary/test
2 files changed +428
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2021 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
+ /* eslint-disable array-element-newline */
20
+
21
+ 'use strict' ;
22
+
23
+ var abs = require ( '@stdlib/math/base/special/abs' ) ;
24
+ var dabs = require ( '@stdlib/math/strided/special/dabs' ) ;
25
+ var sabs = require ( '@stdlib/math/strided/special/sabs' ) ;
26
+ var gabs = require ( '@stdlib/math/strided/special/abs' ) ;
27
+
28
+
29
+ // MAIN //
30
+
31
+ // Define a table for resolving unary functions based on argument data types:
32
+ var table = {
33
+ 'scalar' : [
34
+ 'number' , abs
35
+ ] ,
36
+ 'array' : [
37
+ 'float64' , dabs ,
38
+ 'float32' , sabs ,
39
+ 'generic' , gabs
40
+ ] ,
41
+ 'ndarray' : [
42
+ 'float64' , dabs . ndarray ,
43
+ 'float32' , sabs . ndarray ,
44
+ 'generic' , gabs . ndarray
45
+ ]
46
+ } ;
47
+
48
+
49
+ // EXPORTS //
50
+
51
+ module . exports = table ;
You can’t perform that action at this time.
0 commit comments