mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2019-04-09, 18:01   #1
hansl
 
hansl's Avatar
 
Apr 2019

110011012 Posts
Default Any way to pipe GMP mpz_t into PFGW?

Hi, I've been toying with some C/C++ code on linux that uses GMP library to generate sequences of various large numbers (on the order of ~10kbit each).

I already have written some small utilities which are meant to be piped together, which filter out via trial division for example, and just read and write raw mpz data. The code for a filter utility looks more or less like this:
Code:
int main() {
  mpz_t x; mpz_init(x);
  while (mpz_inp_raw(x, stdin)) {
    if (SatisfiesCondition(x)) mpz_out_raw(stdout, x);
  }
  return 0;
}
I just learned about pfgw and it sounds like it is much more efficient than GMP for these large numbers. So I'm wondering if there is some way I can pipe this raw data into or out of PFGW in a similar way for testing PRP?

I would prefer to not have to convert to intermediate decimal ASCII string if possible.
hansl is offline   Reply With Quote
Old 2019-04-09, 19:06   #2
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

7·23·29 Posts
Default

Perhaps you should look into GWNUM programming. It is the library behind PFGW and LLR. You can include some GWNUM libraries to program with. Some things are quicker with GMP like "jacobi". You can find the GWNUM library with the source of Prime95/mprime.
paulunderwood is offline   Reply With Quote
Old 2019-04-09, 19:12   #3
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

2,377 Posts
Default

You can write your output numbers to a text file and input that file to PFGW. Look in the PFGW folder for ABC file format specs.
a1call is online now   Reply With Quote
Old 2019-04-09, 19:44   #4
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

160728 Posts
Default

You should also look into using a pfgw script file. It can read inputs, do math with them (or manipulate in other ways), then do factoring and PRP testing.
rogue is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
PFGW help lukerichards Software 2 2019-03-18 21:48
PFGW for Windows 98 factorer Software 9 2018-09-18 00:59
PFGW GUI vs CMD houding Software 1 2016-06-20 12:11
PFGW 3.3.6 or PFGW 3.4.2 Please update now! Joe O Sierpinski/Riesel Base 5 5 2010-09-30 14:07

All times are UTC. The time now is 13:35.


Mon Jun 5 13:35:01 UTC 2023 up 291 days, 11:03, 0 users, load averages: 1.34, 1.20, 1.11

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, 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.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