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

More efficient components() for BasisExchangeMatroid #18591

Closed
sagetrac-Rudi mannequin opened this issue Jun 2, 2015 · 8 comments
Closed

More efficient components() for BasisExchangeMatroid #18591

sagetrac-Rudi mannequin opened this issue Jun 2, 2015 · 8 comments

Comments

@sagetrac-Rudi
Copy link
Mannequin

sagetrac-Rudi mannequin commented Jun 2, 2015

Write a specialised version of Matroid.components() for BasisExchangeMatroid which exploits bitsets to improve the efficiency.

CC: @chaoxu

Component: matroid theory

Author: Rudi Pendavingh

Branch/Commit: 9767c25

Reviewer: Chao Xu

Issue created by migration from https://trac.sagemath.org/ticket/18591

@sagetrac-Rudi sagetrac-Rudi mannequin added this to the sage-6.8 milestone Jun 2, 2015
@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 2, 2015

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 2, 2015

Commit: 9767c25

@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 2, 2015

comment:2

All done.


New commits:

9767c25added BasisEchangeMatroid.components()

@sagetrac-Rudi sagetrac-Rudi mannequin added the s: needs review label Jun 2, 2015
@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 2, 2015

comment:3

With the new routine:

sage: A =MatrixSpace(GF(2), 500, 1000).random_element()
sage: M = Matroid(A)
sage: timeit("M.components()")
625 loops, best of 3: 244 µs per loop

Forcing the use of the old routine:

sage: timeit("sage.matroids.matroid.Matroid.components(M)")
5 loops, best of 3: 52.2 ms per loop

@chaoxu
Copy link
Mannequin

chaoxu mannequin commented Jun 3, 2015

Reviewer: Chao Xu

@chaoxu
Copy link
Mannequin

chaoxu mannequin commented Jun 3, 2015

comment:4

All tests passed.
The behavior also matches with the original for all matroids of at most 9 elements.

@chaoxu chaoxu mannequin added s: positive review and removed s: needs review labels Jun 3, 2015
@sagetrac-Rudi
Copy link
Mannequin Author

sagetrac-Rudi mannequin commented Jun 3, 2015

comment:5

Thanks Chao. That was quick!

@sagetrac-Rudi sagetrac-Rudi mannequin self-assigned this Jun 3, 2015
@vbraun
Copy link
Member

vbraun commented Jun 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant