nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
misc.hpp
Go to the documentation of this file.
1
3// toolboxes/linalg/include/nk/linalg/misc.hpp
4//
5// Miscellaneous linalg utilities: reduced row echelon form (rref),
6// Givens plane rotation (planerot). Migrated from
7// toolboxes/builtin/src/language/arrays/linalg_extras.cpp.
8
9#pragma once
10
11#include <memory_resource>
12#include <utility>
13#include <nk/value/value.hpp>
14
15namespace nk::linalg {
16
19
20
24std::pair<Value, Value>
25rref(const Value &A, bool have_tol, double tol_user,
26 std::pmr::memory_resource *mr = nullptr);
27
32std::pair<Value, Value>
33planerot(const Value &xy, std::pmr::memory_resource *mr = nullptr);
34
35
37} // namespace nk::linalg
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
std::pair< Value, Value > planerot(const Value &xy, std::pmr::memory_resource *mr=nullptr)
Givens plane rotation ([G, y_out] = planerot([x; y])).
std::pair< Value, Value > rref(const Value &A, bool have_tol, double tol_user, std::pmr::memory_resource *mr=nullptr)
Reduced row echelon form ([R, jb] = rref(A, have_tol, tol)).