mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Msieve

Reply
 
Thread Tools
Old 2010-08-16, 11:57   #1
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

746010 Posts
Exclamation CWI format --> GGNFS format

Quote:
Originally Posted by tgrdy View Post

<snip>
Will someone please give a URL where the conversion code may be found
for converting CWI relations --> GGNFS/msieve relations?
R.D. Silverman is offline   Reply With Quote
Old 2010-08-16, 12:12   #2
smh
 
smh's Avatar
 
"Sander"
Oct 2002
52.345322,5.52471

29·41 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Will someone please give a URL where the conversion code may be found
for converting CWI relations --> GGNFS/msieve relations?
Try http://tech.groups.yahoo.com/group/ggnfs/message/843

Oops, thats the other way around

Last fiddled with by smh on 2010-08-16 at 12:19 Reason: Oops
smh is offline   Reply With Quote
Old 2010-08-16, 12:25   #3
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

B5816 Posts
Default

Try here.
kar_bon is offline   Reply With Quote
Old 2010-08-16, 12:30   #4
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3,541 Posts
Default

See attached. My web page has similar code, but it is years old and is out of sync with the msieve library. If you need to build from the source, then you will need the msieve source, particularly the include directory, and a precompiled msieve library available. Building the latter also requires GMP or MPIR, so it's not completely straightforward. Without GMP or MPIR, you'll have to paste in the library code that the converter depends on, which is scattered all over the library.

This converter basically reads in an msieve-format factor base file, builds the corresponding factor base, reads CWI format relations and trial divides to find any factors that are not present in the CWI output. The default trial division bound is pretty conservative; to change it you can add 'FRMAX X' and 'FAMAX Y' to the msieve factor base file to set the rational and algebraic factor base limits to X and Y respectively.

It can also be made *much* more efficient. Finally, the converter assumes the rational poly is CWI poly 0 and the algebraic poly is CWI poly 1.
Attached Files
File Type: zip cwi2gg.zip (2.8 KB, 121 views)

Last fiddled with by jasonp on 2010-08-16 at 13:25 Reason: fix links
jasonp is offline   Reply With Quote
Old 2010-08-16, 14:01   #5
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

11101001001002 Posts
Default

Quote:
Originally Posted by jasonp View Post
See attached. My web page has similar code, but it is years old and is out of sync with the msieve library. If you need to build from the source, then you will need the msieve source, particularly the include directory, and a precompiled msieve library available. Building the latter also requires GMP or MPIR, so it's not completely straightforward. Without GMP or MPIR, you'll have to paste in the library code that the converter depends on, which is scattered all over the library.

This converter basically reads in an msieve-format factor base file, builds the corresponding factor base, reads CWI format relations and trial divides to find any factors that are not present in the CWI output. The default trial division bound is pretty conservative; to change it you can add 'FRMAX X' and 'FAMAX Y' to the msieve factor base file to set the rational and algebraic factor base limits to X and Y respectively.

It can also be made *much* more efficient. Finally, the converter assumes the rational poly is CWI poly 0 and the algebraic poly is CWI poly 1.
It may be easier for me to just write my own converter. Let me
summarize what I know about the format:

"
a,b:rational side factors:algebraic side factors

a,b in decimal. factors in hex (case insensitive), comma separated. you may leave out small factors < 1000. "

I assume that the colons are part of the output. I also assume that a
count of the number of factors is not needed. Is this correct? msieve
just reads the inputs until it encounters a colon? How does it know
when it hits the end of a line? i.e. if I have

a,b:r11, r12, r13:s11, s12, s13, s14
a,b:r21, r22:s21, s22

How does it know that the second a,b pair are not algebraic factors
from the previous relation? I assume it uses <lf> or <cr> as a line
terminator. However, I need to know which, since Unix and Windows
use different terminators.

Or do the algebraic factors also end in a colon?


