Skip to content
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

Merged
merged 5 commits into from Oct 7, 2018
Merged

#731 - Constraints list of Ball1 #735

merged 5 commits into from Oct 7, 2018

Conversation

mforets
Copy link
Member

@mforets mforets commented Oct 7, 2018

Closes #731.

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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

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 👍

@schillic
Copy link
Member

schillic commented Oct 7, 2018

You could have just removed the undef 😄

@mforets mforets merged commit 117d8e5 into master Oct 7, 2018
@mforets mforets deleted the mforets/731 branch October 7, 2018 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants