Skip to content

Commit ab4c30f

Browse files
committed
changes made
1 parent 8baa0ac commit ab4c30f

File tree

5 files changed

+11
-19
lines changed

5 files changed

+11
-19
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static double benchmark( void ) {
104104

105105
t = tic();
106106
for ( i = 0; i < ITERATIONS; i++ ) {
107-
stdlib_base_minmax( x1[ i % 100 ], x2[ i % 100 ], &y, 1, 0 );
107+
stdlib_base_minmax( x1[ i % 100 ], x2[ i % 100 ], &y );
108108
if ( y != y ) {
109109
printf( "should not return NaN\n" );
110110
break;

lib/node_modules/@stdlib/math/base/special/minmax/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int main(void) {
2727
int i;
2828
for ( i = 0; i < 10; i++ ) {
2929
double out[] = { 0.0, 0.0 };
30-
stdlib_base_minmax( x1[ i ], x2[ i ], &out, 1, 0 );
30+
stdlib_base_minmax( x1[ i ], x2[ i ], &out );
3131
printf( "x1[ %d ]: %lf, x2[ %d ]: %lf, minmax( x1[ %d ], x2[ %d ] ): ( %lf, %lf )\n", i, x1[ i ], i, x2[ i ], i, i, out[0], out[1] );
3232
}
3333
}

lib/node_modules/@stdlib/math/base/special/minmax/include/stdlib/math/base/special/minmax.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
extern "C" {
2727
#endif
2828

29-
/**
30-
* Structure for holding the minimum and maximum values.
31-
*/
32-
3329
/**
3430
* Evaluates the min and max of two values.
3531
*
@@ -40,7 +36,7 @@ extern "C" {
4036
* @param offset output array index offset
4137
* @return A double containing the minimum and maximum values
4238
*/
43-
double stdlib_base_minmax(const double x, const double y, double* out, int stride, int offset );
39+
double stdlib_base_minmax(const double x, const double y, double* out );
4440

4541
#ifdef __cplusplus
4642
}

lib/node_modules/@stdlib/math/base/special/minmax/src/addon.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@
3333

3434
double minmax( double x, double y ) {
3535

36-
double result;
36+
double result[] = { 0.0, 0.0 };
3737

38-
stdlib_base_minmax( x, y, &result, 1, 0 );
39-
40-
return result;
38+
return stdlib_base_minmax( x, y, &result );
4139

4240
}
4341

lib/node_modules/@stdlib/math/base/special/minmax/src/main.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,23 @@
2828
* @param x First value
2929
* @param y Second value
3030
* @param out output array
31-
* @param stride output array stride
32-
* @param offset output array index offset
3331
* @return A double containing the minimum and maximum values
3432
*
3533
* @example
36-
* double y = stdlib_base_minmax( 4.0, -5.0, [ 0.0, 0.0 ], 1, 0 );
34+
* double y = stdlib_base_minmax( 4.0, -5.0, [ 0.0, 0.0 ] );
3735
* // returns [ -5.0, 4.0 ]
3836
*/
3937

4038

41-
double stdlib_base_minmax( const double x, const double y, double* out, int stride, int offset ) {
39+
double stdlib_base_minmax( const double x, const double y, double* out ) {
4240

4341
if( stdlib_base_is_nan( x ) || stdlib_base_is_nan( y ) ){
44-
out[ offset ] = 0.0 / 0.0;
45-
out[ offset + stride ] = 0.0 / 0.0;
42+
out[ 0 ] = 0.0 / 0.0;
43+
out[ 1 ] = 0.0 / 0.0;
4644
}
4745
else{
48-
out[ offset ] = stdlib_base_min( x, y );
49-
out[ offset + stride ] = stdlib_base_max( x, y );
46+
out[ 0 ] = stdlib_base_min( x, y );
47+
out[ 1 ] = stdlib_base_max( x, y );
5048
}
5149

5250
return *out;

0 commit comments

Comments
 (0)