nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
properties.hpp
Go to the documentation of this file.
1
3// toolboxes/linalg/include/nk/linalg/properties.hpp
4//
5// Scalar properties of a matrix: determinant, trace, rank, condition
6// number estimates. Plus the inverse `inv` (returned-matrix form;
7// the operator-side `mldivide` (`\`) lives in toolboxes/builtin and uses
8// the same underlying `la_solve` kernel).
9//
10// Migrated from toolboxes/builtin/src/language/arrays/{matrix,linalg_extras}.cpp.
11
12#pragma once
13
14#include <memory_resource>
15#include <nk/value/value.hpp>
16
17namespace nk::linalg {
18
21
22
32Value inv(const Value &A, std::pmr::memory_resource *mr = nullptr);
33
35Value trace(const Value &A, std::pmr::memory_resource *mr = nullptr);
36
40Value det(const Value &A, std::pmr::memory_resource *mr = nullptr);
41
46Value rank_of(const Value &A, double tol = -1.0, std::pmr::memory_resource *mr = nullptr);
47
51Value cond_2norm(const Value &A, std::pmr::memory_resource *mr = nullptr);
52
61Value cond_pnorm(const Value &A, int p_kind, std::pmr::memory_resource *mr = nullptr);
62
67Value normest(const Value &A, std::pmr::memory_resource *mr = nullptr);
68
74Value rcond(const Value &A, std::pmr::memory_resource *mr = nullptr);
75
82Value condest(const Value &A, std::pmr::memory_resource *mr = nullptr);
83
93Value condeig(const Value &A, std::pmr::memory_resource *mr = nullptr);
94
95
97} // namespace nk::linalg
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
Value rank_of(const Value &A, double tol=-1.0, std::pmr::memory_resource *mr=nullptr)
Numerical rank (r = rank(A, tol)).
Value condeig(const Value &A, std::pmr::memory_resource *mr=nullptr)
Eigenvalue condition numbers (c = condeig(A)).
Value trace(const Value &A, std::pmr::memory_resource *mr=nullptr)
Trace = sum of diagonal (t = trace(A)).
Value condest(const Value &A, std::pmr::memory_resource *mr=nullptr)
1-norm condition number estimate (c = condest(A)).
Value det(const Value &A, std::pmr::memory_resource *mr=nullptr)
Determinant via LU with partial pivoting (d = det(A)).
Value inv(const Value &A, std::pmr::memory_resource *mr=nullptr)
Matrix inverse via LU (B = inv(A)).
Value cond_pnorm(const Value &A, int p_kind, std::pmr::memory_resource *mr=nullptr)
General p-norm condition number (c = cond(A, p)).
Value rcond(const Value &A, std::pmr::memory_resource *mr=nullptr)
Reciprocal 1-norm condition estimate (c = rcond(A)).
Value cond_2norm(const Value &A, std::pmr::memory_resource *mr=nullptr)
2-norm condition number (c = cond(A)).
Value normest(const Value &A, std::pmr::memory_resource *mr=nullptr)
2-norm estimate (n = normest(A)).