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

# vSgemx(_:_:_:_:_:_:)

Multiplies a matrix by a scalar and then by a vector, and adds the resulting vector to a second vector.

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

## Parameters

`m`

number of rows in `a`, and the length of vector `y`; must be a multiple of 4.

`n`

number of columns in `a`, and the length of vector `x`; 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`.

`y`

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

## Discussion

Matrix `a` is multiplied by `alpha` and then by vector `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)