You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You shouldn't do this because solvers will often return values within a tolerance, instead of exact 0.0 and 1.0.
julia>Bool(1e-8)
ERROR: InexactError:Bool(1.0e-8)
Stacktrace:
[1] Bool(::Float64) at ./float.jl:73
[2] top-level scope at REPL[17]:1
The larger issue remains, however. We really need to think about how we manage the DenseAxisArray and SparseAxisArray. They don't play nice with the broader ecosystem.
I have been solving a problem with binary (
Bin
) variables.To my annoyance, they come out as floating point values.
So I convert them by calling
Bool
.I thought i could clean my code up by doing the convert at the same time as a did the
value
Bool.(value.(my_bin_array_var))
But i got this error:
Presumably this is because broadcasting
Bool
over aArray
gives back aBitArray
.and
DenseAxisArray
is not prepared to handle that.Here is a MWE without a solve in it::
The text was updated successfully, but these errors were encountered: