Skip to content

Commit d45839c

Browse files
committed
Auto-generated commit
1 parent 7186864 commit d45839c

Some content is hidden

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

56 files changed

+6205
-89
lines changed

CHANGELOG.md

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

7-
## Unreleased (2025-06-26)
7+
## Unreleased (2025-06-30)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`97e8058`](https://github.com/stdlib-js/stdlib/commit/97e8058cf6d707a5451cc5528e8c0814f138543f) - add `blas/ext/base/gindex-of` [(#7493)](https://github.com/stdlib-js/stdlib/pull/7493)
14+
- [`ea875d6`](https://github.com/stdlib-js/stdlib/commit/ea875d60ea897e1d599634ce69eabd740275dda4) - add C implementation for `blas/base/dgemv` [(#7013)](https://github.com/stdlib-js/stdlib/pull/7013)
1315
- [`231adcc`](https://github.com/stdlib-js/stdlib/commit/231adcca7fe97378ed76193faba8ccf41123ad83) - add JavaScript implementation and clean-up `blas/base/dger` [(#6395)](https://github.com/stdlib-js/stdlib/pull/6395)
1416
- [`1321911`](https://github.com/stdlib-js/stdlib/commit/1321911685e6ad3b66de365a1d314324d2838344) - add `blas/base/wasm/scasum` [(#6285)](https://github.com/stdlib-js/stdlib/pull/6285)
1517
- [`ecac5aa`](https://github.com/stdlib-js/stdlib/commit/ecac5aa8d2cc807cc10884fcf4c5df06e88012b3) - add `blas/ext/base/dindex-of` [(#7465)](https://github.com/stdlib-js/stdlib/pull/7465)
@@ -233,6 +235,8 @@
233235

234236
### Bug Fixes
235237

238+
- [`f27e62f`](https://github.com/stdlib-js/stdlib/commit/f27e62f31b16eb5c92f5c0af88b00b6d5124b9f6) - provide correct number of arguments
239+
- [`6688495`](https://github.com/stdlib-js/stdlib/commit/6688495296d51628b4a85466de99b5a5347cff94) - provide correct number of arguments
236240
- [`e995ce7`](https://github.com/stdlib-js/stdlib/commit/e995ce7c82cbe834b8e330968a08810e5b959282) - ensure accessor array support
237241
- [`f6e1c78`](https://github.com/stdlib-js/stdlib/commit/f6e1c7823e871a259642c49f1e6b40bd7bb73f4b) - ensure accessor array support
238242
- [`fc03354`](https://github.com/stdlib-js/stdlib/commit/fc0335492cf50370e574ce2bfea6ac310d0f2e5d) - ensure accessor array support
@@ -497,6 +501,10 @@ A total of 23 issues were closed in this release:
497501

498502
<details>
499503

504+
- [`97e8058`](https://github.com/stdlib-js/stdlib/commit/97e8058cf6d707a5451cc5528e8c0814f138543f) - **feat:** add `blas/ext/base/gindex-of` [(#7493)](https://github.com/stdlib-js/stdlib/pull/7493) _(by Muhammad Haris, Athan Reines, stdlib-bot)_
505+
- [`ea875d6`](https://github.com/stdlib-js/stdlib/commit/ea875d60ea897e1d599634ce69eabd740275dda4) - **feat:** add C implementation for `blas/base/dgemv` [(#7013)](https://github.com/stdlib-js/stdlib/pull/7013) _(by Shabareesh Shetty, Athan Reines, stdlib-bot)_
506+
- [`f27e62f`](https://github.com/stdlib-js/stdlib/commit/f27e62f31b16eb5c92f5c0af88b00b6d5124b9f6) - **fix:** provide correct number of arguments _(by Athan Reines)_
507+
- [`6688495`](https://github.com/stdlib-js/stdlib/commit/6688495296d51628b4a85466de99b5a5347cff94) - **fix:** provide correct number of arguments _(by Athan Reines)_
500508
- [`46ff8ea`](https://github.com/stdlib-js/stdlib/commit/46ff8ea7761ae438c4718681c5890f146fb0985e) - **docs:** minor clean-up _(by Philipp Burckhardt)_
501509
- [`721033e`](https://github.com/stdlib-js/stdlib/commit/721033eede9b3a4667728f40695d933f49f541c1) - **docs:** minor clean-up _(by Philipp Burckhardt)_
502510
- [`c221279`](https://github.com/stdlib-js/stdlib/commit/c2212790b0118b7787b5e292244b4364c08ea05a) - **docs:** minor clean-up _(by Philipp Burckhardt)_

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
198198
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
199199
Yugal Kaushik <yugalkaushik14@gmail.com>
200200
Yuvi Mittal <128018763+yuvi-mittal@users.noreply.github.com>
201+
deepak427 <62477872+deepak427@users.noreply.github.com>
201202
devshree-bhati <147095250+devshree-bhati@users.noreply.github.com>
202203
ditsu <170345142+ditsus@users.noreply.github.com>
203204
ekambains <bainsinbusiness@gmail.com>

base/dgemm/lib/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var blockSize = require( '@stdlib/ndarray/base/unary-tiling-block-size' );
2929

3030
// VARIABLES //
3131

32-
var bsize = blockSize( 'float64' ); // TODO: consider using a larger block size
32+
var bsize = blockSize( 'float64', 'float64' ); // TODO: consider using a larger block size
3333

3434

3535
// FUNCTIONS //

base/dgemv/README.md

Lines changed: 102 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ limitations under the License.
3030
var dgemv = require( '@stdlib/blas/base/dgemv' );
3131
```
3232

33-
#### dgemv( ord, trans, M, N, α, A, LDA, x, sx, β, y, sy )
33+
#### dgemv( order, trans, M, N, α, A, LDA, x, sx, β, y, sy )
3434

3535
Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A**T*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix.
3636

@@ -47,18 +47,18 @@ dgemv( 'row-major', 'no-transpose', 2, 3, 1.0, A, 3, x, 1, 1.0, y, 1 );
4747

4848
The function has the following parameters:
4949

50-
- **ord**: storage layout.
50+
- **order**: storage layout.
5151
- **trans**: specifies whether `A` should be transposed, conjugate-transposed, or not transposed.
5252
- **M**: number of rows in the matrix `A`.
5353
- **N**: number of columns in the matrix `A`.
5454
- **α**: scalar constant.
5555
- **A**: input matrix stored in linear memory as a [`Float64Array`][mdn-float64array].
5656
- **lda**: stride of the first dimension of `A` (leading dimension of `A`).
5757
- **x**: input [`Float64Array`][mdn-float64array].
58-
- **sx**: index increment for `x`.
58+
- **sx**: stride length for `x`.
5959
- **β**: scalar constant.
6060
- **y**: output [`Float64Array`][mdn-float64array].
61-
- **sy**: index increment for `y`.
61+
- **sy**: stride length for `y`.
6262

6363
The stride parameters determine how operations are performed. For example, to iterate over every other element in `x` and `y`,
6464

@@ -93,6 +93,8 @@ dgemv( 'row-major', 'no-transpose', 2, 2, 1.0, A, 2, x1, -1, 1.0, y1, -1 );
9393
// y0 => <Float64Array>[ 0.0, 8.0, 4.0 ]
9494
```
9595

96+
<!-- lint disable maximum-heading-length -->
97+
9698
#### dgemv.ndarray( trans, M, N, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy )
9799

98100
Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A**T*x + β*y`, using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix.
@@ -199,18 +201,73 @@ console.log( y );
199201
#include "stdlib/blas/base/dgemv.h"
200202
```
201203

202-
#### TODO
204+
#### c_dgemv( layout, trans, M, N, alpha, \*A, LDA, \*X, strideX, beta, \*Y, strideY )
203205

204-
TODO.
206+
Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix.
205207

206208
```c
207-
TODO
209+
#include "stdlib/blas/base/shared.h"
210+
211+
const double A[] = { 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 };
212+
const double x[] = { 1.0, 2.0, 3.0 };
213+
double y[] = { 1.0, 2.0, 3.0 };
214+
215+
c_dgemv( CblasColMajor, CblasNoTrans, 3, 3, 1.0, A, 3, x, 1, 1.0, y, 1 );
208216
```
209217
210-
TODO
218+
The function accepts the following arguments:
219+
220+
- **layout**: `[in] CBLAS_LAYOUT` storage layout.
221+
- **trans**: `[in] CBLAS_TRANSPOSE` specifies whether `A` should be transposed, conjugate-transposed, or not transposed.
222+
- **M**: `[in] CBLAS_INT` number of rows in the matrix `A`.
223+
- **N**: `[in] CBLAS_INT` number of columns in the matrix `A`.
224+
- **alpha**: `[in] double` scalar constant.
225+
- **A**: `[in] double*` input matrix.
226+
- **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
227+
- **X**: `[in] double*` first input vector.
228+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
229+
- **beta**: `[in] double` scalar constant.
230+
- **Y**: `[inout] double*` second input vector.
231+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
211232
212233
```c
213-
TODO
234+
void c_dgemv( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const double alpha, const double *A, const CBLAS_INT LDA, const double *X, const CBLAS_INT strideX, const double beta, double *Y, const CBLAS_INT strideY )
235+
```
236+
237+
#### c_dgemv_ndarray( trans, M, N, alpha, \*A, sa1, sa2, oa, \*X, sx, ox, beta, \*Y, sy, oy )
238+
239+
Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y`, using indexing alternative semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix.
240+
241+
```c
242+
#include "stdlib/blas/base/shared.h"
243+
244+
const double A[] = { 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 };
245+
const double x[] = { 1.0, 2.0, 3.0 };
246+
double y[] = { 1.0, 2.0, 3.0 };
247+
248+
c_dgemv_ndarray( CblasNoTrans, 3, 3, 1.0, A, 1, 3, 0, x, 1, 0, 1.0, y, 1, 0 );
249+
```
250+
251+
The function accepts the following arguments:
252+
253+
- **trans**: `[in] CBLAS_TRANSPOSE` specifies whether `A` should be transposed, conjugate-transposed, or not transposed.
254+
- **M**: `[in] CBLAS_INT` number of rows in the matrix `A`.
255+
- **N**: `[in] CBLAS_INT` number of columns in the matrix `A`.
256+
- **alpha**: `[in] double` scalar.
257+
- **A**: `[in] double*` input matrix.
258+
- **sa1**: `[in] CBLAS_INT` stride of the first dimension of `A`.
259+
- **sa2**: `[in] CBLAS_INT` stride of the second dimension of `A`.
260+
- **oa**: `[in] CBLAS_INT` starting index for `A`.
261+
- **X**: `[in] double*` first input vector.
262+
- **sx**: `[in] CBLAS_INT` stride length for `X`.
263+
- **ox**: `[in] CBLAS_INT` starting index for `X`.
264+
- **beta**: `[in] double` scalar.
265+
- **Y**: `[inout] double*` second input vector.
266+
- **sy**: `[in] CBLAS_INT` stride length for `Y`.
267+
- **oy**: `[in] CBLAS_INT` starting index for `Y`.
268+
269+
```c
270+
void c_dgemv_ndarray( const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const double alpha, const double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double beta, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY )
214271
```
215272

216273
</section>
@@ -232,7 +289,42 @@ TODO
232289
### Examples
233290

234291
```c
235-
TODO
292+
#include "stdlib/blas/base/dgemv.h"
293+
#include "stdlib/blas/base/shared.h"
294+
#include <stdio.h>
295+
296+
int main( void ) {
297+
// Define a 3x3 matrix stored in row-major order:
298+
const double A[ 3*3 ] = {
299+
1.0, 2.0, 3.0,
300+
4.0, 5.0, 6.0,
301+
7.0, 8.0, 9.0
302+
};
303+
304+
// Define `x` and `y` vectors:
305+
const double x[ 3 ] = { 1.0, 2.0, 3.0 };
306+
double y[ 3 ] = { 1.0, 2.0, 3.0 };
307+
308+
// Specify the number of elements along each dimension of `A`:
309+
const int M = 3;
310+
const int N = 3;
311+
312+
// Perform the matrix-vector operation `y = α*A*x + β*y`:
313+
c_dgemv( CblasRowMajor, CblasNoTrans, M, N, 1.0, A, M, x, 1, 1.0, y, 1 );
314+
315+
// Print the result:
316+
for ( int i = 0; i < N; i++ ) {
317+
printf( "y[ %i ] = %lf\n", i, y[ i ] );
318+
}
319+
320+
// Perform the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics:
321+
c_dgemv_ndarray( CblasNoTrans, M, N, 1.0, A, N, 1, 0, x, 1, 0, 1.0, y, 1, 0 );
322+
323+
// Print the result:
324+
for ( int i = 0; i < N; i++ ) {
325+
printf( "y[ %i ] = %lf\n", i, y[ i ] );
326+
}
327+
}
236328
```
237329
238330
</section>

base/dgemv/benchmark/benchmark.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ function createBenchmark( N ) {
8686
* @private
8787
*/
8888
function main() {
89-
var len;
9089
var min;
9190
var max;
91+
var N;
9292
var f;
9393
var i;
9494

9595
min = 1; // 10^min
9696
max = 6; // 10^max
9797

9898
for ( i = min; i <= max; i++ ) {
99-
len = floor( pow( pow( 10, i ), 1.0/2.0 ) );
100-
f = createBenchmark( len );
101-
bench( pkg+':size='+(len*len), f );
99+
N = floor( pow( pow( 10, i ), 1.0/2.0 ) );
100+
f = createBenchmark( N );
101+
bench( pkg+':size='+(N*N), f );
102102
}
103103
}
104104

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
26+
var isnan = require( '@stdlib/math/base/assert/is-nan' );
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 dgemv = tryRequire( resolve( __dirname, './../lib/dgemv.native.js' ) );
36+
var opts = {
37+
'skip': ( dgemv instanceof Error )
38+
};
39+
var options = {
40+
'dtype': 'float64'
41+
};
42+
43+
44+
// FUNCTIONS //
45+
46+
/**
47+
* Creates a benchmark function.
48+
*
49+
* @private
50+
* @param {PositiveInteger} N - array length
51+
* @returns {Function} benchmark function
52+
*/
53+
function createBenchmark( N ) {
54+
var x = uniform( N, -10.0, 10.0, options );
55+
var y = uniform( N, -10.0, 10.0, options );
56+
var A = uniform( N*N, -10.0, 10.0, options );
57+
return benchmark;
58+
59+
function benchmark( b ) {
60+
var z;
61+
var i;
62+
63+
b.tic();
64+
for ( i = 0; i < b.iterations; i++ ) {
65+
z = dgemv( 'row-major', 'no-transpose', N, N, 1.0, A, N, x, 1, 1.0, y, 1 );
66+
if ( isnan( z ) ) {
67+
b.fail( 'should not return NaN' );
68+
}
69+
}
70+
b.toc();
71+
if ( isnan( z ) ) {
72+
b.fail( 'should not return NaN' );
73+
}
74+
b.pass( 'benchmark finished' );
75+
b.end();
76+
}
77+
}
78+
79+
80+
// MAIN //
81+
82+
/**
83+
* Main execution sequence.
84+
*
85+
* @private
86+
*/
87+
function main() {
88+
var min;
89+
var max;
90+
var N;
91+
var f;
92+
var i;
93+
94+
min = 1; // 10^min
95+
max = 6; // 10^max
96+
97+
for ( i = min; i <= max; i++ ) {
98+
N = floor( pow( pow( 10, i ), 1.0/2.0 ) );
99+
f = createBenchmark( N );
100+
bench( pkg+'::native:size='+(N*N), opts, f );
101+
}
102+
}
103+
104+
main();

base/dgemv/benchmark/benchmark.ndarray.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ function createBenchmark( N ) {
8686
* @private
8787
*/
8888
function main() {
89-
var len;
9089
var min;
9190
var max;
91+
var N;
9292
var f;
9393
var i;
9494

9595
min = 1; // 10^min
9696
max = 6; // 10^max
9797

9898
for ( i = min; i <= max; i++ ) {
99-
len = floor( pow( pow( 10, i ), 1.0/2.0 ) );
100-
f = createBenchmark( len );
101-
bench( pkg+':ndarray:size='+(len*len), f );
99+
N = floor( pow( pow( 10, i ), 1.0/2.0 ) );
100+
f = createBenchmark( N );
101+
bench( pkg+':ndarray:size='+(N*N), f );
102102
}
103103
}
104104

0 commit comments

Comments
 (0)