Changeset 41 for distools


Ignore:
Timestamp:
02/17/13 14:56:55 (12 years ago)
Author:
bduin
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • distools/pe_mtimes.m

    r10 r41  
    33%  C = PE_MTIMES(A,B)
    44%
    5 % A and/or B should be datasets. Their PE signature SIG is retrieved,
     5% A should be a PE dataset. Its PE signature SIG is retrieved,
    66% C = A*J*B, where J is a diagonal matrix with 1's, followed by -1's.
    77% J = diag ([ONES(SIG(1),1);  -ONES(SIG(2),1)])
     
    99function c = pe_mtimes(a,b)
    1010
    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
     11isdataset(a);
     12sig = getsig(a);
     13J = diag([ones(1,sig(1))  -ones(1,sig(2))]);
     14c = a*J*b;
    2915 
    3016 
Note: See TracChangeset for help on using the changeset viewer.