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
chromatic_polynomial - fixed memory leak and added new test cases #14527
Comments
comment:2
Looks right ! Is there any reason why every Nathann |
comment:3
m is a single mpz_t variable and is correctly freed in this patch. As for coeffs[i] you're right - nice catch. That should be freed as well IMO. I've attached a patch fixing this remark as well. Can you check if it makes sense to stack patches like that? PS. What is the status of the edge contraction code? I would like to test this memonization thing that I talk about.. |
comment:4
Attachment: trac_14527_chrompoly2.patch.gz
Yeah it does. We do it often when we use Mercurial Queue, but if you don't perhaps it is not worth trying it... considering that we will switch to git soon (wheeeeeeeeeen ??)
The status ? Well, it has been there for years and never touched again :
Nathann |
comment:5
To me this test on a random graph is too long, too
I understand what you want to do with these long tests, but I really think that people around will not like the side-effects if we keep on like that Nathann |
comment:6
Replying to @nathanncohen:
Interesting. What is the reason for switching to Git? Its because Linus uses it right???
Nonono not this! I was asking about the code that you guys were doing that allows contracting an edge of a graph. I am not sure this thing was accepted yet?
|
comment:7
Replying to @nathanncohen:
I understand yes. Somehow I was thought to always extensively and insanely test software. The fact that i use this for research made me exaggerate even more. I still think that's the way to go but I completely agree with you that in the current setting this might not be the best way to go :-) |
comment:8
From my point of view, it is because some Sage developpers think that it is great. And I've been contaminated by their enthusiasm, even though I barely used it
Oh. I don't know where it stands. I hate that patch. But honestly, if you want efficient code, rewrite your own. It is not a long code anyway. Nathann |
comment:9
Replying to @nathanncohen:
Yes but I just wanted to quickly test something and not bother writing an edge contraction routine :-/ Do you happen to be able to extract that quickly from the patch or something? I just need to be able to contract an edge of a graph (ignoring loops & multiple edges)
|
comment:10
Quickly contract an edge
|
comment:11
Oh. I mean, in a graph that does not allow multiple edges Nathann |
comment:12
So, what do you decide with this patch ? If you make this 13 a 10 I agree with it, otherwise I will let somebody else give it a review. You tell me ! Nathann |
comment:13
10 it is! |
comment:14
Okayyyyy, thanks ! By the way, when there are several patches on a ticket, Jeroen likes to have a message in the trac's description saying how they are to be applied. Like the one I just added. Have fuuuuuuuuuuuuuuun ! Nathann |
This comment has been minimized.
This comment has been minimized.
comment:15
And the following message is there to tell the patchbot (the circle that you see at the top of each ticket's page) how to apply the patches. |
comment:16
Apply trac_14527_chrompoly.patch, trac_14527_chrompoly2.patch |
comment:17
Oh Looks like your new example is missing a Nathann |
comment:18
Attachment: trac_14527_chrompoly.patch.gz Fixed. |
comment:19
Good to go ! Nathann |
Author: Jernej Azarija |
Reviewer: Nathann Cohen |
Merged: sage-5.10.beta2 |
This patch fixes a minor memory leak in the chromatic polynomial code. It appears to me that the mpz variables should be freed at the end of the function.
I have also added additional tests.
The code appears not to be practical for graphs of order +15. I am wondering if we could gain some speed by using memoization. It would complicate the code quite a bit but it might be a drastic improvement!
CC: ncohen stefan slani
Component: graph theory
Author: Jernej Azarija
Reviewer: Nathann Cohen
Merged: sage-5.10.beta2
Issue created by migration from https://trac.sagemath.org/ticket/14527
The text was updated successfully, but these errors were encountered: