summaryrefslogtreecommitdiff
path: root/tests/general_tests/cbcintlinprog/cbcintlinprog_A.sce
blob: 5c592d7a36481c5800bcc044b45ebf70bd7c33d4 (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
33
34
35
// Check if a user specifies coefficients of linear inequality contraints of the correct dimensions 

// Reference : Example 1-3, Integer Linear Programming, Hamdy A. Taha. "Operations Research-An Introduction", 9E(2014))

// Objective function
c = [0.25,0.21,0.22,16,25,18]';

// Lower Bound of variable
lb = repmat(0,1,6);
// Upper Bound of variables
ub = [repmat(%inf,1,3) repmat(1,1,3)];

// Constraint Matrix
A = [1, 0, 0, -200, 0, 0;
0, 1, 0, 0, -200, 0;
0, 0, 1, 0, 0, -200]

b=[0, 0, 0]

Aeq = [1, 1, 1, 0, 0, 0]

beq = [ 200]

intcon = [4 5 6];

// Calling cbcintlinprog
[x,f,status,output] = cbcintlinprog(c,intcon,b,b,Aeq,beq,lb,ub)

// !--error 10000 
//cbcintlinprog: The size of inequality constraint is not equal to the number of variables
//at line     128 of function cbcmatrixintlinprog called by :  
//at line     203 of function cbcintlinprog called by :  
//[x,f,status,output] = cbcintlinprog(c,intcon,b,b,Aeq,beq,lb,ub)
//at line      27 of exec file called by :    
//exec cbcintlinprog_A.sce