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

# la_matrix_product(_:_:)

## Declaration

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

## Discussion

Discussion Compute a matrix product. 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]

## See Also

### Functions

- [caxpy_(_:_:_:_:_:_:)](accelerate/caxpy_(_:_:_:_:_:_:).md)
- [ccopy_(_:_:_:_:_:)](accelerate/ccopy_(_:_:_:_:_:).md)
- [cdotc_(_:_:_:_:_:_:)](accelerate/cdotc_(_:_:_:_:_:_:).md)
- [cdotu_(_:_:_:_:_:_:)](accelerate/cdotu_(_:_:_:_:_:_:).md)
- [cgbmv_(_:_:_:_:_:_:_:_:_:_:_:_:_:)](accelerate/cgbmv_(_:_:_:_:_:_:_:_:_:_:_:_:_:).md)
- [cgemm_(_:_:_:_:_:_:_:_:_:_:_:_:_:)](accelerate/cgemm_(_:_:_:_:_:_:_:_:_:_:_:_:_:).md)
- [cgemv_(_:_:_:_:_:_:_:_:_:_:_:)](accelerate/cgemv_(_:_:_:_:_:_:_:_:_:_:_:).md)
- [cgerc_(_:_:_:_:_:_:_:_:_:)](accelerate/cgerc_(_:_:_:_:_:_:_:_:_:).md)
- [cgeru_(_:_:_:_:_:_:_:_:_:)](accelerate/cgeru_(_:_:_:_:_:_:_:_:_:).md)
- [chbmv_(_:_:_:_:_:_:_:_:_:_:_:)](accelerate/chbmv_(_:_:_:_:_:_:_:_:_:_:_:).md)
- [chemm_(_:_:_:_:_:_:_:_:_:_:_:_:)](accelerate/chemm_(_:_:_:_:_:_:_:_:_:_:_:_:).md)
- [chemv_(_:_:_:_:_:_:_:_:_:_:)](accelerate/chemv_(_:_:_:_:_:_:_:_:_:_:).md)
- [cher2_(_:_:_:_:_:_:_:_:_:)](accelerate/cher2_(_:_:_:_:_:_:_:_:_:).md)
- [cher2k_(_:_:_:_:_:_:_:_:_:_:_:_:)](accelerate/cher2k_(_:_:_:_:_:_:_:_:_:_:_:_:).md)
- [cher_(_:_:_:_:_:_:_:)](accelerate/cher_(_:_:_:_:_:_:_:).md)
