Skip to content

Commit 83cdc14

Browse files
committed
Merge branch 'develop' into feat/heavisidef
2 parents 3eb7264 + b599489 commit 83cdc14

File tree

43 files changed

+7524
-335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+7524
-335
lines changed

lib/node_modules/@stdlib/array/typed/test/test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,8 @@ tape( 'the function returns a typed array (default, complex typed array)', funct
809809
var out;
810810

811811
arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] );
812+
813+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
812814
out = typedarray( arr );
813815
t.strictEqual( instanceOf( out, Float64Array ), true, 'returns expected value' );
814816
t.strictEqual( out.length, 4, 'returns expected value' );
@@ -828,6 +830,8 @@ tape( 'the function returns a typed array (dtype=float64, complex typed array)',
828830
var out;
829831

830832
arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] );
833+
834+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
831835
out = typedarray( arr, 'float64' );
832836
t.strictEqual( instanceOf( out, Float64Array ), true, 'returns expected value' );
833837
t.strictEqual( out.length, 4, 'returns expected value' );
@@ -847,6 +851,8 @@ tape( 'the function returns a typed array (dtype=float32, complex typed array)',
847851
var out;
848852

849853
arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
854+
855+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
850856
out = typedarray( arr, 'float32' );
851857
t.strictEqual( instanceOf( out, Float32Array ), true, 'returns expected value' );
852858
t.strictEqual( out.length, 4, 'returns expected value' );
@@ -908,6 +914,8 @@ tape( 'the function returns a typed array (dtype=int32, complex typed array)', f
908914
var out;
909915

910916
arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] );
917+
918+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
911919
out = typedarray( arr, 'int32' );
912920
t.strictEqual( instanceOf( out, Int32Array ), true, 'returns expected value' );
913921
t.strictEqual( out.length, 4, 'returns expected value' );
@@ -927,6 +935,8 @@ tape( 'the function returns a typed array (dtype=int16, complex typed array)', f
927935
var out;
928936

929937
arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] );
938+
939+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
930940
out = typedarray( arr, 'int16' );
931941
t.strictEqual( instanceOf( out, Int16Array ), true, 'returns expected value' );
932942
t.strictEqual( out.length, 4, 'returns expected value' );
@@ -946,6 +956,8 @@ tape( 'the function returns a typed array (dtype=int8, complex typed array)', fu
946956
var out;
947957

948958
arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] );
959+
960+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
949961
out = typedarray( arr, 'int8' );
950962
t.strictEqual( instanceOf( out, Int8Array ), true, 'returns expected value' );
951963
t.strictEqual( out.length, 4, 'returns expected value' );
@@ -965,6 +977,8 @@ tape( 'the function returns a typed array (dtype=uint32, complex typed array)',
965977
var out;
966978

967979
arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] );
980+
981+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
968982
out = typedarray( arr, 'uint32' );
969983
t.strictEqual( instanceOf( out, Uint32Array ), true, 'returns expected value' );
970984
t.strictEqual( out.length, 4, 'returns expected value' );
@@ -984,6 +998,8 @@ tape( 'the function returns a typed array (dtype=uint16, complex typed array)',
984998
var out;
985999

9861000
arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] );
1001+
1002+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
9871003
out = typedarray( arr, 'uint16' );
9881004
t.strictEqual( instanceOf( out, Uint16Array ), true, 'returns expected value' );
9891005
t.strictEqual( out.length, 4, 'returns expected value' );
@@ -1003,6 +1019,8 @@ tape( 'the function returns a typed array (dtype=uint8, complex typed array)', f
10031019
var out;
10041020

10051021
arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] );
1022+
1023+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
10061024
out = typedarray( arr, 'uint8' );
10071025
t.strictEqual( instanceOf( out, Uint8Array ), true, 'returns expected value' );
10081026
t.strictEqual( out.length, 4, 'returns expected value' );
@@ -1022,6 +1040,8 @@ tape( 'the function returns a typed array (dtype=uint8c, complex typed array)',
10221040
var out;
10231041

10241042
arr = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0 ] );
1043+
1044+
// Note: this is effectively a reinterpretation of the complex number array as an array of interleaved real and imaginary components
10251045
out = typedarray( arr, 'uint8c' );
10261046
t.strictEqual( instanceOf( out, Uint8ClampedArray ), true, 'returns expected value' );
10271047
t.strictEqual( out.length, 4, 'returns expected value' );