After conversion, does msieve require a *single* input file with all of
the relations? Can one do 'type *.dat | msieve ....options" if one
has multiple input files?

Does msieve kick out an output file consisting of the combined relations
that come out of the filtering process? I assume that it kicks out a matrix
file for restart in case the LA gets interrupted?
R.D. Silverman is offline   Reply With Quote
Old 2010-08-16, 14:05   #6
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22×5×373 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
It may be easier for me to just write my own converter. Let me
summarize what I know about the format:

"
a,b:rational side factors:algebraic side factors

a,b in decimal. factors in hex (case insensitive), comma separated. you may leave out small factors < 1000. "

I assume that the colons are part of the output. I also assume that a
count of the number of factors is not needed. Is this correct? msieve
just reads the inputs until it encounters a colon? How does it know
when it hits the end of a line? i.e. if I have

a,b:r11, r12, r13:s11, s12, s13, s14
a,b:r21, r22:s21, s22

How does it know that the second a,b pair are not algebraic factors
from the previous relation? I assume it uses <lf> or <cr> as a line
terminator. However, I need to know which, since Unix and Windows
use different terminators.

Or do the algebraic factors also end in a colon?


After conversion, does msieve require a *single* input file with all of
the relations? Can one do 'type *.dat | msieve ....options" if one
has multiple input files?

Does msieve kick out an output file consisting of the combined relations
that come out of the filtering process? I assume that it kicks out a matrix
file for restart in case the LA gets interrupted?

I just tried running the converter. Apparently it requires worktodo.ini?
What else might it require?
R.D. Silverman is offline   Reply With Quote
Old 2010-08-16, 14:18   #7
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
I just tried running the converter. Apparently it requires worktodo.ini?
What else might it require?
I tried 'cwi2gg -c myinputfile' and it also demanded worktodo.ini;

I would assume that the converter needs to know N and the
polynomial coefficients as well as the factor base limits. However,
AFAIK, this information is in msieve.dat, and not 'worktodo.ini'.

The source that I have is quite dated. --> 1.35

Have the input files/formats changed?
R.D. Silverman is offline   Reply With Quote
Old 2010-08-16, 14:39   #8
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

1D2416 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
I tried 'cwi2gg -c myinputfile' and it also demanded worktodo.ini;

I would assume that the converter needs to know N and the
polynomial coefficients as well as the factor base limits. However,
AFAIK, this information is in msieve.dat, and not 'worktodo.ini'.

The source that I have is quite dated. --> 1.35

Have the input files/formats changed?
I tried creating a worktodo.ini for 2,2166L. The converter
reports: "Error reading NFS polynomials".

(1) Are the coefficients entered left-to-right or right to left? e.g.

Is

R0: 1
R1: -97

equal to 'x -97' or is it '97x - 1'???

Here is my worktodo file: (named msieve.fb)

N:739667156236337946134056937343993499754458397410514879535265138262937772306734758373439043967382639142033110187422219711601230265487881771913909253605105149612106401456200979809373176041694206587071429
skew: 1.0
R0: 1
R1: -1532495540865888858358347027150309183618739122183602176
A0: 4
A1: -4
A2: 2
A3: -2
A4: 1


The algebraic polynomial is 4x^4 -4x^3+2x^2-2x+1, the rational is
x - 1532495540865888858358347027150309183618739122183602176

Do I need to reverse the coefficients? What syntax error is present?

I tried:

cwi2gg -i msieve.fb -c myfile and got the above error.
R.D. Silverman is offline   Reply With Quote
Old 2010-08-16, 15:13   #9
Andi47
 
Andi47's Avatar
 
Oct 2004
Austria

2×17×73 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
I tried creating a worktodo.ini for 2,2166L. The converter
reports: "Error reading NFS polynomials".

(1) Are the coefficients entered left-to-right or right to left? e.g.

Is

R0: 1
R1: -97

equal to 'x -97' or is it '97x - 1'???

