Line | |
---|
1 | function Z = minus(cx,P) |
---|
2 | %display Overloaded |
---|
3 | |
---|
4 | % Author Johan Löfberg |
---|
5 | % $Id: minus.m,v 1.2 2004/09/19 21:33:49 johanl Exp $ |
---|
6 | |
---|
7 | % Standard case c't-logdet(P) |
---|
8 | |
---|
9 | if isa(P,'logdet') % sdpvr - logdet |
---|
10 | |
---|
11 | if prod(size(cx))>1 |
---|
12 | error('Only scalar terms can be added to a logdet term'); |
---|
13 | end |
---|
14 | |
---|
15 | if isa(cx,'logdet') |
---|
16 | error('Logdet objects can only be added'); |
---|
17 | end |
---|
18 | |
---|
19 | Z = P; |
---|
20 | if isempty(P.cx) |
---|
21 | Z.cx = cx; |
---|
22 | else |
---|
23 | Z.cx = cx-P.cx; |
---|
24 | end |
---|
25 | Z.gain = -Z.gain; |
---|
26 | else % logdet - cx |
---|
27 | temp = cx; |
---|
28 | cx = P; |
---|
29 | P = temp; |
---|
30 | |
---|
31 | Z = P; |
---|
32 | if isempty(P.cx) |
---|
33 | Z.cx = -cx; |
---|
34 | else |
---|
35 | Z.cx = P.cx-cx; |
---|
36 | end |
---|
37 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.