Skip to content

Commit 536c252

Browse files
committed
Auto-generated commit
1 parent f7debff commit 536c252

24 files changed

+1537
-31
lines changed

.editorconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ indent_style = tab
8686
[*.{f,f.txt}]
8787
indent_style = space
8888
indent_size = 2
89-
insert_final_newline = false
9089

9190
# Set properties for shell files:
9291
[*.{sh,sh.txt}]
@@ -121,7 +120,7 @@ indent_style = tab
121120
[*.{md,md.txt}]
122121
indent_style = space
123122
indent_size = 4
124-
trim_trailing_whitespace = false
123+
trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim.
125124
126125
# Set properties for `usage.txt` files:
127126
[usage.txt]

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/test_install.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050
env:
5151
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
5252

53-
# Run workflow job if `publish` workflow run is successful or when the workflow is manually run:
54-
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
53+
# Run workflow job if `publish` workflow run is successful or when the workflow is manually triggered or on a schedule:
54+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
5555

5656
# Define the sequence of job steps...
5757
steps:

.github/workflows/test_published_package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
env:
4848
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
4949

50-
# Run workflow job if `publish` workflow run is successful or when the workflow is manually run:
51-
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
50+
# Run workflow job if `publish` workflow run is successful or when the workflow is manually triggered or on a schedule:
51+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
5252

5353
# Define the job's steps:
5454
steps:

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,62 @@
22

