@@ -46,18 +46,19 @@ def report_ZZ():
46
46
"""
47
47
F = [vecmat_ZZ , rank_ZZ , rank2_ZZ , charpoly_ZZ , smithform_ZZ ,
48
48
det_ZZ , det_QQ , matrix_multiply_ZZ , matrix_add_ZZ ,
49
+ matrix_add_ZZ_2 ,
49
50
nullspace_ZZ ]
50
51
51
52
title = 'Dense benchmarks over ZZ'
52
53
report (F , title )
53
54
54
55
# Integer Nullspace
55
56
56
- def nullspace_ZZ (n = 300 , min = 0 , max = 2 ** 16 , system = 'sage' ):
57
+ def nullspace_ZZ (n = 400 , min = 0 , max = 2 ** 32 , system = 'sage' ):
57
58
"""
58
59
Nullspace over ZZ:
59
- Given a n+1 x n (with n=300 ) matrix over ZZ with random entries
60
- with 16 bits, compute the nullspace.
60
+ Given a n+1 x n (with n=400 ) matrix over ZZ with random entries
61
+ with 32 bits, compute the nullspace.
61
62
"""
62
63
if system == 'sage' :
63
64
A = random_matrix (ZZ , n + 1 , n , x = min , y = max + 1 ).change_ring (QQ )
@@ -79,10 +80,10 @@ def nullspace_ZZ(n=300, min=0, max=2**16, system='sage'):
79
80
raise ValueError , 'unknown system "%s"' % system
80
81
81
82
82
- def charpoly_ZZ (n = 100 , min = 0 , max = 9 , system = 'sage' ):
83
+ def charpoly_ZZ (n = 300 , min = 0 , max = 9 , system = 'sage' ):
83
84
"""
84
85
Characteristic polynomial over ZZ:
85
- Given a n x n (with n=100 ) matrix over ZZ with random entries
86
+ Given a n x n (with n=300 ) matrix over ZZ with random entries
86
87
between min=0 and max=9, compute the charpoly.
87
88
"""
88
89
if system == 'sage' :
@@ -105,10 +106,10 @@ def charpoly_ZZ(n=100, min=0, max=9, system='sage'):
105
106
raise ValueError , 'unknown system "%s"' % system
106
107
107
108
108
- def rank_ZZ (n = 500 , min = 0 , max = 9 , system = 'sage' ):
109
+ def rank_ZZ (n = 700 , min = 0 , max = 9 , system = 'sage' ):
109
110
"""
110
111
Rank over ZZ:
111
- Given a n x (n+10) (with n=500 ) matrix over ZZ with random entries
112
+ Given a n x (n+10) (with n=700 ) matrix over ZZ with random entries
112
113
between min=0 and max=9, compute the rank.
113
114
"""
114
115
if system == 'sage' :
@@ -130,10 +131,10 @@ def rank_ZZ(n=500, min=0, max=9, system='sage'):
130
131
else :
131
132
raise ValueError , 'unknown system "%s"' % system
132
133
133
- def rank2_ZZ (n = 200 , min = 0 , max = 2 ** 64 , system = 'sage' ):
134
+ def rank2_ZZ (n = 400 , min = 0 , max = 2 ** 64 , system = 'sage' ):
134
135
"""
135
136
Rank 2 over ZZ:
136
- Given a (n + 10) x n (with n=200 ) matrix over ZZ with random entries
137
+ Given a (n + 10) x n (with n=400 ) matrix over ZZ with random entries
137
138
between with 64 bits, compute the rank.
138
139
"""
139
140
if system == 'sage' :
@@ -183,10 +184,10 @@ def smithform_ZZ(n=128, min=0, max=9, system='sage'):
183
184
raise ValueError , 'unknown system "%s"' % system
184
185
185
186
186
- def matrix_multiply_ZZ (n = 200 , min = - 9 , max = 9 , system = 'sage' , times = 1 ):
187
+ def matrix_multiply_ZZ (n = 300 , min = - 9 , max = 9 , system = 'sage' , times = 1 ):
187
188
"""
188
189
Matrix multiplication over ZZ
189
- Given an n x n (with n=200 ) matrix A over ZZ with random entries
190
+ Given an n x n (with n=300 ) matrix A over ZZ with random entries
190
191
between min=-9 and max=9, inclusive, compute A * (A+1).
191
192
"""
192
193
if system == 'sage' :
@@ -213,11 +214,11 @@ def matrix_multiply_ZZ(n=200, min=-9, max=9, system='sage', times=1):
213
214
else :
214
215
raise ValueError , 'unknown system "%s"' % system
215
216
216
- def matrix_add_ZZ (n = 500 , min = - 9 , max = 9 , system = 'sage' , times = 10 ):
217
+ def matrix_add_ZZ (n = 500 , min = - 9 , max = 9 , system = 'sage' , times = 50 ):
217
218
"""
218
219
Matrix addition over ZZ
219
220
Given an n x n (with n=500) matrix A and B over ZZ with random entries
220
- between min=-9 and max=9, inclusive, compute A + B.
221
+ between min=-9 and max=9, inclusive, compute A + B 50 times .
221
222
"""
222
223
if system == 'sage' :
223
224
A = random_matrix (ZZ , n , n , x = min , y = max + 1 )
@@ -245,6 +246,14 @@ def matrix_add_ZZ(n=500, min=-9, max=9, system='sage', times=10):
245
246
else :
246
247
raise ValueError , 'unknown system "%s"' % system
247
248
249
+ def matrix_add_ZZ_2 (n = 500 , bits = 16 , system = 'sage' , times = 50 ):
250
+ """
251
+ Matrix addition over ZZ.
252
+ Given an n x n (with n=500) matrix A and B over ZZ with random 16-bit
253
+ entries, compute A + B 50 times.
254
+ """
255
+ b = 2 ** bits
256
+ return matrix_add_ZZ (n = n , min = - b , max = b ,system = system , times = times )
248
257
249
258
def det_ZZ (n = 400 , min = 1 , max = 100 , system = 'sage' ):
250
259
"""
@@ -299,11 +308,11 @@ def det_QQ(n=300, num_bound=10, den_bound=10, system='sage'):
299
308
raise ValueError , 'unknown system "%s"' % system
300
309
301
310
302
- def vecmat_ZZ (n = 500 , system = 'sage' , min = - 9 , max = 9 , times = 200 ):
311
+ def vecmat_ZZ (n = 750 , system = 'sage' , min = - 9 , max = 9 , times = 200 ):
303
312
"""
304
313
Vector matrix multiplication over ZZ.
305
314
306
- Given an n x n (with n=500 ) matrix A over ZZ with random entries
315
+ Given an n x n (with n=750 ) matrix A over ZZ with random entries
307
316
between min=-9 and max=9, inclusive, and v the first row of A,
308
317
compute the product v * A 200 times.
309
318
"""
0 commit comments