Skip to content

Commit e5acff2

Browse files
committed
Auto-generated commit
1 parent 8f27dc2 commit e5acff2

30 files changed

+2950
-27
lines changed

.editorconfig

+1-2
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

-1
This file was deleted.

.github/workflows/test_install.yml

+2-2
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

+2-2
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

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2024-12-09)
7+
## Unreleased (2025-02-08)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`924f85a`](https://github.com/stdlib-js/stdlib/commit/924f85ad57aec54ede64c9db9ee96459befa2c00) - add C implementation for `blas/base/ssyr` [(#2877)](https://github.com/stdlib-js/stdlib/pull/2877)
1314
- [`4300111`](https://github.com/stdlib-js/stdlib/commit/4300111c80e0bd4941dcdd30a6b6dd36f2250dce) - add `blas/base/ssyr` [(#2658)](https://github.com/stdlib-js/stdlib/pull/2658)
1415

1516
</section>
@@ -22,6 +23,7 @@
2223

2324
<details>
2425

26+
- [`924f85a`](https://github.com/stdlib-js/stdlib/commit/924f85ad57aec54ede64c9db9ee96459befa2c00) - **feat:** add C implementation for `blas/base/ssyr` [(#2877)](https://github.com/stdlib-js/stdlib/pull/2877) _(by Aman Bhansali, Athan Reines, stdlib-bot)_
2527
- [`4ca068f`](https://github.com/stdlib-js/stdlib/commit/4ca068f174225d1eaec123656682589febf1b547) - **test:** update to test for exact equality [(#2864)](https://github.com/stdlib-js/stdlib/pull/2864) _(by Aman Bhansali)_
2628
- [`e0cef99`](https://github.com/stdlib-js/stdlib/commit/e0cef995e884021db3001dc1a3cfef0ca7b368c2) - **style:** remove extra spaces for regular expressions in publish script _(by Philipp Burckhardt)_
2729
- [`b3a0bd1`](https://github.com/stdlib-js/stdlib/commit/b3a0bd1a3e9bcdde3af048c7d6b6cfcd3765138f) - **docs:** fix example order _(by Athan Reines)_

CONTRIBUTORS

+17-7
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
#
33
# Contributors listed in alphabetical order.
44

5+
Aadish Jain <[email protected]>
56
Aayush Khanna <[email protected]>
67
Abhijit Raut <[email protected]>
78
Adarsh Palaskar <[email protected]>
89
Aditya Sapra <[email protected]>
910
Ahmed Atwa <[email protected]>
1011
Ahmed Kashkoush <[email protected]>
12+
Ahmed Khaled <[email protected]>
1113
Aleksandr <[email protected]>
1214
Ali Salesi <[email protected]>
1315
Aman Bhansali <[email protected]>
@@ -24,6 +26,10 @@ Dan Rose <[email protected]>
2426
Daniel Killenberger <[email protected]>
2527
Daniel Yu <[email protected]>
2628
Debashis Maharana <[email protected]>
29+
Desh Deepak Kant <[email protected]>
30+
31+
Dhruv Arvind Singh <[email protected]>
32+
Divyansh Seth <[email protected]>
2733
Dominic Lim <[email protected]>
2834
Dominik Moritz <[email protected]>
2935
Dorrin Sotoudeh <[email protected]>
@@ -45,22 +51,24 @@ Joey Reed <[email protected]>
4551
Jordan Gallivan <[email protected]>
4652
Joris Labie <[email protected]>
4753
Justin Dennison <[email protected]>
54+
Karan Anand <[email protected]>
4855
Karthik Prakash <[email protected]>
49-
5056
Kohantika Nath <[email protected]>
5157
Krishnendu Das <[email protected]>
5258
Kshitij-Dale <[email protected]>
53-
59+
Lovelin Dhoni J B <[email protected]>
5460
Manik Sharma <[email protected]>
5561
Manvith M <[email protected]>
5662
Marcus Fantham <[email protected]>
5763
Matt Cochrane <[email protected]>
5864
Mihir Pandit <[email protected]>
5965
Milan Raj <[email protected]>
66+
Mohammad Bin Aftab <[email protected]>
6067
Mohammad Kaif <[email protected]>
6168
Momtchil Momtchev <[email protected]>
6269
Muhammad Haris <[email protected]>
6370
Naresh Jagadeesan <[email protected]>
71+
Naveen Kumar <[email protected]>
6472
Neeraj Pathak <[email protected]>
6573
Nishant Shinde <[email protected]>
6674
Nithin Katta <[email protected]>
@@ -71,10 +79,11 @@ Ori Miles <[email protected]>
7179
Philipp Burckhardt <[email protected]>
7280
Prajwal Kulkarni <[email protected]>
7381
Pranav Goswami <[email protected]>
74-
75-
82+
Pranjal Jha <[email protected]>
83+
Prashant Kumar Yadav <[email protected]>
84+
Pratik Singh <[email protected]>
7685
Pratyush Kumar Chouhan <[email protected]>
77-
86+
Priyansh Prajapati <[email protected]>
7887
Priyanshu Agarwal <[email protected]>
7988
Pushpendra Chandravanshi <[email protected]>
8089
Raunak Kumar Gupta <[email protected]>
@@ -93,7 +102,7 @@ Sarthak Paandey <[email protected]>
93102
Saurabh Singh <[email protected]>
94103
Seyyed Parsa Neshaei <[email protected]>
95104
Shashank Shekhar Singh <[email protected]>
96-
105+
Shivam Ahir <[email protected]>
97106
Shraddheya Shendre <[email protected]>
98107
Shubh Mehta <[email protected]>
99108
Shubham Mishra <[email protected]>
@@ -112,10 +121,11 @@ UtkershBasnet <[email protected]>
112121
Vaibhav Patel <[email protected]>
113122
Varad Gupta <[email protected]>
114123
Vinit Pandit <[email protected]>
124+
Vivek Maurya <[email protected]>
115125
Xiaochuan Ye <[email protected]>
116126
Yaswanth Kosuru <[email protected]>
117127
Yernar Yergaziyev <[email protected]>
118-
119128
olenkabilonizhka <[email protected]>
129+
pranav-1720 <[email protected]>
120130
121131

NOTICE

+1-1
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

+80-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2024 The Stdlib Authors.
5+
Copyright (c) 2025 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
@@ -216,21 +216,65 @@ console.log( A );
216216
### Usage
217217

218218
```c
219-
TODO
219+
#include "stdlib/blas/base/ssyr.h"
220220
```
221221

222-
#### TODO
222+
#### c_ssyr( order, uplo, N, alpha, \*X, strideX, \*A, LDA )
223223

224-
TODO.
224+
Performs the symmetric rank 1 operation `A = α*x*x^T + A`.
225225

226226
```c
227-
TODO
227+
#include "stdlib/blas/base/shared.h"
228+
229+
float A[] = { 1.0f, 0.0f, 0.0f, 2.0f, 1.0f, 0.0f, 3.0f, 2.0f, 1.0f };
230+
const float x[] = { 1.0f, 2.0f, 3.0f };
231+
232+
c_ssyr( CblasColMajor, CblasUpper, 3, 1.0f, x, 1, A, 3 );
233+
```
234+
235+
The function accepts the following arguments:
236+
237+
- **order**: `[in] CBLAS_LAYOUT` storage layout.
238+
- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced.
239+
- **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`.
240+
- **alpha**: `[in] float` scalar.
241+
- **X**: `[in] float*` input array.
242+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
243+
- **A**: `[inout] float*` input matrix.
244+
- **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
245+
246+
```c
247+
void c_ssyr( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, float *A, const CBLAS_INT LDA )
228248
```
229249

230-
TODO
250+
#### c_ssyr_ndarray( uplo, N, alpha, \*X, strideX, offsetX, \*A, sa1, sa2, oa )
251+
252+
Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics.
253+
254+
```c
255+
#include "stdlib/blas/base/shared.h"
256+
257+
float A[] = { 1.0f, 2.0f, 3.0f, 0.0f, 1.0f, 2.0f, 0.0f, 0.0f, 1.0f };
258+
const float x[] = { 1.0f, 2.0f, 3.0f };
259+
260+
c_ssyr_ndarray( CblasUpper, 3, 1.0f, x, 1, 0, A, 3, 1, 0 );
261+
```
262+
263+
The function accepts the following arguments:
264+
265+
- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced.
266+
- **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`.
267+
- **alpha**: `[in] float` scalar.
268+
- **X**: `[in] float*` input array.
269+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
270+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
271+
- **A**: `[inout] float*` input matrix.
272+
- **sa1**: `[in] CBLAS_INT` stride of the first dimension of `A`.
273+
- **sa2**: `[in] CBLAS_INT` stride of the second dimension of `A`.
274+
- **oa**: `[in] CBLAS_INT` starting index for `A`.
231275
232276
```c
233-
TODO
277+
void c_ssyr_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT sa1, const CBLAS_INT sa2, const CBLAS_INT oa )
234278
```
235279

236280
</section>
@@ -252,7 +296,34 @@ TODO
252296
### Examples
253297

254298
```c
255-
TODO
299+
#include "stdlib/blas/base/ssyr.h"
300+
#include "stdlib/blas/base/shared.h"
301+
#include <stdio.h>
302+
303+
int main( void ) {
304+
// Create strided arrays:
305+
float A[] = { 1.0f, 0.0f, 0.0f, 2.0f, 1.0f, 0.0f, 3.0f, 2.0f, 1.0f };
306+
const float x[] = { 1.0f, 2.0f, 3.0f };
307+
308+
// Specify the number of elements along each dimension of `A`:
309+
const int N = 3;
310+
311+
// Perform the symmetric rank 1 operation `A = α*x*x^T + A`:
312+
c_ssyr( CblasColMajor, CblasUpper, N, 1.0f, x, 1, A, N );
313+
314+
// Print the result:
315+
for ( int i = 0; i < N*N; i++ ) {
316+
printf( "A[ %i ] = %f\n", i, A[ i ] );
317+
}
318+
319+
// Perform the symmetric rank 1 operation `A = α*x*x^T + A`:
320+
c_ssyr_ndarray( CblasUpper, N, 1.0f, x, 1, 0, A, N, 1, 0 );
321+
322+
// Print the result:
323+
for ( int i = 0; i < N*N; i++ ) {
324+
printf( "A[ %i ] = %f\n", i, A[ i ] );
325+
}
326+
}
256327
```
257328
258329
</section>
@@ -297,7 +368,7 @@ See [LICENSE][stdlib-license].
297368
298369
## Copyright
299370
300-
Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
371+
Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
301372
302373
</section>
303374

benchmark/benchmark.native.js

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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 isnanf = require( '@stdlib/math-base-assert-is-nanf' );
26+
var ones = require( '@stdlib/array-ones' );
27+
var pow = require( '@stdlib/math-base-special-pow' );
28+
var floor = require( '@stdlib/math-base-special-floor' );
29+
var tryRequire = require( '@stdlib/utils-try-require' );
30+
var pkg = require( './../package.json' ).name;
31+
32+
33+
// VARIABLES //
34+
35+
var ssyr = tryRequire( resolve( __dirname, './../lib/ssyr.native.js' ) );
36+
var opts = {
37+
'skip': ( ssyr instanceof Error )
38+
};
39+
var options = {
40+
'dtype': 'float32'
41+
};
42+
43+
44+
// FUNCTIONS //
45+
46+
/**
47+
* Creates a benchmark function.
48+
*
49+
* @private
50+
* @param {PositiveInteger} N - number of elements along each dimension
51+
* @returns {Function} benchmark function
52+
*/
53+
function createBenchmark( N ) {
54+
var x = ones( N, options.dtype );
55+
var A = ones( N*N, options.dtype );
56+
return benchmark;
57+
58+
/**
59+
* Benchmark function.
60+
*
61+
* @private
62+
* @param {Benchmark} b - benchmark instance
63+
*/
64+
function benchmark( b ) {
65+
var z;
66+
var i;
67+
68+
b.tic();
69+
for ( i = 0; i < b.iterations; i++ ) {
70+
z = ssyr( 'row-major', 'upper', N, 1.0, x, 1, A, N );
71+
if ( isnanf( z[ i%z.length ] ) ) {
72+
b.fail( 'should not return NaN' );
73+
}
74+
}
75+
b.toc();
76+
if ( isnanf( z[ i%z.length ] ) ) {
77+
b.fail( 'should not return NaN' );
78+
}
79+
b.pass( 'benchmark finished' );
80+
b.end();
81+
}
82+
}
83+
84+
85+
// MAIN //
86+
87+
/**
88+
* Main execution sequence.
89+
*
90+
* @private
91+
*/
92+
function main() {
93+
var min;
94+
var max;
95+
var N;
96+
var f;
97+
var i;
98+
99+
min = 1; // 10^min
100+
max = 6; // 10^max
101+
102+
for ( i = min; i <= max; i++ ) {
103+
N = floor( pow( pow( 10, i ), 1.0/2.0 ) );
104+
f = createBenchmark( N );
105+
bench( pkg+'::native:size='+(N*N), opts, f );
106+
}
107+
}
108+
109+
main();

0 commit comments

Comments
 (0)