<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vSgemv(_:_:_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vSgemv"
  },
  "title" : "vSgemv(_:_:_:_:_:_:_:_:)"
}
-->

# vSgemv(_:_:_:_:_:_:_:_:)

Multiplies a vector by a scalar. Multiplies a matrix by another scalar, then by a second vector, and adds the resulting vector to the first vector. This function can also perform the calculation with the transpose of the original matrix instead of the matrix itself. A selector parameter determines whether the transpose is used.

```
func vSgemv(_ forma: CChar, _ m: Int32, _ n: Int32, _ alpha: Float, _ a: UnsafePointer<vFloat>, _ x: UnsafePointer<vFloat>, _ beta: Float, _ y: UnsafeMutablePointer<vFloat>)
```

## Parameters

`forma`

selects the variant computation to be performed: ‘T’ causes the transpose  of matrix `a` to be used, ‘N’ causes `a` itself to be used.

`m`

number of rows in `a`. If `forma` = ‘N’, `m` is the length of vector `y`; if `forma` = ‘T’, `m` is the length of vector `x`; must be a multiple of 4.

`n`

number of columns in `a`. If `forma` = ‘N’, `m` is the length of vector `x`; if `forma` = ‘T’, `m` is the length of vector `y`; must be a multiple of 4.

`alpha`

scalar multiplier for matrix `a`.

`a`

`m` by `n` matrix with elements of type `float`.

`x`

vector with elements of type `float`.

`beta`

scalar multiplier for vector `y`.

`y`

destination vector with `n` elements of type `float`.

## Discussion

Vector `y` is multiplied by `beta`. Matrix `a` is multiplied by `alpha`. Then if `forma` = ‘N’, `a` is multiplied by vector `x`; if `forma` = ‘T’, the transpose of `a` is multiplied by `x`. The resulting vector is added to vector `y`, and the results are stored in `y`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)