<!--
{
  "availability" : [
    "iOS: 8.0.0 - 14.0.0",
    "iPadOS: 8.0.0 - 14.0.0",
    "macCatalyst: 13.1.0 - 14.0.0",
    "macOS: 10.10.0 - 11.0.0",
    "tvOS: 8.0.0 - 14.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 1.0.0 - 7.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/la_matrix_product(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@la_matrix_product"
  },
  "title" : "la_matrix_product(_:_:)"
}
-->

# la_matrix_product(_:_:)

```
func la_matrix_product(_ matrix_left: la_object_t, _ matrix_right: la_object_t) -> la_object_t
```

## Discussion\abstract Compute a matrix product.
\discussion Left splat operands are treated as 1 x rows(matrix_right) vectors and right
splat operands are treated as cols(matrix_left) x 1 vectors.

For convenience, in certain situations vector operands may be implicitly
transposed.  Specifically,

If cols(matrix_left) == rows(matrix_right)
rows(matrix_left) x cols(matrix_right) = matrix_left * matrix_right
Else if cols(matrix_left) == 1 and rows(matrix_left) == rows(matrix_right)
1 x cols(matrix_right) = transpose(matrix_left) * matrix_right
Else if rows(matrix_right) == 1 and cols(matrix_left) == cols(matrix_right)
rows(matrix_left) x 1 = matrix_left * transpose(matrix_right)
Else
result has the status LA_DIMENSION_MISMATCH_ERROR.

If either operand is not a vector or matrix or splat, or if both operands
are splats, the result has the status LA_INVALID_PARAMETER_ERROR.

Otherwise the result is a matrix with 1 row if matrix_left is vector or splat
and rows(matrix_left) otherwise, and 1 column if matrix_right is vector or
splat and cols(matrix_right) otherwise.

If cols(matrix_left) == rows(matrix_right), the i,jth element of the matrix is:
sum_{k=0…cols(matrix_left)} matrix_left[i,k] * matrix_right[k,j]
If cols(matrix_left) == 1 and rows(matrix_left) == rows(matrix_right), the
0,jth element of matrix is:
sum_{k=0…rows(matrix_right)} matrix_left[k,0] * matrix_right[k,j]
If rows(matrix_right) == 1 and cols(matrix_left) == cols(matrix_right), the
i,0th element of matrix is:
sum_{k=0…cols(matrix_left)} matrix_left[i,k] * matrix_right[0,k]

---

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)