-
Notifications
You must be signed in to change notification settings - Fork 14
/
multiindex_anisotropic.m
53 lines (48 loc) · 1.85 KB
/
multiindex_anisotropic.m
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
function I=multiindex_anisotropic(m,p,alpha)
% MULTIINDEX_ANISOTROPIC Short description of multiindex_anisotropic.
% MULTIINDEX_ANISOTROPIC Long description of multiindex_anisotropic.
%
% Example (<a href="matlab:run_example multiindex_anisotropic">run</a>)
% I=multiindex_anisotropic( 2, 13, [3, 2] )
% m=sparse( I(:,1)+1, I(:,2)+1, ones( size(I,1), 1 ) );
% subplot(2,2,1);
% spy2(m,'face_color',[1 0.6 0.7],'edge_color','k');
% axis image
% set( gca, 'ydir', 'normal' );
% subplot(2,2,2);
% I=multiindex_anisotropic( 2, 10, [2, 1] )
% m=sparse( I(:,1)+1, I(:,2)+1, ones( size(I,1), 1 ) );
% spy2(m,'face_color',[.2 0.3 1.0],'edge_color','k');
% axis image
% set( gca, 'ydir', 'normal' );
% I=multiindex_anisotropic( 2, 10, [4, 3] )
% m=sparse( I(:,1)+1, I(:,2)+1, ones( size(I,1), 1 ) );
% subplot(2,2,3);
% spy2(m,'face_color',[0.3 0.85 0.3],'edge_color','k');
% axis image
% set( gca, 'ydir', 'normal' );
% I=multiindex_anisotropic( 2, 6, [6, 1] )
% m=sparse( I(:,1)+1, I(:,2)+1, ones( size(I,1), 1 ) );
% subplot(2,2,4);
% spy2(m,'face_color',[1 0.2 0.1],'edge_color','k');
% axis image
% set( gca, 'ydir', 'normal' );
%
% See also
% Elmar Zander
% Copyright 2010, Inst. of Scientific Computing
%
% This program 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.
% See the GNU General Public License for more details. You should have
% received a copy of the GNU General Public License along with this
% program. If not, see <http://www.gnu.org/licenses/>.
%check_numeric( alpha, 'integer' );
%check_range( alpha, 1, inf, 'alpha', mfilename );
alpha=alpha(:);
I=multiindex(m,p);
amin=min(alpha);
ind=(I*alpha)<amin*p;
I=I(ind,:);