-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Deficiency one and concnetration robustness #964
Conversation
This needs to be updated to master. |
src/network_analysis.jl
Outdated
|
||
for (c_s, c_p) in collect(Combinatorics.combinations(nonterminal_complexes, 2)) | ||
# Check the difference of all the combinations of complexes. The support is the set of indices that are non-zero | ||
supp = findall(!=(0), Z[:, c_s] - Z[:, c_p]) |
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.
The column difference could be stored in a pre-calculated vector from outside the loop like
@. tmp = @views Z[:, c_2] - Z[:, c_p]
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.
More generally, seems like this could be written as a non-allocating loop that bails if a second match is found instead of continuing the search, and if a second match isn't found saves it in robust_species
.
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.
Re the first comment: would I accomplish the same thing by adding @views
in the supp
line, so it becomes
supp = findall(!=(0), @views Z[:, c_s] - Z[:, c_p])
Seems like allocating it entirely outside might take a lot of space (would have to be a 3D array, where each difference vector is indexed by (c_s, c_p))
For the second comment, what do you mean by second match? I don't immediately see a way to skip a check for a species we already know is robust because we can't know that it's in the support of a difference of two complexes until we calculate it
@vyudu LGTM. Feel free to merge at your leisure. |
Concentration robustness for deficiency one networks. Relies on strong and terminal linkage classes.