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

# vSndot(_:_:_:_:_:_:)

Computes the dot products of n pairs of vectors, accumulating or storing the results in an array of `n` `float` values.

```
func vSndot(_ n: Int32, _ m: Int32, _ s: UnsafeMutablePointer<Float>, _ isw: Int32, _ x: UnsafePointer<vFloat>, _ y: UnsafePointer<vFloat>)
```

## Parameters

`n`

Number of dot products to compute, and number of elements in vector `s` ; must be a multiple of 4.

`m`

Number of elements in the vectors whose dot products are computed; must be a multiple of 4.

`s`

Destination vector; the `n` dot products are accumulated or stored here.

`isw`

A key that selects one of the four variants of this function: see Discussion below.

`x`

A matrix whose rows are `n` floating-point vectors, each containing `m` values.

`y`

A second matrix whose rows are `n` floating-point vectors, each containing `m` values.

## Discussion

For i = 0 to n-1, the dot product of vectors `x`[i] and `y`[i] is computed.  The dot product is accumulated or stored in `s`[i], according to the value of `isw`:

- if `isw` = 1, the dot product is stored in `s`[i].
- if `isw` = 2, the dot product is negated and then stored in `s`[i].
- if `isw` = 3, the dot product is added to the value in `s`[i].
- if `isw` = 4, the dot product is negated and then added to the value in `s`[i].

---

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)