Skip to content

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Jun 7, 2018

No description provided.

# setindex! for logical indices
AA = copy(A)
AA[vec(isodd.(A))] = 0.
@test AA[odd_inds] == zeros(odd_inds)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this method of zeros is deprecated

AA = copy(A)
AA[vec(isodd.(A))] = 0.
@test AA[odd_inds] == zeros(odd_inds)
@test AA[2:2:length(AA)] == A[2:2:length(AA)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

What are you testing here? Did you mean to do:

AA[odd_inds] == A[2:2:length(AA)]

or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I'm checking that the even indexed items weren't modified.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh wow, sorry, I totally misread the second line!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries haha I absolutely cannot throw stones in this regard!

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.

2 participants