lib/node_modules/@stdlib/math/base/special/gammasgn/README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,12 @@ limitations under the License.
2626

2727
The sign of the [gamma-function][@stdlib/math/base/special/gamma] is defined as
2828

29-
<!-- <equation class="equation" label="eq:gamma_sign_function" align="center" raw="\operatorname{gammasgn} ( x ) = \begin{cases} 1 & \textrm{if}\ \Gamma > 1 \\ -1 & \textrm{if}\ \Gamma < 1 \\ 0 & \textrm{otherwise}\ \end{cases}" alt="Sign of the gamma function"> -->
29+
<!-- <equation class="equation" label="eq:gamma_sign_function" align="center" raw="\operatorname{gammasgn} ( x ) = \begin{cases} 1 & \textrm{if}\ \Gamma > 0 \\ -1 & \textrm{if}\ \Gamma < 0 \\ 0 & \textrm{otherwise}\ \end{cases}" alt="Sign of the gamma function"> -->
3030

3131
```math
32-
\mathop{\mathrm{gammasgn}} ( x ) = \begin{cases} 1 & \textrm{if}\ \Gamma > 1 \\ -1 & \textrm{if}\ \Gamma < 1 \\ 0 & \textrm{otherwise}\ \end{cases}
32+
\mathop{\mathrm{gammasgn}} ( x ) = \begin{cases} 1 & \textrm{if}\ \Gamma > 0 \\ -1 & \textrm{if}\ \Gamma < 0 \\ 0 & \textrm{otherwise}\ \end{cases}
3333
```
3434

35-
<!-- <div class="equation" align="center" data-raw-text="\operatorname{gammasgn} ( x ) = \begin{cases} 1 &amp; \textrm{if}\ \Gamma &gt; 1 \\ -1 &amp; \textrm{if}\ \Gamma &lt; 1 \\ 0 &amp; \textrm{otherwise}\ \end{cases}" data-equation="eq:gamma_sign_function">
36-
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@50b141156b147529227e2eb4247eda81c781dec9/lib/node_modules/@stdlib/math/base/special/gammasgn/docs/img/equation_gamma_sign_function.svg" alt="Sign of the gamma function">
37-
<br>
38-
</div> -->
39-
4035
<!-- </equation> -->
4136

4237
The [gamma function][@stdlib/math/base/special/gamma] can be computed as the product of `gammasgn(x)` and `exp(gammaln(x))`.
@@ -185,7 +180,7 @@ int main( void ) {
185180
for ( i = 0; i < 100; i++ ) {
186181
x = ( (double)rand() / (double)RAND_MAX ) * 100.0;
187182
v = stdlib_base_gammasgn( x );
188-
printf( "gammasgn%lf = %lf\n", x, v );
183+
printf( "gammasgn(%lf) = %lf\n", x, v );
189184
}
190185
}
191186
```

lib/node_modules/@stdlib/math/base/special/gammasgn/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bench( pkg, function benchmark( b ) {
3434
var y;
3535
var i;
3636

37-
x = uniform( 100, 0.0, 171.0 );
37+
x = uniform( 100, -10.0, 10.0 );
3838

3939
b.tic();
4040
for ( i = 0; i < b.iterations; i++ ) {

lib/node_modules/@stdlib/math/base/special/gammasgn/benchmark/benchmark.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4343
var y;
4444
var i;
4545

46-
x = uniform( 100, 0.0, 171.0 );
46+
x = uniform( 100, -10.0, 10.0 );
4747

4848
b.tic();
4949
for ( i = 0; i < b.iterations; i++ ) {

lib/node_modules/@stdlib/math/base/special/gammasgn/benchmark/c/native/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static double benchmark( void ) {
9797
int i;
9898

9999
for ( i = 0; i < 100; i++ ) {
100-
x[ i ] = ( 171.0 * rand_double() ) - 0.0;
100+
x[ i ] = ( 100.0 * rand_double() ) - 50.0;
101101
}
102102

103103
t = tic();

lib/node_modules/@stdlib/math/base/special/gammasgn/benchmark/python/scipy/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def print_results(elapsed):
7373
def benchmark():
7474
"""Run the benchmark and print benchmark results."""
7575
setup = "from scipy.special import gammasgn; from random import random;"
76-
stmt = "y = gammasgn(171.0*random() - 0.0)"
76+
stmt = "y = gammasgn(100.0*random() - 50.0)"
7777

7878
t = timeit.Timer(stmt, setup=setup)
7979

0 commit comments

Comments
 (0)