-
Notifications
You must be signed in to change notification settings - Fork 2
/
oppDirac.m
60 lines (48 loc) · 1.69 KB
/
oppDirac.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
54
55
56
57
58
59
60
classdef oppDirac < oppOrthogonal
%OPPDIRAC Parallel Dirac basis.
%
% oppDirac(N) creates the square N-by-N identity operator. Without
% any arguments an operator corresponding to the scalar 1 is
% created.
% Copyright 2009, Ewout van den Berg and Michael P. Friedlander
% See the file COPYING.txt for full copyright information.
% Use the command 'spot.gpl' to locate this file.
% http://www.cs.ubc.ca/labs/scl/spot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Methods - public
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
methods
% Constructor
function op = oppDirac(n)
if nargin < 1, n = 1; end
op = op@oppOrthogonal('pDirac',n,n);
op.isDirac = true;
op.sweepflag = true;
end
function A = double(op)
A = eye(size(op));
end
function result = xtratests(op)
%XTRATESTS User defined tests
%
% Just a demo here
result = true;
disp('How thoughtful of you to test oppDirac!!!');
end
end % methods - public
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Methods - protected
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
methods( Access = protected )
% Multiplication
function y = multiply(op,x,mode)
y = x;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Divide
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function x = divide(op,b,mode)
x = b;
end % divide
end % methods - protected
end % classdef