GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • YALMIP
  • Download
  • Tutorials
  • Examples
  • Inside
  • Commands
  • Solvers
  • Index
  • FAQ
  • References
  • Forum
  • Search
  • sdpvar
  • optimize

This view

  • Original page
  • New address

GeezerVison is showing yalmip.github.io — binary

binary is used to constrain a variable to be binary.

Syntax

F = binary(x)

Examples

Setting up a binary linear program can be done as

x = binvar(n,1);
optimize(A*x<=b,c'*x)

or

x = sdpvar(n,1);
optimize([A*x<=b, binary(x)],c'*x)

The binary constraint is imposed on the involved variables, not the actual expression. Hence, the following two constraints are equivalent

F = binary(x);
F = binary(pi+sqrt(2)*x);

Comments

If possible, use binvar instead as there are some parts in YALMIP where it can exploit integrality on an earlier stage if the varaibles have been defined as such.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.