I'm using pyscipopt to use scip and in my model I want to look at those columns of a matrix that correspond to the variables that are non-zero. However the expression A[:, np.nonzero(var_list)[0]]
doesn't work as expected because the objects in the list var_list
are variable objects, not their respective values, so they are all considered to be non-zero. How can I get around this?
Edit: This expression is in the objective I am trying to minimize, so something like [Model.getVal(x) for x in var_list]
won't work.