Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Mixeinteger programming constraint definition

Sorry to ask so much questions but I am in hurry. I would like to know why this procedure doesn't work

A= matrix(8,4,(1,1,1,-14,0,1,2,-8,-1,1,1,0,0,0,0,-1,1,0,0,0,0,1,0,0,0,0,0,0,0,1)) b= matrix(8,1,(0,0,0,-1,0,0,0,0)) sign=list('==' '==' '>=' '>=' '>=' '>=' '>=' '>=') x = vector(var('x', n=4, latex_name='x')) B=A*x

p = MixedIntegerLinearProgram(maximization=False, solver = "GLPK") sage: x = p.new_variable(integer=True)

p.add_constraint(B[0] 'sign[0]' b[0])

for the last line I have tryed

p.add_constraint(B[0] sign[0] b[0])

p.add_constraint(B[0] == b[0])

Mixeinteger programming constraint definition

Sorry to ask so much questions but I am in hurry. I would like to know why this procedure doesn't work

A= matrix(8,4,(1,1,1,-14,0,1,2,-8,-1,1,1,0,0,0,0,-1,1,0,0,0,0,1,0,0,0,0,0,0,0,1)) A=

matrix(8,4,(1,1,1,-14,0,1,2,-8,-1,1,1,0,0,0,0,-1,1,0,0,0,0,1,0,0,0,0,0,0,0,1))

b= matrix(8,1,(0,0,0,-1,0,0,0,0)) matrix(8,1,(0,0,0,-1,0,0,0,0))

sign=list('==' '==' '>=' '>=' '>='> '>=' '>=' '>=' '>=') '>=')

x = vector(var('x', n=4, latex_name='x')) vector(var('x',n=4, latex_name='x'))

B=A*x

p = MixedIntegerLinearProgram(maximization=False, solver = "GLPK") sage: "GLPK")

x = p.new_variable(integer=True)

p.add_constraint(B[0] 'sign[0]' b[0])

for the last line I have tryed

p.add_constraint(B[0] sign[0] b[0]) b[0])

p.add_constraint(B[0] == b[0])

b[0])

without any success.

Mixeinteger programming constraint definition

Sorry to ask so much questions but I am in hurry. I would like to know why this procedure doesn't work

A=

matrix(8,4,(1,1,1,-14,0,1,2,-8,-1,1,1,0,0,0,0,-1,1,0,0,0,0,1,0,0,0,0,0,0,0,1))

b= matrix(8,1,(0,0,0,-1,0,0,0,0))

sign=list('==' '==' '>=' '>=' '>='> '>=' '>=' '>=')

x = vector(var('x',n=4, latex_name='x'))

B=A*x

p = MixedIntegerLinearProgram(maximization=False, solver = "GLPK")

x = p.new_variable(integer=True)

p.add_constraint(B[0] 'sign[0]' b[0])

for the last line I have tryed

p.add_constraint(B[0] sign[0] b[0])

p.add_constraint(B[0] == b[0])

without any success.

click to hide/show revision 4
retagged

Mixeinteger programming constraint definition

Sorry to ask so much questions but I am in hurry. I would like to know why this procedure doesn't work

A=

matrix(8,4,(1,1,1,-14,0,1,2,-8,-1,1,1,0,0,0,0,-1,1,0,0,0,0,1,0,0,0,0,0,0,0,1))

b= matrix(8,1,(0,0,0,-1,0,0,0,0))

sign=list('==' '==' '>=' '>=' '>='> '>=' '>=' '>=')

x = vector(var('x',n=4, latex_name='x'))

B=A*x

p = MixedIntegerLinearProgram(maximization=False, solver = "GLPK")

x = p.new_variable(integer=True)

p.add_constraint(B[0] 'sign[0]' b[0])

for the last line I have tryed

p.add_constraint(B[0] sign[0] b[0])

p.add_constraint(B[0] == b[0])

without any success.