What is the proper way to count binary variables in my jump model?
I have been using:
MathOptInterface = MOI const_types = list_of_constraint_types(model) n_bin = 0 n_lin = 0 for i = 1:length(const_types) var = const_types[i] const_type = const_types[i] l = num_constraints(model, var, const_type) if const_type == MathOptInterface.ZeroOne n_bin += l else n_lin += l end end
And then we have number of binary variables is
n_bin and number of real variables (Assuming there are only two types) is
num_variables(model) - n_bin and number of constraints (all are linear) is
n_lin. Does this seem right?