source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/convertlogics.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 796 bytes
Line 
1function [F,changed] = convertlogics(F)
2%CONVERTLOGICS Internal function to convert logic constraints to mixed integer constraints
3
4% Author Johan Löfberg
5% $Id: convertlogics.m,v 1.9 2006/09/20 12:43:45 joloef Exp $
6
7changed = 0;
8if length(F)>0
9    extvariables = yalmip('logicextvariables');
10    if ~isempty(extvariables)       
11        for i = 1:length(F)
12            if is(F(i),'elementwise')
13                Fi = sdpvar(F(i));
14                Fv =getvariables(Fi);
15                if length(Fv)==1
16                    xb = getbase(Fi);
17                    if isequal(xb,[0 1])
18                        if ismember(Fv,extvariables)
19                            F(i) = set(Fi >= 1);
20                        end
21                    end
22                end
23            end
24        end
25    end
26end
Note: See TracBrowser for help on using the repository browser.