|
| 1 | +/** |
| 2 | +* @license Apache-2.0 |
| 3 | +* |
| 4 | +* Copyright (c) 2026 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 isLayout = require( '@stdlib/blas/base/assert/is-layout' ); |
| 24 | +var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); |
| 25 | +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); |
| 26 | +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); |
| 27 | +var max = require( '@stdlib/math/base/special/fast/max' ); |
| 28 | +var scabs1 = require( '@stdlib/blas/base/scabs1' ); |
| 29 | +var format = require( '@stdlib/string/format' ); |
| 30 | +var base = require( './base.js' ); |
| 31 | + |
| 32 | + |
| 33 | +// MAIN // |
| 34 | + |
| 35 | +/** |
| 36 | +* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y`, where `α` and `β` are complex scalars, `x` and `y` are complex vectors, and `A` is an `M` by `N` complex matrix. |
| 37 | +* |
| 38 | +* @param {string} order - storage layout |
| 39 | +* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed |
| 40 | +* @param {NonNegativeInteger} M - number of rows in the matrix `A` |
| 41 | +* @param {NonNegativeInteger} N - number of columns in the matrix `A` |
| 42 | +* @param {Complex64} alpha - scalar constant |
| 43 | +* @param {Complex64Array} A - input matrix |
| 44 | +* @param {PositiveInteger} LDA - stride of the first dimension of `A` |
| 45 | +* @param {Complex64Array} x - first input vector |
| 46 | +* @param {integer} strideX - `x` stride length |
| 47 | +* @param {Complex64} beta - scalar constant |
| 48 | +* @param {Complex64Array} y - second input vector |
| 49 | +* @param {integer} strideY - `y` stride length |
| 50 | +* @throws {TypeError} first argument must be a valid order |
| 51 | +* @throws {TypeError} second argument must be a valid transpose operation |
| 52 | +* @throws {RangeError} third argument must be a nonnegative integer |
| 53 | +* @throws {RangeError} fourth argument must be a nonnegative integer |
| 54 | +* @throws {RangeError} seventh argument must be a valid stride |
| 55 | +* @throws {RangeError} ninth argument must be non-zero |
| 56 | +* @throws {RangeError} twelfth argument must be non-zero |
| 57 | +* @returns {Complex64Array} `y` |
| 58 | +* |
| 59 | +* @example |
| 60 | +* var Complex64Array = require( '@stdlib/array/complex64' ); |
| 61 | +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); |
| 62 | +* |
| 63 | +* var A = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); |
| 64 | +* var x = new Complex64Array( [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ] ); |
| 65 | +* var y = new Complex64Array( [ 1.0, 0.0, 1.0, 0.0 ] ); |
| 66 | +* var alpha = new Complex64( 1.0, 0.0 ); |
| 67 | +* var beta = new Complex64( 1.0, 0.0 ); |
| 68 | +* |
| 69 | +* cgemv( 'no-transpose', 2, 3, alpha, A, 3, 1, 0, x, 1, 0, beta, y, 1, 0 ); |
| 70 | +* // y => <Complex64Array>[ 10.0, 12.0, 28.0, 30.0 ] |
| 71 | +*/ |
0 commit comments