This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
# ssyrk
> Perform one of the symmetric rank `K` operations `C = α*A*A**T + β*C` or `C = α*A**T*A + β*C` where `α` and `β` are scalars, `C` is an `N` by `N` symmetric matrix and `A` is an `N` by `K` matrix in the first case and a `K` by `N` matrix in the second case.
<section class="usage">
## Usage
```javascript
var ssyrk = require( '@stdlib/blas/base/ssyrk' );
```
#### ssyrk( ord, uplo, trans, N, K, α, A, lda, β, C, ldc )
Performs one of the symmetric rank `K` operations `C = α*A*A**T + β*C` or `C = α*A**T*A + β*C` where `α` and `β` are scalars, `C` is an `N` by `N` symmetric matrix and `A` is an `N` by `K` matrix in the first case and a `K` by `N` matrix in the second case.
```javascript
var Float32Array = require( '@stdlib/array/float32' );
var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
var C = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ] );
- **uplo**: specifies whether the upper or lower triangular part of the symmetric matrix `C` is supplied.
- **trans**: specifies whether `C` should be transposed, conjugate-transposed, or not transposed.
- **N**: order of the matrix `C`.
- **K**: number of columns or number of rows of the matrix `A`.
- **α**: scalar constant.
- **A**: first input matrix stored in linear memory as a [`Float32Array`][mdn-float32array].
- **lda**: stride of the first dimension of `A` (leading dimension of `A`).
- **β**: scalar constant.
- **C**: second input matrix stored in linear memory as a [`Float32Array`][mdn-float32array].
- **ldc**: stride of the first dimension of `C` (leading dimension of `C`).
The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to perform matrix multiplication of two subarrays
<!-- lint disable maximum-len -->
```javascript
var Float32Array = require( '@stdlib/array/float32' );
var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 0.0, 0.0, 4.0, 5.0, 6.0, 0.0, 0.0, 0.0, 7.0, 8.0, 9.0 ] );
var C = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ] );
#### ssyrk.ndarray( uplo, trans, N, K, α, A, sa1, sa2, oa, β, C, sc1, sc2, oc )
Performs one of the symmetric rank `K` operations `C = α*A*A**T + β*C` or `C = α*A**T*A + β*C`, using alternative indexing semantics and where where `α` and `β` are scalars, `C` is an `N` by `N` symmetric matrix and `A` is an `N` by `K` matrix in the first case and a `K` by `N` matrix in the second case.
```javascript
var Float32Array = require( '@stdlib/array/float32' );
var A = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
var C = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ] );
The function has the following additional parameters:
- **sa1**: stride of the first dimension of `A`.
- **sa2**: stride of the second dimension of `A`.
- **oa**: starting index for `A`.
- **sc1**: stride of the first dimension of `C`.
- **sc2**: stride of the second dimension of `C`.
- **oc**: starting index for `C`.
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example,
```javascript
var Float32Array = require( '@stdlib/array/float32' );
var A = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ] );
var C = new Float32Array( [ 0.0, 0.0, 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ] );
- `ssyrk()` corresponds to the [BLAS][blas] level 3 function [`ssyrk`][blas-ssyrk].
</section>
<!-- /.notes -->
<section class="examples">
## Examples
<!-- eslint no-undef: "error" -->
```javascript
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var ssyrk = require( '@stdlib/blas/base/ssyrk' );
var opts = {
'dtype': 'float32'
};
var N = 4;
var A = discreteUniform( N*N, 0, 10, opts ); // 4x4
var C = discreteUniform( N*N, 0, 10, opts ); // 4x4
ssyrk( 'row-major', 'lower', 'no-transpose', N, N, 1.0, A, N, 1.0, C, N );
console.log( C );
ssyrk.ndarray( 'lower', 'no-transpose', N, N, 1.0, A, N, 1, 0, 1.0, C, N, 1, 0 );
console.log( C );
```
</section>
<!-- /.examples -->
<!-- C interface documentation. -->
* * *
<section class="c">
## C APIs
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
<section class="intro">
</section>
<!-- /.intro -->
<!-- C usage documentation. -->
<section class="usage">
### Usage
```c
#include "stdlib/blas/base/ssyrk.h"
```
#### TODO
TODO.
```c
TODO
```
TODO
```c
TODO
```
</section>
<!-- /.usage -->
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
<section class="notes">
</section>
<!-- /.notes -->
<!-- C API usage examples. -->
<section class="examples">
### Examples
```c
TODO
```
</section>
<!-- /.examples -->
</section>
<!-- /.c -->
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
<section class="related">
</section>
<!-- /.related -->
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add blas/base/ssyrk #7411
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
feat: add blas/base/ssyrk #7411
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.