template <numeric_dtype in_type_, numeric_dtype result_type_ = typename in_type_::curved_result_t>
status_t bilinear(
in_type_ const *a,
in_type_ const *b,
in_type_ const *c,
std::size_t d,
result_type_ *r,
nk_capability_t capabilities = default_capabilities(),
nk_stream_t stream = nullptr) noexcept; template <numeric_dtype in_type_, numeric_dtype result_type_ = typename in_type_::curved_result_t, vector_of<in_type_> a_type_, vector_of<in_type_> b_type_, vector_of<in_type_> c_type_>
expected<result_type_> bilinear(
a_type_ const & a,
b_type_ const & b,
c_type_ const & c,
nk_capability_t capabilities = default_capabilities()) noexcept; aᵀ × C × b over runs of in_type_, with c holding the row-major square matrix; unexpected_dimensions_k when the sizes disagree or any run is strided or ends mid-value.
Parameters
a | in | First input vector of length d |
|---|---|---|
b | in | Second input vector of length d |
c | in | Matrix of size dxd (row-major) |
d | in | Number of dimensions |
r | out | Pointer to output value |
capabilities | in | Capabilities to pick from, or zero for the C++ template |
stream | in | Null on the CPU, or the stream of the device capabilities describes |
Notes
For weighted inner products, Mahalanobis distance, etc.