Here is my worktodo file: (named msieve.fb)

Code:
N:739667156236337946134056937343993499754458397410514879535265138262937772306734758373439043967382639142033110187422219711601230265487881771913909253605105149612106401456200979809373176041694206587071429
skew: 1.0
R0: 1
R1: -1532495540865888858358347027150309183618739122183602176
A0: 4
A1: -4
A2: 2
A3: -2
A4: 1
The algebraic polynomial is 4x^4 -4x^3+2x^2-2x+1, the rational is
x - 1532495540865888858358347027150309183618739122183602176

Do I need to reverse the coefficients? What syntax error is present?

I tried:

cwi2gg -i msieve.fb -c myfile and got the above error.
IIRC, it should be:

Code:
N: 739667156236337946134056937343993499754458397410514879535265138262937772306734758373439043967382639142033110187422219711601230265487881771913909253605105149612106401456200979809373176041694206587071429
skew: 1.0
R1: 1
R0: -1532495540865888858358347027150309183618739122183602176
A4: 4
A3: -4
A2: 2
A1: -2
A0: 1
so e.g. A3: -4 means -4x^3

You also had no "blank" character between "N:" and your number.
Andi47 is offline   Reply With Quote
Old 2010-08-16, 15:23   #10
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22×5×373 Posts
Default

Quote:
Originally Posted by Andi47 View Post
IIRC, it should be:

Code:
N: 739667156236337946134056937343993499754458397410514879535265138262937772306734758373439043967382639142033110187422219711601230265487881771913909253605105149612106401456200979809373176041694206587071429
skew: 1.0
R1: 1
R0: -1532495540865888858358347027150309183618739122183602176
A4: 4
A3: -4
A2: 2
A1: -2
A0: 1


so e.g. A3: -4 means -4x^3

You also had no "blank" character between "N:" and your number.
My actual input file did have a space after N:

I tried putting the coefficients in reverse order as you suggested
(R1, then R0; A4 ....A0) My input file looks exactly like the one above.

I still get the error. Could it be a <lf, cr> vs <lf> issue? I am running
on Windoze.
R.D. Silverman is offline   Reply With Quote
Old 2010-08-16, 15:33   #11
Andi47
 
Andi47's Avatar
 
Oct 2004
Austria

2·17·73 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
My actual input file did have a space after N:

I tried putting the coefficients in reverse order as you suggested
(R1, then R0; A4 ....A0) My input file looks exactly like the one above.

I still get the error. Could it be a <lf, cr> vs <lf> issue? I am running
on Windoze.
Possible (I also had this issue when transferring between windoze and linux). If you created your input with the windows text editor or with winword, you should be OK with <lf, cr> vs. <lf>.

And oops, I just see a second issue:

1.) Omit all colons
2.) write "SKEW" in all capital letters.

Example: This msieve.fb file worked for me for 2,955+:

Code:
N 164774131143428541455977103890576592781521529987726208400577622823278351072892612844473159928877431421021266080477846336219461802989069886599201120900081
SKEW 4707069.76
R0 -255911427676165480127248839980
R1  246484920163953683
A0 -10081097995700425772496616464526287093
A1  100178560246089231180102467546016
A2 -21818714478295129385422733
A3 -19222762440923505056
A4  745151166906
A5  150120
Andi47 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting CWI format to ggnfs format xilman Msieve 2 2015-11-27 09:54
worktodo.ini format S485122 PrimeNet 5 2008-11-03 14:54
Date format Mini-Geek Lounge 21 2007-03-17 01:36
Meaning and format of Phi, GF roger Miscellaneous Math 9 2007-01-21 06:33
What is the format of worktodo.ini for a^n+/-b^n jasong Factoring 1 2006-04-18 02:11

All times are UTC. The time now is 00:52.


Sat Jul 17 00:52:19 UTC 2021 up 49 days, 22:39, 1 user, load averages: 1.38, 1.48, 1.41

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.