Skip to content

Commit 8292775

Browse files
committed
Auto-generated commit
1 parent 4260a9b commit 8292775

18 files changed

Lines changed: 1354 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-05-20)
7+
## Unreleased (2025-06-14)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`fe35e83`](https://github.com/stdlib-js/stdlib/commit/fe35e83251890e69ae041104dfcefa9bcfbbd37a) - add C implementation for `math/base/special/minmaxabs` [(#6983)](https://github.com/stdlib-js/stdlib/pull/6983)
14+
15+
</section>
16+
17+
<!-- /.features -->
818

919
<section class="commits">
1020

1121
### Commits
1222

1323
<details>
1424

25+
- [`fe35e83`](https://github.com/stdlib-js/stdlib/commit/fe35e83251890e69ae041104dfcefa9bcfbbd37a) - **feat:** add C implementation for `math/base/special/minmaxabs` [(#6983)](https://github.com/stdlib-js/stdlib/pull/6983) _(by Karan Anand)_
1526
- [`28b8375`](https://github.com/stdlib-js/stdlib/commit/28b837504e216bf5b5175226511777575b4edc2a) - **docs:** remove args parameter to match TS declaration _(by Karan Anand)_
1627
- [`a9d4530`](https://github.com/stdlib-js/stdlib/commit/a9d4530c9e486f49e6d13b8bd2d3dfaeda41cb06) - **docs:** update example and function description _(by Karan Anand)_
1728
- [`5b8deb1`](https://github.com/stdlib-js/stdlib/commit/5b8deb1707b3e84534d70d2ac20253de39151947) - **bench:** update random value generation [(#6381)](https://github.com/stdlib-js/stdlib/pull/6381) _(by Harsh)_

CONTRIBUTORS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ Ali Salesi <ali_sal1381@yahoo.com>
2121
AlyAbdelmoneim <148393799+AlyAbdelmoneim@users.noreply.github.com>
2222
Aman Bhansali <bhansali.1@iitj.ac.in>
2323
AmanBhadkariya <140033975+AmanBhadkariya@users.noreply.github.com>
24+
Amisha Chhajed <136238836+amishhaa@users.noreply.github.com>
2425
Amit Jimiwal <amitjimiwal45@gmail.com>
26+
Annamalai Prabu <apfossdev@gmail.com>
2527
Anshu Kumar <132515490+anxhukumar@users.noreply.github.com>
2628
Anshu Kumar <contact.anshukumar@protonmail.com>
2729
Anudeep Sanapala <anudeep0306@gmail.com>
30+
Aryan Bhirud <112156883+AryanBhirud@users.noreply.github.com>
2831
Athan Reines <kgryte@gmail.com>
2932
Ayaka <73595362+USERSATOSHI@users.noreply.github.com>
3033
Bhavishy Agrawal <90029607+bhavishy2801@users.noreply.github.com>
@@ -38,6 +41,7 @@ Daniel Killenberger <daniel.killenberger@gmail.com>
3841
Daniel Yu <40680511+Daniel777y@users.noreply.github.com>
3942
Debashis Maharana <debashismaharana7854@gmail.com>
4043
Deep Trivedi <128926685+thedeeppp@users.noreply.github.com>
44+
Deepak Singh <78257493+Deepak91168@users.noreply.github.com>
4145
Desh Deepak Kant <118960904+DeshDeepakKant@users.noreply.github.com>
4246
Dev Goel <135586571+corsairier@users.noreply.github.com>
4347
Dhanyabad behera <110620935+dhanyabad11@users.noreply.github.com>
@@ -53,6 +57,7 @@ Frank Kovacs <fran70kk@gmail.com>
5357
GK Bishnoi <gkishan1kyt@gmail.com>
5458
GURU PRASAD SHARMA <168292003+GURUPRASADSHARMA@users.noreply.github.com>
5559
Gaurav <gaurav70380@gmail.com>
60+
Gautam Kaushik <162317291+Kaushikgtm@users.noreply.github.com>
5661
Gautam sharma <gautamkrishnasharma1@gmail.com>
5762
Girish Garg <garggirish2020@gmail.com>
5863
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
@@ -80,6 +85,7 @@ Joris Labie <joris.labie1@gmail.com>
8085
Justin Dennison <justin1dennison@gmail.com>
8186
Justyn Shelby <96994781+ShelbyJustyn@users.noreply.github.com>
8287
Karan Anand <anandkarancompsci@gmail.com>
88+
Karan Vasudevamurthy <karanlvm123@gmail.com>
8389
Karan Yadav <77043443+karanBRAVO@users.noreply.github.com>
8490
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
8591
Kaushikgtm <162317291+Kaushikgtm@users.noreply.github.com>
@@ -89,6 +95,7 @@ Krishnam Agarwal <83017176+888krishnam@users.noreply.github.com>
8995
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
9096
Kshitij-Dale <152467202+Kshitij-Dale@users.noreply.github.com>
9197
Lalit Narayan Yadav <162928571+LalitNarayanYadav@users.noreply.github.com>
98+
Lokesh Ranjan <lokesh.ranjan.phe23@itbhu.ac.in>
9299
Lovelin Dhoni J B <100030865+lovelindhoni@users.noreply.github.com>
93100
MANI <77221000+Eternity0207@users.noreply.github.com>
94101
Mahfuza Humayra Mohona <mhmohona@gmail.com>
@@ -117,6 +124,7 @@ Ognjen Jevremović <ognjenjevremovic@users.noreply.github.com>
117124
Oneday12323 <107678750+Oneday12323@users.noreply.github.com>
118125
Ori Miles <97595296+orimiles5@users.noreply.github.com>
119126
Philipp Burckhardt <pburckhardt@outlook.com>
127+
Pierre Forstmann <15964998+pierreforstmann@users.noreply.github.com>
120128
Prajjwal Bajpai <142303989+prajjwalbajpai@users.noreply.github.com>
121129
Prajwal Kulkarni <prajwalkulkarni76@gmail.com>
122130
Pranav Goswami <pranavchiku11@gmail.com>
@@ -146,6 +154,7 @@ Ryan Seal <splrk@users.noreply.github.com>
146154
Rylan Yang <137365285+rylany27@users.noreply.github.com>
147155
SAHIL KUMAR <168997976+sahilk45@users.noreply.github.com>
148156
SHIVAM YADAV <120725381+Shivam-1827@users.noreply.github.com>
157+
Sachin Raj <120590207+schnrj@users.noreply.github.com>
149158
Sahil Goyal <87982509+sahil20021008@users.noreply.github.com>
150159
Sai Avinash <120403424+nasarobot@users.noreply.github.com>
151160
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
@@ -166,10 +175,14 @@ Spandan Barve <contact@marsian.dev>
166175
Stephannie Jiménez Gacha <steff456@hotmail.com>
167176
Suhaib Ilahi <suhaib.elahi87@gmail.com>
168177
Suraj Kumar <125961509+kumarsuraj212003@users.noreply.github.com>
178+
Swapnil Hajare <69076366+Swapnil-2502@users.noreply.github.com>
169179
Tanishq Ahuja <68651083+TheGEN1U5@users.noreply.github.com>
170180
Tirtadwipa Manunggal <tirtadwipa.manunggal@gmail.com>
171181
Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com>
172182
Tufailahmed Bargir <142114244+Tufailahmed-Bargir@users.noreply.github.com>
183+
Tushar Bhardwaj <155543597+TusharBhardwaj441@users.noreply.github.com>
184+
Uday Kakade <141299403+udaykakade25@users.noreply.github.com>
185+
Ujjwal Kirti <64329707+ujjwalkirti@users.noreply.github.com>
173186
Utkarsh <http://utkarsh11105@gmail.com>
174187
Utkarsh Raj <rajutkarsh2505@gmail.com>
175188
UtkershBasnet <119008923+UtkershBasnet@users.noreply.github.com>

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,100 @@ for ( i = 0; i < 100; i++ ) {
152152

153153
<!-- /.examples -->
154154

155+
<!-- C interface documentation. -->
156+
157+
* * *
158+
159+
<section class="c">
160+
161+
## C APIs
162+
163+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
164+
165+
<section class="intro">
166+
167+
</section>
168+
169+
<!-- /.intro -->
170+
171+
<!-- C usage documentation. -->
172+
173+
<section class="usage">
174+
175+
### Usage
176+
177+
```c
178+
#include "stdlib/math/base/special/minmaxabs.h"
179+
```
180+
181+
#### stdlib_base_minmaxabs( x, y, &min, &max )
182+
183+
Evaluates the minimum and maximum absolute values in a single pass.
184+
185+
```c
186+
double x = -3.14;
187+
double y = 2.71;
188+
189+
double min;
190+
double max;
191+
stdlib_base_minmaxabs( x, y, &min, &max );
192+
```
193+
194+
The function accepts the following arguments:
195+
196+
- **x**: `[in] double` first number.
197+
- **y**: `[in] double` second number.
198+
- **min**: `[out] double` destination for the minimum absolute value.
199+
- **max**: `[out] double` destination for the maximum absolute value.
200+
201+
```c
202+
void stdlib_base_minmaxabs( const double x, const double y, double* min, double* max );
203+
```
204+
205+
</section>
206+
207+
<!-- /.usage -->
208+
209+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
210+
211+
<section class="notes">
212+
213+
</section>
214+
215+
<!-- /.notes -->
216+
217+
<!-- C API usage examples. -->
218+
219+
<section class="examples">
220+
221+
### Examples
222+
223+
```c
224+
#include "stdlib/math/base/special/minmaxabs.h"
225+
#include <stdio.h>
226+
227+
int main( void ) {
228+
const double x[] = { 1.0, 0.45, -0.89, 0.0 / 0.0, -0.78, -0.22, 0.66, 0.11, -0.55, 0.0 };
229+
const double y[] = { -0.22, 0.66, 0.0, -0.55, 0.33, 1.0, 0.0 / 0.0, 0.11, 0.45, -0.78 };
230+
231+
double min;
232+
double max;
233+
int i;
234+
for ( i = 0; i < 10; i++ ) {
235+
stdlib_base_minmaxabs( x[ i ], y[ i ], &min, &max );
236+
printf( "x: %lf, y: %lf => min: %lf, max: %lf\n", x[ i ], y[ i ], min, max );
237+
}
238+
}
239+
```
240+
241+
</section>
242+
243+
<!-- /.examples -->
244+
245+
</section>
246+
247+
<!-- /.c -->
248+
155249
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
156250
157251
<section class="references">

benchmark/benchmark.native.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
'use strict';
20+
21+
// MODULES //
22+
23+
var resolve = require( 'path' ).resolve;
24+
var bench = require( '@stdlib/bench-harness' );
25+
var uniform = require( '@stdlib/random-array-uniform' );
26+
var isFloat64Array = require( '@stdlib/assert-is-float64array' );
27+
var tryRequire = require( '@stdlib/utils-try-require' );
28+
var pkg = require( './../package.json' ).name;
29+
30+
31+
// VARIABLES //
32+
33+
var minmaxabs = tryRequire( resolve( __dirname, './../lib/native.js' ) );
34+
var opts = {
35+
'skip': ( minmaxabs instanceof Error )
36+
};
37+
38+
39+
// MAIN //
40+
41+
bench( pkg+'::native', opts, function benchmark( b ) {
42+
var x;
43+
var y;
44+
var z;
45+
var i;
46+
47+
x = uniform( 100, -500.0, 500.0 );
48+
y = uniform( 100, -500.0, 500.0 );
49+
50+
b.tic();
51+
for ( i = 0; i < b.iterations; i++ ) {
52+
z = minmaxabs( x[ i%x.length ], y[ i%y.length ] );
53+
if ( z.length !== 2 ) {
54+
b.fail( 'should have expected length' );
55+
}
56+
}
57+
b.toc();
58+
if ( !isFloat64Array( z ) ) {
59+
b.fail( 'should return a Float64Array' );
60+
}
61+
b.pass( 'benchmark finished' );
62+
b.end();
63+
});

0 commit comments

Comments
 (0)