![]() |
|
|
#12 |
|
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
160658 Posts |
Well since no one has found anything wrong (so far), I went ahead and wrote an implementation. It's written to read Msieve matrix files and write Msieve dependency files.
As such, I have not tested it yet, though once I get compiled an Msieve that stops QS before Lanczos, I'll try it and see what happens. It does at least compile with the following warnings: Code:
~/bin/c∰∂ gcc -o linsolv -O3 randlinsolv.c -Wall In file included from randlinsolv.c:4:0: util.h: In function ‘read_clock’: util.h:230:2: warning: implicit declaration of function ‘gettimeofday’ randlinsolv.c: In function ‘read_matrix’: randlinsolv.c:146:2: warning: function returns address of local variable randlinsolv.c: In function ‘vector_init’: randlinsolv.c:167:2: warning: function returns address of local variable randlinsolv.c: In function ‘set_init’: randlinsolv.c:179:2: warning: function returns address of local variable randlinsolv.c: In function ‘read_matrix’: randlinsolv.c:81:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result randlinsolv.c:82:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result randlinsolv.c:83:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result randlinsolv.c:94:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result randlinsolv.c:101:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result randlinsolv.c:114:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result randlinsolv.c:128:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result randlinsolv.c: In function ‘get_random_seeds’: util.h:245:16: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result util.h:246:23: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result The util.h file is almost the same as the one in the Msieve repository, except I included read_clock() from util.c and get_random_seeds() from demo.c. It could really use some looking-at by experienced programmers, both to verify the math and to catch silly mistakes. (I tried to include <stdio.c> and open files in 'rb' mode.) In particular, jasonp, could you look at the I/O code and see if it jibes with the Msieve file formats? I'm pretty sure it's right, but then... |
|
|
|
|
|
#13 | |
|
Tribal Bullet
Oct 2004
3,541 Posts |
Quote:
You can make up a random problem of size 1000, where each column contains nonzeros drawn from a distribution mimicking the distribution of primes, or you can modify functions near the bottom of common/lanczos/lanczos_io.c to read and write matrices. An O(n^3) algorithm will have difficulty even with sparse matrices of that size. Last fiddled with by jasonp on 2012-08-21 at 16:54 Reason: remove irrelevant comment |
|
|
|
|
|
|
#14 | ||
|
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3×29×83 Posts |
Quote:
Code:
~/yafu∰∂ linsolv nfs.dat.mat nfs.dep Welcome to derptown! Attempting to read matrix from nfs.dat.mat Matrix is 256941 x 257124 with 83 dense rows Calloc 1 Calloc 3 Matrix is 256941 x 257124 with 83 dense rows Estimated memory for the initial set is 832707 MB (N is 103620972, words per vector is 8036) ^C Quote:
Last fiddled with by Dubslow on 2012-08-21 at 16:50 |
||
|
|
|
|
|
#15 |
|
Tribal Bullet
Oct 2004
1101110101012 Posts |
Gauss elimination is O(n^3) for a dense matrix. For sparse matrices BL and BW perform O(n) matrix-vector products, each of which has complexity O(kn) for k nonzeros per matrix column. If the matrix is dense the runtime is the same as GE, but for sparse matrices this is a real savings, and the block versions of the algorithms reduce the number of matrix multiplies to O(n/B) for block size B.
Regarding making up your own problems, is it less work to hack something simple together of your own, or to take a huge collection of somebody else's stuff and make it do something it wasn't designed to do? I have to answer that question almost every day, so it's good practice for you to grapple with it. Last fiddled with by jasonp on 2012-08-21 at 16:54 |
|
|
|
|
|
#16 |
|
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
11100001101012 Posts |
I am so talented.
I managed to get an all-integer program to throw a floating point exception. (And this after reducing N to n/2 to keep the memory under control.)Code:
linsolv nfs.dat.mat nfs.dep Welcome to derptown! Attempting to read matrix from nfs.dat.mat Matrix is 256941 x 257124 with 83 dense rows Calloc 1 Calloc 3 Matrix is 256941 x 257124 with 83 dense rows Estimated memory for the initial set is 4132 MB (N is 128562, words per vector is 8036) Initial set constructed Doing the 0th dense row... Doing the 1th dense row... Floating point exception |
|
|
|
|
|
#17 | |
|
Bamboozled!
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across
10,753 Posts |
Quote:
Paul |
|
|
|
|
|
|
#18 | ||
|
"Gang aft agley"
Sep 2002
2×1,877 Posts |
Here is an implementation: A Randomized Algorithm for Linear Equations over Prime Fields in Clojure
Wikipedia had a page up but: Quote:
Quote:
|
||
|
|
|
|
|
#19 |
|
Jul 2012
Paris, France.
1438 Posts |
I saw this abacus adventure in a movie. Feynman is one of my heroes. He can play bongos for me in the future and I can do his math while moving my top and bottom, strange beauty and charm up and down.
Math is funny stuff. I am called a polymath. I wonder if I even like math. The shapes and numbers do like me. Here is what I think and want to prove. Hens seem to be able to count. Does anyone know how or where to apply for some grant money. It shouldn't be expensive. I think today all the nano-tech is available to conclude. Ducks suck at linear equations. |
|
|
|
|
|
#20 |
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
100101000001012 Posts |
The difference between a math and a polymath could be as large as the difference between a mouse and a titmouse.
|
|
|
|
|
|
#21 |
|
∂2ω=0
Sep 2002
República de California
103×113 Posts |
But it is said that they are "quack aerodynamicists".
...Or that betwixt a nuthatch and a booby hatch. |
|
|
|
|
|
#22 | |
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
36×13 Posts |
Quote:
-- each of the birds' images was flashed at 5 frames per second. Surely not for the people with neurological afflictions!! |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Solving systems of equations modulo n | carpetpool | carpetpool | 2 | 2017-02-05 20:40 |
| SIQS - problem with solving linear algebra | Dome | Factoring | 14 | 2015-03-06 17:59 |
| Solving linear systems faster than ever... | WraithX | Math | 2 | 2010-10-23 21:27 |
| Solving linear systems modulo n | drido | Math | 3 | 2008-02-08 15:06 |
| Mathematica question-solving systems | Zeta-Flux | Math | 6 | 2005-09-22 21:47 |