nk
1.0.0
C++ Numerical Computing Runtime
Toggle main menu visibility
Loading...
Searching...
No Matches
norms.hpp
Go to the documentation of this file.
1
3
// toolboxes/linalg/include/nk/linalg/norms.hpp
4
//
5
// Vector and matrix norms. Migrated from toolboxes/builtin/src/language/
6
// arrays/{matrix,predicates}.cpp.
7
//
8
// `norm` for the matrix 2-norm (p == 2) routes through `svd_values`,
9
// which still lives in toolboxes/builtin/include/nk/builtin/language/
10
// arrays/matrix.hpp at this point — that header is included by the
11
// implementation TU (norms.cpp). When SVD migrates here in a later
12
// group, this include will switch over to nk/linalg/decomp/svd.hpp.
13
14
#pragma once
15
16
#include <memory_resource>
17
#include <nk/value/value.hpp>
18
19
namespace
nk::linalg {
20
23
24
37
Value
norm_value
(
const
Value
&x,
double
p, std::pmr::memory_resource *mr =
nullptr
);
38
42
Value
norm_inf
(
const
Value
&x, std::pmr::memory_resource *mr =
nullptr
);
43
47
Value
norm_fro
(
const
Value
&x, std::pmr::memory_resource *mr =
nullptr
);
48
59
Value
vecnorm
(
const
Value
&A,
double
p = 2.0,
int
dim = 0, std::pmr::memory_resource *mr =
nullptr
);
60
61
63
}
// namespace nk::linalg
nk::Value
Core MATLAB-compatible multidimensional array and scalar value type.
Definition
value.hpp:61
nk::linalg::norm_fro
Value norm_fro(const Value &x, std::pmr::memory_resource *mr=nullptr)
Frobenius norm (n = norm(A, 'fro')).
nk::linalg::norm_inf
Value norm_inf(const Value &x, std::pmr::memory_resource *mr=nullptr)
Inf-norm (n = norm(x, inf)).
nk::linalg::norm_value
Value norm_value(const Value &x, double p, std::pmr::memory_resource *mr=nullptr)
Vector / matrix p-norm (n = norm(x, p)).
nk::linalg::vecnorm
Value vecnorm(const Value &A, double p=2.0, int dim=0, std::pmr::memory_resource *mr=nullptr)
Vector p-norm along a dim (y = vecnorm(A, p, dim)).
src
toolboxes
linalg
include
nk
linalg
norms.hpp
Generated by
1.17.0