summaryrefslogtreecommitdiff
path: root/tests/general_tests/linprog/linprog_logical2.sce
blob: a8f99a7f2fc9160f15e5c0491030365106dcda19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// An example with inequality and equality constraints
c=[-1,-1/3]'
A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
b=[2,1,2,1,-1,2]
Aeq=[1,1/4]
beq=[1/2]

//Output
//Optimal Solution.
// lambda  =
// 
//   reduced_cost: [0,0]
//   ineqlin: [-0.1111111,0,0,0,0,0]
//   eqlin: -0.8888889
// output  =
// 
//   Iterations: 0
//   constrviolation: 0
// exitflag  =
// 
//    0.  
// fopt  =
// 
//  - 0.6666667  
// xopt  =
// 
//    0.  
//    2.  

[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq)