File: normdiff.m

package info (click to toggle)
suitesparse-graphblas 7.4.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 67,112 kB
  • sloc: ansic: 1,072,243; cpp: 8,081; sh: 512; makefile: 506; asm: 369; python: 125; awk: 10
file content (37 lines) | stat: -rw-r--r-- 952 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function s = normdiff (A,B,kind)
%NORMDIFF norm (A-B,kind)
% If A-B is a matrix:
%
%   norm (A-B,1) is the maximum sum of the columns of abs (A-B).
%   norm (A-B,inf) is the maximum sum of the rows of abs (A-B).
%   norm (A-B,'fro') is the Frobenius norm of A-B: the sqrt of the sum of
%       the squares of the entries in A-B.
%   The 2-norm is not available for either built-in or GraphBLAS sparse
%       matrices.
%
% If A-B is a row or column vector:
%
%   norm (A-B,1) is the sum of abs (A-B)
%   norm (A-B,2) is the sqrt of the sum of (A-B).^2
%   norm (A-B,inf) is the maximum of abs (A-B)
%   norm (A-B,-inf) is the minimum of abs (A-B)
%
% See also GrB.reduce, GrB/norm.

% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved.
% SPDX-License-Identifier: Apache-2.0

if (nargin < 3)
    kind = 2 ;
end

if (isobject (A))
    A = A.opaque ;
end

if (isobject (B))
    B = B.opaque ;
end

s = gbnormdiff (A, B, kind) ;