---
title: "vSgemx(_:_:_:_:_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/vsgemx(_:_:_:_:_:_:)"
---

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

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

## Declaration

```swift
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

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.

## See Also

### Matrix-Vector Linear Algebra Functions (from vectorOps.h)

- [vSgemv(_:_:_:_:_:_:_:_:)](accelerate/vsgemv(_:_:_:_:_:_:_:_:).md)
- [vSgemtx(_:_:_:_:_:_:)](accelerate/vsgemtx(_:_:_:_:_:_:).md)
