Line | |
---|
1 | function F = shift(F,shifttol) |
---|
2 | |
---|
3 | % Author Johan Löfberg |
---|
4 | % $Id: shift.m,v 1.4 2005/02/04 10:10:27 johanl Exp $ |
---|
5 | |
---|
6 | for i = 1:size(F.clauses,2) |
---|
7 | switch F.clauses{i}.type |
---|
8 | case {1,9} |
---|
9 | n = length(F.clauses{i}.data); |
---|
10 | if F.clauses{i}.strict |
---|
11 | F.clauses{i}.data = F.clauses{i}.data - speye(n)*shifttol; |
---|
12 | end |
---|
13 | case 2 |
---|
14 | [n,m] = size(F.clauses{i}.data); |
---|
15 | if F.clauses{i}.strict |
---|
16 | F.clauses{i}.data = F.clauses{i}.data - ones(n,m)*shifttol; |
---|
17 | end |
---|
18 | case 4 |
---|
19 | n = length(F.clauses{i}.data); |
---|
20 | if F.clauses{i}.strict |
---|
21 | F.clauses{i}.data = F.clauses{i}.data - eye(n,1)*shifttol; |
---|
22 | end |
---|
23 | otherwise |
---|
24 | end |
---|
25 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.