nk
1.0.0
C++ Numerical Computing Runtime
Toggle main menu visibility
Loading...
Searching...
No Matches
vector_ops.hpp
Go to the documentation of this file.
1
3
// toolboxes/linalg/include/nk/linalg/vector_ops.hpp
4
//
5
// Vector-algebra operations: cross product, dot product, Kronecker
6
// product. Migrated from toolboxes/builtin/src/language/arrays/matrix.cpp
7
// (see commit history). These were always linalg-domain; they lived in
8
// toolboxes/builtin only because toolboxes/linalg did not exist yet.
9
10
#pragma once
11
12
#include <memory_resource>
13
#include <nk/value/value.hpp>
14
15
namespace
nk::linalg {
16
19
20
32
Value
cross
(
const
Value
&a,
const
Value
&b, std::pmr::memory_resource *mr =
nullptr
);
33
48
Value
cross
(
const
Value
&a,
const
Value
&b,
int
dim, std::pmr::memory_resource *mr =
nullptr
);
49
58
Value
dot
(
const
Value
&a,
const
Value
&b, std::pmr::memory_resource *mr =
nullptr
);
59
75
Value
dot
(
const
Value
&a,
const
Value
&b,
int
dim, std::pmr::memory_resource *mr =
nullptr
);
76
87
Value
kron
(
const
Value
&a,
const
Value
&b, std::pmr::memory_resource *mr =
nullptr
);
88
89
91
}
// namespace nk::linalg
nk::Value
Core MATLAB-compatible multidimensional array and scalar value type.
Definition
value.hpp:61
nk::linalg::dot
Value dot(const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
Dot product of two equal-length vectors.
nk::linalg::kron
Value kron(const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
Kronecker product (K = kron(A, B)).
nk::linalg::cross
Value cross(const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
Cross product of two 3-vectors or 3 × N / N × 3 batches.
src
toolboxes
linalg
include
nk
linalg
vector_ops.hpp
Generated by
1.17.0