nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches

Fundamental arithmetic, relational, logical, and array operator functions. More...

#include <memory_resource>
#include <nk/value/value.hpp>
#include <nk/value/span.hpp>

Go to the source code of this file.

Enumerations

enum class  nk::builtin::TranspOp { TranspOp::None , TranspOp::Transpose , TranspOp::CTranspose }
 Transposition operator for page-wise matrix multiplication. More...

Functions

Value nk::builtin::plus (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise addition (y = a + b).
Value nk::builtin::minus (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise subtraction (y = a - b).
Value nk::builtin::times (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise multiplication (y = a .
Value nk::builtin::mtimes (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Matrix multiplication (Y = A * B).
Value nk::builtin::rdivide (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise right division (y = a .
Value nk::builtin::ldivide (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise left division (y = a .
Value nk::builtin::mrdivide (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Matrix right division / slash (y = A / B).
Value nk::builtin::mldivide (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Matrix left division / backslash (y = A \\ B).
Value nk::builtin::power (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise power (y = a .
Value nk::builtin::elementPower (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise power alias (y = a .^ b).
Value nk::builtin::mpower (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Matrix power (Y = A ^ B).
Value nk::builtin::uplus (const Value &a, std::pmr::memory_resource *mr=nullptr)
 Unary plus (y = +a).
Value nk::builtin::uminus (const Value &a, std::pmr::memory_resource *mr=nullptr)
 Unary minus / negation (y = -a).
Value nk::builtin::pagemtimes (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Page-wise matrix multiplication (pagemtimes(a, b)).
Value nk::builtin::pagemtimes (const Value &x, TranspOp tx, const Value &y, TranspOp ty, std::pmr::memory_resource *mr=nullptr)
 Page-wise matrix multiplication with transpositions (pagemtimes(x, tx, y, ty)).
Value nk::builtin::eq (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise equality (y = a == b).
Value nk::builtin::ne (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise inequality (y = a ~= b).
Value nk::builtin::lt (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise less than (y = a < b).
Value nk::builtin::le (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise less than or equal (y = a <= b).
Value nk::builtin::gt (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise greater than (y = a > b).
Value nk::builtin::ge (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise greater than or equal (y = a >= b).
Value nk::builtin::logical_and (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise logical AND (y = a & b).
Value nk::builtin::and_op (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Alias for logical_and (y = a & b).
Value nk::builtin::logical_or (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise logical OR (y = a | b).
Value nk::builtin::or_op (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Alias for logical_or (y = a | b).
Value nk::builtin::logical_not (const Value &a, std::pmr::memory_resource *mr=nullptr)
 Elementwise logical NOT (y = ~a).
Value nk::builtin::not_op (const Value &a, std::pmr::memory_resource *mr=nullptr)
 Alias for logical_not (y = ~a).
Value nk::builtin::logical_xor (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Elementwise logical exclusive OR (y = xor(a, b)).
Value nk::builtin::xor_op (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Alias for logical_xor (y = xor(a, b)).
Value nk::builtin::any (const Value &x, int dim=0, std::pmr::memory_resource *mr=nullptr)
 True if any element of array is non-zero (y = any(x, dim)).
Value nk::builtin::all (const Value &x, int dim=0, std::pmr::memory_resource *mr=nullptr)
 True if all elements of array are non-zero (y = all(x, dim)).
Value nk::builtin::ctranspose (const Value &a, std::pmr::memory_resource *mr=nullptr)
 Complex conjugate transpose (y = a').
Value nk::builtin::transpose (const Value &a, std::pmr::memory_resource *mr=nullptr)
 Non-conjugate array transpose (y = a.
Value nk::builtin::logicalAnd (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Alias for logical_and.
Value nk::builtin::logicalOr (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Alias for logical_or.
Value nk::builtin::logicalNot (const Value &a, std::pmr::memory_resource *mr=nullptr)
 Alias for logical_not.
Value nk::builtin::logicalXor (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Alias for logical_xor.
Value nk::builtin::transposeNC (const Value &a, std::pmr::memory_resource *mr=nullptr)
Value nk::builtin::bitand_ (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Bitwise AND of integer arrays (bitand(a, b)).
Value nk::builtin::bitor_ (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Bitwise OR of integer arrays (bitor(a, b)).
Value nk::builtin::bitxor_ (const Value &a, const Value &b, std::pmr::memory_resource *mr=nullptr)
 Bitwise XOR of integer arrays (bitxor(a, b)).
Value nk::builtin::bitshift (const Value &a, const Value &k, std::pmr::memory_resource *mr=nullptr)
 Bitwise shift of integer values (bitshift(a, k)).
Value nk::builtin::bitcmp (const Value &a, int width=64, std::pmr::memory_resource *mr=nullptr)
 Bitwise complement (bitcmp(a, width)).
Value nk::builtin::bitset (const Value &a, const Value &n, const Value &val=Value(), std::pmr::memory_resource *mr=nullptr)
 Sets specified bit in integer array (bitset(a, n, val)).
Value nk::builtin::bitget (const Value &a, const Value &n, std::pmr::memory_resource *mr=nullptr)
 Gets bit value at specified bit position in integer array (bitget(a, n)).

Detailed Description

Fundamental arithmetic, relational, logical, and array operator functions.

Provides an engine-free, highly-optimized C++ interface for standard MATLAB operators, supporting elementwise broadcasting, type promotions, and SIMD acceleration.

Definition in file ops.hpp.