# Dot Products

> NumKong for C++

Dot products are one of the broadest parts of the native SDK.
They include real, complex, packed-binary, mini-float, and mixed-precision forms.

```c
nk_f32c_t a[384];
nk_f32c_t b[384];
nk_f64c_t out = {0, 0};         // widened f32c → f64c output

nk_dot_f32c_best(a, b, 384, &out, capabilities, NULL);   // complex inner product
nk_vdot_f32c_best(a, b, 384, &out, capabilities, NULL);  // conjugated variant, like numpy.vdot
```

For quantized retrieval pipelines, the storage format often matters more than the nominal math family.
The native SDK lets you keep the compact representation and still get a widened output.

`#include <numkong/dot.hpp>`

## dot

⟨a,b⟩ over two runs of `in_type_` with equal dimensions; [`unexpected_dimensions_k`](https://www.unum.cloud/docs/numkong/cpp/quickstart.md#unexpected_dimensions_k) when they differ or either run is strided or ends mid-value.

```cpp
template <numeric_dtype in_type_, numeric_dtype result_type_ = typename in_type_::dot_result_t, vector_of<in_type_> a_type_, vector_of<in_type_> b_type_>
expected<result_type_> dot(
    a_type_ const & a,
    b_type_ const & b,
    nk_capability_t capabilities = default_capabilities()) noexcept;
```

## vdot

Conjugated ⟨a,b⟩ over two complex runs, failing like the concept [`dot`](#dot).

```cpp
template <numeric_dtype in_type_, numeric_dtype result_type_ = typename in_type_::dot_result_t, vector_of<in_type_> a_type_, vector_of<in_type_> b_type_>
expected<result_type_> vdot(
    a_type_ const & a,
    b_type_ const & b,
    nk_capability_t capabilities = default_capabilities()) noexcept;
```

