# Assigning domains of variables automatically

I want to find a feasible solution for mixed integer linear program. The first $t$ variables in the system are integers and other are reals.

The problem is that the no. of variables is more than hundred and so it is infeasible to assign domains individually.So, I want to know if there is any way to assign domains to variables in automated fashion.

• vars = Array[v, 120]; t = 40; \$Assumptions = {Element[vars[[1 ;; t]], Integers], Element[vars[[t + 1 ;;]], Reals]}; – Bob Hanlon Oct 4 '16 at 23:56
• @BobHanlon But in LinearProgramming command, we don't specify variables. Is it possible to do this while using LinearProgramming command – Phani Raj Oct 6 '16 at 0:02
• As shown in the documentation, the fifth (optional) argument to LinearProgramming is the domain specification(s). Try: {ConstantArray[Integers, t], ConstantArray[Reals, n-t]}//Flatten – Bob Hanlon Oct 6 '16 at 0:40