New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#731 - Constraints list of Ball1 #735
Conversation
src/Ball1.jl
Outdated
clist = Vector{LinearConstraint{N}}(undef) | ||
sizehint!(clist, 2^n) | ||
for (i, di) in enumerate(Iterators.product([[one(N), -one(N)] for i = 1:n]...)) | ||
di = collect(di) # tuple -> vector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally one should not redefine variables with new types for type stability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i added because i was getting MethodError
no method matching dot(::Tuple, ::Array)
. i don't know if it can be done in a different way, seems like Iterators.product...
is always returning tuples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to use a new variable name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks, this was more a general remark, not meant to be fixed, but 👍
You could have just removed the |
Closes #731.