This file is indexed.

/usr/share/dynare/matlab/vnorm.m is in dynare-common 4.4.1-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
function y = vnorm(A,varargin)
% VNORM - Return the vector norm along specified dimension of A
%
%   VNORM(A) returns the 2-norm along the first non-singleton
%   dimension of A
%   VNORM(A,dim) return the 2-norm along the dimension 'dim'
%   VNORM(A,dim,normtype) returns the norm specified by normtype
%   along the dimension 'dim'
%   VNORM(A,[],normtype) returns the norm specified by normtype along
%   the first non-singleton dimension of A
%
%   normtype may be one of {inf,-inf,positive integer}.
%   For a given vector, v, these norms are defined as
%   inf: max(abs(v))
%   -inf: min(abs(v))
%   p (where p is a positive integer): sum(abs(v).^p)^(1/p)
%
%   Examples:
%       A =  [8 1 6; 3 5 7; 4 -9 2];
%
%       %Columnwise 2-norm (Euclidean norm)
%       vnorm(A,1) = [9.4340 10.3441 9.4340];
%       vnorm(A,[],2) % Same as above (since first non-singleton dimensions
%                     % is columnwise and default norm is 2-norm.
%       vnorm(A,[],[])% Again, same as above
%
%       % Row-wise maximum of absolute values
%       vnorm(A,2,inf) = [8 7 9]';
%
%       % Columnwise minimum of absolute values
%       vnorm(A,[],-inf) = [3 1 2];
%
%       % Error: Use the inf type and not the string 'inf'
%       vnorm(A,[],'inf')   % Wrong
%       vnorm(A,[],inf)     % Correct
%
%
% Copyright (C) 2009-2011 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
dim = [];
ntype = [];

if nargin>1
    dim = varargin{1};
    if isempty(dim)
        idx = find(size(A)~=1);
        dim = idx(1);
    elseif dim~=floor(dim) || dim<1
        error('Dimension must be positive integer');
    end
    if nargin>2
        ntype = varargin{2};
    end
end

if isempty(dim)
    idx = find(size(A)~=1);
    dim = idx(1);
end
    
if isempty(ntype)
    y = sqrt(sum( abs(A).^2 , dim) );
elseif ntype==1
    y = sum( abs(A) , dim );
elseif isinf(ntype)
    if ntype > 0
        y=max(abs(A), [], dim);
    else
        y=min(abs(A), [], dim);
    end
elseif ntype~=floor(ntype) || ntype<1
    error(['Norm type must be one of inf,-inf or a positive ' ...
           'integer']);
else
    y = (sum( abs(A).^ntype , dim) ).^(1/ntype);
end