2015-07-08 20:25:41 +0200 | commented answer | add matrix as a contraint Thanks for the response, But what I am facing now is as below, C=Matrix(6,5) for i in range(0,6): for j in range(0,5): p.add_constraint(1>=C[i,j]>=0) But it gives error , raise ValueError('argument must be a linear function or constraint, got '+str(linear_function)) ValueError: argument must be a linear function or constraint, got True Any idea how to do this. |
2015-07-08 20:25:08 +0200 | answered a question | add matrix as a contraint Thanks for the response, But what I am facing now is as below, C=Matrix(6,5) for i in range(0,6): for j in range(0,5): p.add_constraint(1>=C[i,j]>=0) But it gives error , *raise ValueError('argument must be a linear function or constraint, got '+str(linear_function)) ValueError: argument must be a linear function or constraint, got True* Any idea how to do this. |
2015-07-08 10:41:30 +0200 | asked a question | add matrix as a contraint Is there anyway where we can add a constraint as a matrix. For example I have my matrix C=matrix(5,6) I want to add a constraint p.add_constraint(C[i,j]>=1) If I do this sagemath I get value error. |