Norm 1|2|p|inf|fro of a matrix of DD numbers
dd = norm(A) dd = norm(A, 1) dd = norm(A, 2) dd = norm(A, p) dd = norm(A, %inf|'inf') dd = norm(A, 'fro'|'f')
matrix of DD real numbers. Row vectors are transposed, in order to make their norm matching the correspond matrix-case definition.
![]() | The 2-norm is presently restricted to input vectors. |
single DD number: the norm of A
.
The native norm()
Scilab function is overloaded in order to process
DD and QD matrices.
As a reminder, here are the norm definitions:
1 | L-1 norm: max(sum(abs(A),'r')) |
---|---|
2 | Euclidian norm. |
p | L-p norm: sum(abs(A).^p)^(1/p) , with p>2: Not implemented |
inf | Infinity norm: max(sum(abs(A),'c')) . For a vector
(forced to a column A), this is max(abs(A)) |
fro | Frobenius norm: sqrt(sum(diag(A'*A))) . For a vector
(forced to a column A), this matches the euclidian norm. |
Norm of a matrix:
q = d2dd([-2:2; 1:5]) format(20) norm(q,1) norm(q.d,1) norm(q, %inf) norm(q.d, %inf) norm(q, 'fro') norm(q.d, 'fro') format(10) | ![]() | ![]() |
--> q = d2dd([-2:2; 1:5]) q = [d1] -2. -1. 0. 1. 2. 1. 2. 3. 4. 5. [d2] zeros(2,5) [d3] zeros(2,5) [d4] zeros(2,5) --> format(20) --> norm(q,1) ans = 7.00000000000000000000000000000000000000000000000000000000000000E0 --> norm(q.d,1) ans = 7. --> norm(q, %inf) ans = 1.50000000000000000000000000000000000000000000000000000000000000E1 --> norm(q.d, %inf) ans = 15. --> norm(q, 'fro') ans = 8.06225774829854965236661323030377113113439630560857338793659239E0 --> norm(q.d, 'fro') ans = 8.06225774829855090
L2-Norm of a vector:
--> q = d2dd(1:3)' q = [d1] 1. 2. 3. [d2] zeros(3,1) [d3] zeros(3,1) [d4] zeros(3,1) --> norm(q) ans = 3.74165738677394138558374873231654930175601980777872694630374547E0 --> norm(q.d) ans = 3.74165738677394090