You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Licensed under the Apache License, Version 2.0 (the "License");
8
8
you may not use this file except in compliance with the License.
@@ -22,17 +22,23 @@ limitations under the License.
22
22
23
23
> Perform the rank 1 operation `A = α*x*y^T + A`.
24
24
25
-
<sectionclass = "usage">
25
+
<sectionclass="intro">
26
+
27
+
</section>
28
+
29
+
<!-- /.intro -->
30
+
31
+
<sectionclass="usage">
26
32
27
33
## Usage
28
34
29
35
```javascript
30
36
var sger =require( '@stdlib/blas/base/sger' );
31
37
```
32
38
33
-
#### sger( ord, M, N, α, x, sx, y, sy, A, lda )
39
+
#### sger( order, M, N, α, x, sx, y, sy, A, lda )
34
40
35
-
Performs the rank 1 operation `A = α*x*y^T + A`, where `α` is a scalar, `x` is an `M` element vector, `y` is an `N` element vector and `A` is an `M` by `N` matrix.
41
+
Performs the rank 1 operation `A = α*x*y^T + A`, where `α` is a scalar, `x` is an `M` element vector, `y` is an `N` element vector, and `A` is an `M` by `N` matrix.
-**A**: input matrix stored in linear memory as a [`Float32Array`][mdn-float32array].
59
65
-**lda**: stride of the first dimension of `A` (leading dimension of `A`).
60
66
61
-
The stride parameters determine how operations are performed. For example, to iterate over every other element in `x` and `y`,
67
+
The stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to iterate over every other element in `x` and `y`,
#### sger.ndarray( M, N, α, x, sx, ox, y, sy, oy, A, sa1, sa2, oa )
95
101
96
-
Performs the rank 1 operation `A = α*x*y^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `M` element vector, `y` is an `N` element vector and `A` is an `M` by `N` matrix.
102
+
Performs the rank 1 operation `A = α*x*y^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `M` element vector, `y` is an `N` element vector, and `A` is an `M` by `N` matrix.
@@ -166,7 +172,7 @@ sger( 'row-major', M, N, 1.0, x, 1, y, 1, A, N );
166
172
console.log( A );
167
173
168
174
sger.ndarray( M, N, 1.0, x, 1, 0, y, 1, 0, A, 1, M, 0 );
169
-
console.log(A);
175
+
console.log(A);
170
176
171
177
```
172
178
@@ -200,18 +206,80 @@ console.log(A);
200
206
#include"stdlib/blas/base/sger.h"
201
207
```
202
208
203
-
#### TODO
209
+
#### c_sger( layout, M, N, alpha, \*X, strideX, \*Y, strideY, \*A, LDA )
204
210
205
-
TODO.
211
+
Performs the rank 1 operation `A = alpha*x*y^T + A`, where `alpha` is a scalar, `x` is an `M` element vector, `y` is an `N` element vector, and `A` is an `M`-by-`N` matrix.
206
212
207
213
```c
208
-
TODO
214
+
#include"stdlib/blas/base/shared.h"
215
+
216
+
float A[ 3*4 ] = {
217
+
0.0, 0.0, 0.0, 0.0,
218
+
0.0, 0.0, 0.0, 0.0,
219
+
0.0, 0.0, 0.0, 0.0
220
+
};
221
+
222
+
constfloat x[ 3 ] = { 1.0, 4.0, 0.0 };
223
+
const float y[ 4 ] = { 0.0, 1.0, 2.0, 3.0 };
224
+
225
+
c_sger( CblasRowMajor, 3, 4, 1.0, x, 1, y, 1, A, 4 );
209
226
```
210
227
211
-
TODO
228
+
The function accepts the following arguments:
229
+
230
+
- **layout**: `[in] CBLAS_LAYOUT` storage layout.
231
+
- **M**: `[in] CBLAS_INT` number of rows in the matrix `A`.
232
+
- **N**: `[in] CBLAS_INT` number of columns in the matrix `A`.
233
+
- **alpha**: `[in] float` scalar constant.
234
+
- **X**: `[in] float*` an `M` element vector.
235
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
236
+
- **Y**: `[in] float*` an `N` element vector.
237
+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
238
+
- **A**: `[inout] float*` input matrix.
239
+
- **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
#### c_sger_ndarray( M, N, alpha, \*X, sx, ox, \*Y, sy, oy, \*A, sa1, sa2, oa )
246
+
247
+
Performs the rank 1 operation `A = alpha*x*y^T + A`, using alternative indexing semantics and where `alpha` is a scalar, `x` is an `M` element vector, `y` is an `N` element vector, and `A` is an `M`-by-`N` matrix.
248
+
249
+
```c
250
+
#include"stdlib/blas/base/shared.h"
251
+
252
+
float A[ 3*4 ] = {
253
+
0.0, 0.0, 0.0, 0.0,
254
+
0.0, 0.0, 0.0, 0.0,
255
+
0.0, 0.0, 0.0, 0.0
256
+
};
257
+
258
+
constfloat x[ 3 ] = { 1.0, 4.0, 0.0 };
259
+
const float y[ 4 ] = { 0.0, 1.0, 2.0, 3.0 };
260
+
261
+
c_sger_ndarray( 3, 4, 1.0, x, 1, 0, y, 1, 0, A, 4, 1, 0 );
262
+
```
263
+
264
+
The function accepts the following arguments:
265
+
266
+
- **layout**: `[in] CBLAS_LAYOUT` storage layout.
267
+
- **M**: `[in] CBLAS_INT` number of rows in the matrix `A`.
268
+
- **N**: `[in] CBLAS_INT` number of columns in the matrix `A`.
269
+
- **alpha**: `[in] float` scalar constant.
270
+
- **X**: `[in] float*` an `M` element vector.
271
+
- **sx**: `[in] CBLAS_INT` stride length for `X`.
272
+
- **ox**: `[in] CBLAS_INT` starting index for `X`.
273
+
- **Y**: `[in] float*` an `N` element vector.
274
+
- **sy**: `[in] CBLAS_INT` stride length for `Y`.
275
+
- **oy**: `[in] CBLAS_INT` starting index for `Y`.
276
+
- **A**: `[inout] float*` input matrix.
277
+
- **sa1**: `[in] CBLAS_INT` stride of the first dimension of `A`.
278
+
- **sa2**: `[in] CBLAS_INT` stride of the second dimension of `A`.
279
+
- **oa**: `[in] CBLAS_INT` starting index for `A`.
0 commit comments