Skip to content

Commit 9d75e6c

Browse files
committed
Add namespace
1 parent 0d7516c commit 9d75e6c

File tree

5 files changed

+291
-0
lines changed

5 files changed

+291
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2020 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# Special Functions
22+
23+
> Standard library special math functions.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var ns = require( '@stdlib/math/special' );
31+
```
32+
33+
#### ns
34+
35+
Standard library special math functions.
36+
37+
```javascript
38+
var o = ns;
39+
// returns {...}
40+
```
41+
42+
### Exponential & Logarithmic Functions
43+
44+
<!-- <toc pattern="+(*log*|ln|exp*|*pow*)" ignore="logit" > -->
45+
46+
<!-- </toc> -->
47+
48+
### Trigonometric Functions
49+
50+
<!-- <toc pattern="*+(sin|cos|tan)*" ignore="+(kernel-sin|kernel-cos|kernel-tan)"> -->
51+
52+
<!-- </toc> -->
53+
54+
### Bessel Functions
55+
56+
<!-- <toc pattern="*bessel*" > -->
57+
58+
<!-- </toc> -->
59+
60+
### Absolute Value and Rounding Functions
61+
62+
<!-- <toc pattern="*+(abs|ceil|floor|clamp|trunc|round|signum)*" > -->
63+
64+
<!-- </toc> -->
65+
66+
### Other Special Functions
67+
68+
<!-- <toc ignore="*bessel*" ignore="*+(sin|cos|tan)*" ignore="+(*log*|ln|exp*|*pow*)" ignore="*+(abs|ceil|floor|clamp|trunc|round|signum)*" ignore="+(gamma-delta-ratio|gamma-lanczos-sum*|rempio2|kernel-*)" > -->
69+
70+
<!-- </toc> -->
71+
72+
</section>
73+
74+
<!-- /.usage -->
75+
76+
<section class="examples">
77+
78+
## Examples
79+
80+
<!-- TODO: better examples -->
81+
82+
<!-- eslint no-undef: "error" -->
83+
84+
```javascript
85+
var objectKeys = require( '@stdlib/utils/keys' );
86+
var ns = require( '@stdlib/math/special' );
87+
88+
console.log( objectKeys( ns ) );
89+
```
90+
91+
</section>
92+
93+
<!-- /.examples -->
94+
95+
<section class="links">
96+
97+
<!-- <toc-links> -->
98+
99+
<!-- </toc-links> -->
100+
101+
</section>
102+
103+
<!-- /.links -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2020 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+
'use strict';
20+
21+
var objectKeys = require( '@stdlib/utils/keys' );
22+
var ns = require( './../lib' );
23+
24+
console.log( objectKeys( ns ) );
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2020 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+
'use strict';
20+
21+
/*
22+
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
23+
*/
24+
25+
// MODULES //
26+
27+
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
28+
29+
30+
// MAIN //
31+
32+
/**
33+
* Top-level namespace.
34+
*
35+
* @namespace ns
36+
*/
37+
var ns = {};
38+
39+
/**
40+
* @name abs
41+
* @memberof ns
42+
* @readonly
43+
* @type {Function}
44+
* @see {@link module:@stdlib/math/special/abs}
45+
*/
46+
setReadOnly( ns, 'abs', require( '@stdlib/math/special/abs' ) );
47+
48+
/**
49+
* @name iabs
50+
* @memberof ns
51+
* @readonly
52+
* @type {Function}
53+
* @see {@link module:@stdlib/math/special/iabs}
54+
*/
55+
setReadOnly( ns, 'iabs', require( '@stdlib/math/special/iabs' ) );
56+
57+
58+
// EXPORTS //
59+
60+
module.exports = ns;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "@stdlib/math/special",
3+
"version": "0.0.0",
4+
"description": "Standard library special math functions.",
5+
"license": "Apache-2.0",
6+
"author": {
7+
"name": "The Stdlib Authors",
8+
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
9+
},
10+
"contributors": [
11+
{
12+
"name": "The Stdlib Authors",
13+
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
14+
}
15+
],
16+
"main": "./lib",
17+
"directories": {
18+
"example": "./examples",
19+
"lib": "./lib",
20+
"test": "./test"
21+
},
22+
"scripts": {},
23+
"homepage": "https://github.com/stdlib-js/stdlib",
24+
"repository": {
25+
"type": "git",
26+
"url": "git://github.com/stdlib-js/stdlib.git"
27+
},
28+
"bugs": {
29+
"url": "https://github.com/stdlib-js/stdlib/issues"
30+
},
31+
"dependencies": {},
32+
"devDependencies": {},
33+
"engines": {
34+
"node": ">=0.10.0",
35+
"npm": ">2.7.0"
36+
},
37+
"os": [
38+
"aix",
39+
"darwin",
40+
"freebsd",
41+
"linux",
42+
"macos",
43+
"openbsd",
44+
"sunos",
45+
"win32",
46+
"windows"
47+
],
48+
"keywords": [
49+
"stdlib",
50+
"stdmath",
51+
"standard",
52+
"library",
53+
"std",
54+
"lib",
55+
"vector",
56+
"array",
57+
"ndarray",
58+
"element-wise",
59+
"elementwise",
60+
"math",
61+
"mathematics",
62+
"special"
63+
]
64+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2020 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+
'use strict';
20+
21+
// MODULES //
22+
23+
var tape = require( 'tape' );
24+
var objectKeys = require( '@stdlib/utils/keys' );
25+
var ns = require( './../lib' );
26+
27+
28+
// TESTS //
29+
30+
tape( 'main export is an object', function test( t ) {
31+
t.ok( true, __filename );
32+
t.equal( typeof ns, 'object', 'main export is an object' );
33+
t.end();
34+
});
35+
36+
tape( 'the exported object contains strided array interfaces', function test( t ) {
37+
var keys = objectKeys( ns );
38+
t.equal( keys.length > 0, true, 'has keys' );
39+
t.end();
40+
});

0 commit comments

Comments
 (0)