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

Speedup for OA_from_quasi_difference_matrix #16720

Closed
nathanncohen mannequin opened this issue Jul 27, 2014 · 13 comments
Closed

Speedup for OA_from_quasi_difference_matrix #16720

nathanncohen mannequin opened this issue Jul 27, 2014 · 13 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jul 27, 2014

Turns out that the use of a brain is underrated. I should really buy one someday.

This is what happens when you think before writing a loop:

sage -t --long database.py
    [340 tests, 3.20 s]

This is what happens when you do not

sage -t --long database.py
    [340 tests, 14.43 s]

CC: @videlec

Component: combinatorial designs

Author: Nathann Cohen

Branch/Commit: 41676cf

Reviewer: Vincent Delecroix

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

@nathanncohen nathanncohen mannequin added this to the sage-6.3 milestone Jul 27, 2014
@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jul 27, 2014

Branch: u/ncohen/16720

@nathanncohen nathanncohen mannequin added the s: needs review label Jul 27, 2014
@nathanncohen

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 27, 2014

Commit: 26975dc

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 27, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

26975dctrac #16720: Speedup for OA_from_quasi_difference_matrix

@videlec
Copy link
Contributor

videlec commented Aug 8, 2014

comment:4

Hello,

I do not understand that

-    M = M[:len(M)/2] # only develop w.r.t the last two coordinates
+    M = [M[i*18+j] for i in range(len(M)/18) for j in range(9)] # only develop w.r.t the last two coordinates

Vincent

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Aug 8, 2014

comment:5

Yoooooooo !

I do not understand that

-    M = M[:len(M)/2] # only develop w.r.t the last two coordinates
+    M = [M[i*18+j] for i in range(len(M)/18) for j in range(9)] # only develop w.r.t the last two coordinates

Ahem :-PPPPP

Thaaaaaaaaat's because the rows of the matrix were listed as 111222333 before and now it is 123123123. You don't care about that in an OA or a difference matrix, so it does not matter and it is easier to get this speedup.

The function which I had to modify above called this routine, and only needed to remember the first half of the matrix. Formerly. But now that the rows are listed differently, well getting that "half" of the matrix is a bit different :-P

I know it is not "semantically correct". Please don't make me rewrite the function for that T_T

Nathann

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 8, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

f5ea70dtrac #16720: Merged with 6.3.rc1
41676cftrac #16720: A clearer line

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 8, 2014

Changed commit from 26975dc to 41676cf

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Aug 8, 2014

comment:7

This is clearer.

Nathann

@videlec
Copy link
Contributor

videlec commented Aug 8, 2014

Reviewer: Vincent Delecroix

@videlec
Copy link
Contributor

videlec commented Aug 8, 2014

comment:8

Ok, good!

Vincent

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Aug 8, 2014

comment:9

THaaaaaaaaaaaaaaaaaaaaaaanks !!

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@vbraun
Copy link
Member

vbraun commented Aug 11, 2014

Changed branch from u/ncohen/16720 to 41676cf

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

2 participants