Changeset 41 for distools/pe_mtimes.m
- Timestamp:
- 02/17/13 14:56:55 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
distools/pe_mtimes.m
r10 r41 3 3 % C = PE_MTIMES(A,B) 4 4 % 5 % A and/or B should be datasets. TheirPE signature SIG is retrieved,5 % A should be a PE dataset. Its PE signature SIG is retrieved, 6 6 % C = A*J*B, where J is a diagonal matrix with 1's, followed by -1's. 7 7 % J = diag ([ONES(SIG(1),1); -ONES(SIG(2),1)]) … … 9 9 function c = pe_mtimes(a,b) 10 10 11 siga = getsig(a); 12 sigb = getsig(b); 13 14 if isdataset(a) & isdataset(b) 15 if any(siga~=sigb) 16 error('PE signatures should be equal') 17 end 18 J = diag([ones(1,siga(1)) -ones(1,siga(2))]); 19 c = a*J*b; 20 elseif isdataset(a) 21 J = diag([ones(1,siga(1)) -ones(1,siga(2))]); 22 c = a*J*b; 23 elseif isdataset(b) % problem! make doubles 24 J = diag([ones(1,sigb(1)) -ones(1,sigb(2))]); 25 c = a*J*(+b); 26 else % just doubles, no PE space 27 c = a*b; 28 end 11 isdataset(a); 12 sig = getsig(a); 13 J = diag([ones(1,sig(1)) -ones(1,sig(2))]); 14 c = a*J*b; 29 15 30 16
Note: See TracChangeset
for help on using the changeset viewer.