33
> Package changelog.
44
5+
<section class="release" id="unreleased">
6+
7+
## Unreleased (2025-01-19)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`5f6bc87`](https://github.com/stdlib-js/stdlib/commit/5f6bc87d96a21664aeb7f4b097f03ba45ebb90ab) - add C implementation for `stats/base/dists/cosine/logcdf` [(#4499)](https://github.com/stdlib-js/stdlib/pull/4499)
14+
15+
</section>
16+
17+
<!-- /.features -->
18+
19+
<section class="issues">
20+
21+
### Closed Issues
22+
23+
This release closes the following issue:
24+
25+
[#3516](https://github.com/stdlib-js/stdlib/issues/3516)
26+
27+
</section>
28+
29+
<!-- /.issues -->
30+
31+
<section class="commits">
32+
33+
### Commits
34+
35+
<details>
36+
37+
- [`5f6bc87`](https://github.com/stdlib-js/stdlib/commit/5f6bc87d96a21664aeb7f4b097f03ba45ebb90ab) - **feat:** add C implementation for `stats/base/dists/cosine/logcdf` [(#4499)](https://github.com/stdlib-js/stdlib/pull/4499) _(by Prashant Kumar Yadav)_
38+
39+
</details>
40+
41+
</section>
42+
43+
<!-- /.commits -->
44+
45+
<section class="contributors">
46+
47+
### Contributors
48+
49+
A total of 1 person contributed to this release. Thank you to this contributor:
50+
51+
- Prashant Kumar Yadav
52+
53+
</section>
54+
55+
<!-- /.contributors -->
56+
57+
</section>
58+
59+
<!-- /.release -->
60+
561
<section class="release" id="v0.2.2">
662

763
## 0.2.2 (2024-07-28)

CONTRIBUTORS

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
#
33
# Contributors listed in alphabetical order.
44

5+
Aadish Jain <jain.aadishj@gmail.com>
56
Aayush Khanna <aayushiitbhu23@gmail.com>
67
Abhijit Raut <abhijitmraut8010@gmail.com>
78
Adarsh Palaskar <adarshpalaskar99@gmail.com>
89
Aditya Sapra <adityaework@gmail.com>
9-
AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com>
10+
Ahmed Atwa <Ahmedatwa866@yahoo.com>
11+
Ahmed Kashkoush <ahmedkashkoush464@gmail.com>
12+
Ahmed Khaled <kahmd1444@gmail.com>
1013
Aleksandr <112382387+alextes90@users.noreply.github.com>
1114
Ali Salesi <ali_sal1381@yahoo.com>
1215
Aman Bhansali <bhansali.1@iitj.ac.in>
@@ -23,6 +26,10 @@ Dan Rose <danoftheroses@gmail.com>
2326
Daniel Killenberger <daniel.killenberger@gmail.com>
2427
Daniel Yu <40680511+Daniel777y@users.noreply.github.com>
2528
Debashis Maharana <debashismaharana7854@gmail.com>
29+
Desh Deepak Kant <118960904+DeshDeepakKant@users.noreply.github.com>
30+
Dev Goel <135586571+corsairier@users.noreply.github.com>
31+
Dhruv Arvind Singh <154677013+DhruvArvindSingh@users.noreply.github.com>
32+
Divyansh Seth <59174836+sethdivyansh@users.noreply.github.com>
2633
Dominic Lim <46486515+domlimm@users.noreply.github.com>
2734
Dominik Moritz <domoritz@gmail.com>
2835
Dorrin Sotoudeh <dorrinsotoudeh123@gmail.com>
@@ -44,13 +51,14 @@ Joey Reed <joeyrreed@gmail.com>
4451
Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
4552
Joris Labie <joris.labie1@gmail.com>
4653
Justin Dennison <justin1dennison@gmail.com>
54+
Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
4755
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
48-
Khaldon <kahmd1444@gmail.com>
4956
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
5057
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
5158
Kshitij-Dale <152467202+Kshitij-Dale@users.noreply.github.com>
52-
Lovelin <100030865+lovelindhoni@users.noreply.github.com>
59+
Lovelin Dhoni J B <100030865+lovelindhoni@users.noreply.github.com>
5360
Manik Sharma <maniksharma.rke@gmail.com>
61+
Manvith M <148960168+manvith2003@users.noreply.github.com>
5462
Marcus Fantham <mfantham@users.noreply.github.com>
5563
Matt Cochrane <matthew.cochrane.eng@gmail.com>
5664
Mihir Pandit <129577900+MSP20086@users.noreply.github.com>
@@ -59,37 +67,41 @@ Mohammad Kaif <mdkaifprofession@gmail.com>
5967
Momtchil Momtchev <momtchil@momtchev.com>
6068
Muhammad Haris <harriskhan047@outlook.com>
6169
Naresh Jagadeesan <naresh.naresh000@gmail.com>
70+
Naveen Kumar <stupiddint@gmail.com>
6271
Neeraj Pathak <neerajrpathak710@gmail.com>
63-
NightKnight <Ahmedatwa866@yahoo.com>
72+
Nishant Shinde <97207366+nishant-s7@users.noreply.github.com>
6473
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
6574
Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com>
6675
Ognjen Jevremović <ognjenjevremovic@users.noreply.github.com>
6776
Oneday12323 <107678750+Oneday12323@users.noreply.github.com>
77+
Ori Miles <97595296+orimiles5@users.noreply.github.com>
6878
Philipp Burckhardt <pburckhardt@outlook.com>
6979
Prajwal Kulkarni <prajwalkulkarni76@gmail.com>
7080
Pranav Goswami <goswami.4@iitj.ac.in>
71-
Praneki <97080887+PraneGIT@users.noreply.github.com>
72-
Pratik <97464067+Pratik772846@users.noreply.github.com>
81+
Pranjal Jha <97080887+PraneGIT@users.noreply.github.com>
82+
Prashant Kumar Yadav <144602492+0PrashantYadav0@users.noreply.github.com>
83+
Pratik Singh <97464067+Pratik772846@users.noreply.github.com>
7384
Pratyush Kumar Chouhan <pratyushkumar0308@gmail.com>
74-
Priyansh <88396544+itsspriyansh@users.noreply.github.com>
85+
Priyansh Prajapati <88396544+itsspriyansh@users.noreply.github.com>
86+
Priyanshu Agarwal <113460573+AgPriyanshu18@users.noreply.github.com>
7587
Pushpendra Chandravanshi <pushpendrachandravanshi4@gmail.com>
76-
RISHAV <115060907+rishav2404@users.noreply.github.com>
7788
Raunak Kumar Gupta <raunakmodanwal321@gmail.com>
7889
Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
7990
Ricky Reusser <rsreusser@gmail.com>
8091
Ridam Garg <67867319+RidamGarg@users.noreply.github.com>
92+
Rishav <115060907+rishav2404@users.noreply.github.com>
8193
Robert Gislason <gztown2216@yahoo.com>
8294
Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
83-
Rutam <138517416+performant23@users.noreply.github.com>
95+
Rutam Kathale <138517416+performant23@users.noreply.github.com>
8496
Ruthwik Chikoti <145591715+ruthwikchikoti@users.noreply.github.com>
8597
Ryan Seal <splrk@users.noreply.github.com>
8698
Rylan Yang <137365285+rylany27@users.noreply.github.com>
8799
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
88-
SarthakPaandey <145528240+SarthakPaandey@users.noreply.github.com>
100+
Sarthak Paandey <145528240+SarthakPaandey@users.noreply.github.com>
89101
Saurabh Singh <saurabhsraghuvanshi@gmail.com>
90102
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
91103
Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
92-
Shivam <11shivam00@gmail.com>
104+
Shivam Ahir <11shivam00@gmail.com>
93105
Shraddheya Shendre <shendreshraddheya@gmail.com>
94106
Shubh Mehta <93862397+Shubh942@users.noreply.github.com>
95107
Shubham Mishra <shubh622005@gmail.com>
@@ -98,7 +110,7 @@ Snehil Shah <snehilshah.989@gmail.com>
98110
Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com>
99111
Spandan Barve <contact@marsian.dev>
100112
Stephannie Jiménez Gacha <steff456@hotmail.com>
101-
Suraj kumar <125961509+kumarsuraj212003@users.noreply.github.com>
113+
Suraj Kumar <125961509+kumarsuraj212003@users.noreply.github.com>
102114
Tirtadwipa Manunggal <tirtadwipa.manunggal@gmail.com>
103115
Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com>
104116
Tufailahmed Bargir <142114244+Tufailahmed-Bargir@users.noreply.github.com>
@@ -108,12 +120,10 @@ UtkershBasnet <119008923+UtkershBasnet@users.noreply.github.com>
108120
Vaibhav Patel <98279986+noobCoderVP@users.noreply.github.com>
109121
Varad Gupta <varadgupta21@gmail.com>
110122
Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
123+
Vivek Maurya <vm8118134@gmail.com>
111124
Xiaochuan Ye <tap91624@gmail.com>
125+
Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
112126
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
113-
naveen <stupiddint@gmail.com>
114-
nishant-s7 <97207366+nishant-s7@users.noreply.github.com>
115127
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
116-
orimiles5 <97595296+orimiles5@users.noreply.github.com>
117128
rainn <88160429+AmCodesLame@users.noreply.github.com>
118129
rei2hu <reimu@reimu.ws>
119-
yaswanth <116426380+yaswanthkosuru@users.noreply.github.com>

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Copyright (c) 2016-2024 The Stdlib Authors.
1+
Copyright (c) 2016-2025 The Stdlib Authors.

README.md

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,113 @@ for ( i = 0; i < 10; i++ ) {
194194

195195
<!-- /.examples -->
196196

197+
<!-- C interface documentation. -->
198+
199+
<section class="c">
200+
201+
## C APIs
202+
203+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
204+
205+
<section class="intro">
206+
207+
</section>
208+
209+
<!-- /.intro -->
210+
211+
<!-- C usage documentation. -->
212+
213+
<section class="usage">
214+
215+
### Usage
216+
217+
```c
218+
#include "stdlib/stats/base/dists/cosine/logcdf.h"
219+
```
220+
221+
#### stdlib_base_dists_cosine_logcdf( x, mu, s )
222+
223+
Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [raised cosine][cosine-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter).
224+
225+
```c
226+
double out = stdlib_base_dists_cosine_logcdf( 0.5, 0.0, 1.0 );
227+
// returns ~0.909
228+
```
229+
230+
The function accepts the following arguments:
231+
232+
- **x**: `[in] double` input value.
233+
- **mu**: `[in] double` location parameter.
234+
- **s**: `[in] double` scale parameter.
235+
236+
```c
237+
double stdlib_base_dists_cosine_logcdf( const double x, const double mu, const double s );
238+
```
239+
240+
</section>
241+
242+
<!-- /.usage -->
243+
244+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
245+
246+
<section class="notes">
247+
248+
</section>
249+
250+
<!-- /.notes -->
251+
252+
<!-- C API usage examples. -->
253+
254+
<section class="examples">
255+
256+
### Examples
257+
258+
```c
259+
#include "stdlib/stats/base/dists/cosine/cdf.h"
260+
#include "stdlib/constants/float64/eps.h"
261+
#include <stdlib.h>
262+
#include <stdio.h>
263+
264+
static double random_uniform( const double min, const double max ) {
265+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
266+
return min + ( v*(max-min) );
267+
}
268+
269+
int main( void ) {
270+
double mu;
271+
double s;
272+
double x;
273+
double y;
274+
int i;
275+
276+
for ( i = 0; i < 10; i++ ) {
277+
x = random_uniform( -50.0, 50.0 );
278+
mu = random_uniform( -50.0, 50.0 );
279+
s = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
280+
y = stdlib_base_dists_cosine_logcdf( x, mu, s );
281+
printf( "x: %lf, µ: %lf, s: %lf, ln(F(x;µ,s)): %lf\n", x, mu, s , y );
282+
}
283+
284+
return 0;
285+
}
286+
```
287+
288+
</section>
289+
290+
<!-- /.examples -->
291+
292+
</section>
293+
294+
<!-- /.c -->
295+
296+
<!-- 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. -->
297+
298+
<section class="references">
299+
300+
</section>
301+
302+
<!-- /.references -->
303+
197304
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
198305

199306
<section class="related">
@@ -228,7 +335,7 @@ See [LICENSE][stdlib-license].
228335

229336
## Copyright
230337

231-
Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
338+
Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
232339

233340
</section>
234341

benchmark/benchmark.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24+
var Float64Array = require( '@stdlib/array-float64' );
2425
var randu = require( '@stdlib/random-base-randu' );
2526
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2627
var EPS = require( '@stdlib/constants-float64-eps' );
@@ -31,18 +32,26 @@ var logcdf = require( './../lib' );
3132
// MAIN //
3233

3334
bench( pkg, function benchmark( b ) {
35+
var len;
3436
var mu;
3537
var s;
3638
var x;
3739
var y;
3840
var i;
3941

42+
len = 100;
43+
x = new Float64Array( len );
44+
mu = new Float64Array( len );
45+
s = new Float64Array( len );
46+
for ( i = 0; i < len; i++ ) {
47+
x[ i ] = ( randu()*100.0 ) - 50.0;
48+
mu[ i ] = ( randu()*20.0 ) - 10.0;
49+
s[ i ] = ( randu()*5.0 ) + EPS;
50+
}
51+
4052
b.tic();
4153
for ( i = 0; i < b.iterations; i++ ) {
42-
x = ( randu()*100.0 ) - 50.0;
43-
mu = ( randu()*100.0 ) - 50.0;
44-
s = ( randu()*20.0 ) + EPS;
45-
y = logcdf( x, mu, s );
54+
y = logcdf( x[ i % len ], mu[ i % len ], s[ i % len ] );
4655
if ( isnan( y ) ) {
4756
b.fail( 'should not return NaN' );
4857
}

0 commit comments

Comments
 (0)