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

# vSgemul(_:_:_:_:_:_:_:_:)

Multiplies two general matrices or their transposes.

```
func vSgemul(_ l: Int32, _ m: Int32, _ n: Int32, _ a: UnsafePointer<vFloat>, _ forma: CChar, _ b: UnsafePointer<vFloat>, _ formb: CChar, _ matrix: UnsafeMutablePointer<vFloat>)
```

## Parameters

`l`

number of rows in matrix `matrix`; must be a multiple of 4.

`m`

if `forma` = ‘N’, `m` is the number of columns in matrix `a` ; if forma = ‘T’, `m` is the number of rows in matrix `a`. Also, if `formb` = ‘N’, `m` is the number of rows in matrix `b`; if formb = ‘T’, `m` is the number of columns in matrix `b`. `m` must be a multiple of 4.

`n`

number of columns in the matrix `matrix`; must be a multiple of 4.

`a`

a matrix with elements of type `float`.  If `forma` = ‘N’, the matrix itself is used in the calculation and it has `l` rows and `m` columns.  If `forma` = ‘T’, the transpose is used and `a` has `m` rows and `l` columns. Thus the matrix used in the calculation is `l` by `m`.

`forma`

selector with a value of ‘N’ or ‘T’.

`b`

a matrix with elements of type `float`.  If `formb` = ‘N’, the matrix itself is used in the calculation and it has `m` rows and `n` columns.  If `formb` = ‘T’, the transpose is used and `b` has `n` rows and `m` columns. Thus the matrix used in the calculation is `m` by `n`.

`formb`

selector with a value of ‘N’ or ‘T’.

`matrix`

destination matrix with `l` rows and `n` columns.

## Discussion

Matrix `a` (or its transpose) is multiplied by matrix `b` (or its transpose); the result is stored in matrix `matrix`.

---

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)