Portál AbcLinuxu, 12. května 2025 05:13
Ale nic co jsem zkousel takova cisla nezvladalo, potrebuji aby ten algoritmus byl rozumne rychly, abych na vysledek nemusel cekat hodinu.Hodinu? Řekl bych, že kdybys zvládl faktorizaci za hodinu, byl bys king.
\exp\left( \left(\sqrt[3]{\frac{64}{9}} + o(1)\right)(\log n)^{\frac{1}{3}}(\log \log n)^{\frac{2}{3}}\right) =L_n\left[\frac{1}{3},\sqrt[3]{\frac{64}{9}}\right]
(v TeXovém zápisu) nebo převedeno jako obrázek a jinak zdroj je WolframMathWorld Je tam trochu více logaritmů.
256 bits is a little over 80 digits. Msieve can do factorizations that size in about 20-25 minutesA čo je msieve? Projekt na sourceforge
Msieve is a C library implementing a suite of algorithms to factor large integers. It contains an implementation of the SIQS and GNFS algorithms
make x86_64
⋮
ar r libmsieve.a common/filter/clique.o common/filter/filter.o common/filter/merge.o common/filter/merge_post.o common/filter/merge_pre.o common/filter/merge_util.o common/filter/singleton.o common/lanczos/lanczos.o common/lanczos/lanczos_io.o common/lanczos/lanczos_matmul0.o common/lanczos/lanczos_matmul1.o common/lanczos/lanczos_matmul2.o common/lanczos/lanczos_pre.o common/lanczos/lanczos_vv.o common/lanczos/matmul_util.o common/smallfact/gmp_ecm.o common/smallfact/smallfact.o common/smallfact/squfof.o common/smallfact/tinyqs.o common/batch_factor.o common/cuda_xface.o common/dickman.o common/driver.o common/expr_eval.o common/hashtable.o common/integrate.o common/minimize.o common/minimize_global.o common/mp.o common/polyroot.o common/prime_delta.o common/prime_sieve.o common/savefile.o common/strtoll.o common/util.o mpqs/gf2.qo mpqs/mpqs.qo mpqs/poly.qo mpqs/relation.qo mpqs/sieve.qo mpqs/sqrt.qo \
mpqs/sieve_core_generic_32k.qo mpqs/sieve_core_generic_64k.qo mpqs/sieve_core_p4_64_64k.qo mpqs/sieve_core_core_64_32k.qo mpqs/sieve_core_k8_64_64k.qo \
gnfs/poly/poly.no gnfs/poly/poly_skew.no gnfs/poly/polyutil.no gnfs/poly/root_score.no gnfs/poly/size_score.no gnfs/poly/stage1/stage1.no gnfs/poly/stage1/stage1_roots.no gnfs/poly/stage2/optimize.no gnfs/poly/stage2/optimize_deg6.no gnfs/poly/stage2/root_sieve.no gnfs/poly/stage2/root_sieve_deg45_x.no gnfs/poly/stage2/root_sieve_deg5_xy.no gnfs/poly/stage2/root_sieve_deg6_x.no gnfs/poly/stage2/root_sieve_deg6_xy.no gnfs/poly/stage2/root_sieve_deg6_xyz.no gnfs/poly/stage2/root_sieve_line.no gnfs/poly/stage2/root_sieve_util.no gnfs/poly/stage2/stage2.no gnfs/filter/duplicate.no gnfs/filter/filter.no gnfs/filter/singleton.no gnfs/sieve/sieve_line.no gnfs/sieve/sieve_util.no gnfs/sqrt/sqrt.no gnfs/sqrt/sqrt_a.no gnfs/fb.no gnfs/ffpoly.no gnfs/gf2.no gnfs/gnfs.no gnfs/relation.no gnfs/poly/stage1/stage1_sieve_cpu.no gnfs/poly/stage1/stage1_sieve_cpu.no
ranlib libmsieve.a
⋮
Takze po buildu z toho vyleze staticka knihonva libmsieve.a
, kterou staci prilinkovat (se spravne nastavenymi cestami k hlavickovym souborum). Viz napriklad build toho dema:
gcc -D_FILE_OFFSET_BITS=64 -O3 -fomit-frame-pointer -march=k8 -DNDEBUG -D_LARGEFILE64_SOURCE -Wall -W -DMSIEVE_SVN_VERSION="\"exported\"" -I. -Iinclude -Ignfs -Ignfs/poly -Ignfs/poly/stage1 demo.c -o msieve \
libmsieve.a -lz -lgmp -lm -lpthread
Using Msieve
------------
Just to be confusing, there are two things that I call 'Msieve' interchangeably.
The source distribution builds a self-contained static library 'libmsieve.a',
that actually performs factorizations, and also builds a 'msieve' demo
application that uses the library. The library has a very lightweight inter-
face defined in msieve.h, and can be used in other applications. While the
demo application is (slightly) multithreaded, most the library is single-
threaded and all of its state is passed in. The linear algebra code used
in the quadratic- and number field sieve is multithread aware, and the
entire library is supposed to be multithread-safe.
Takze bych to videl, ze je asi nejlepsi se podivat na demo.c
a inspirovat se (se 600 radky kodu by to nemusel byt problem).
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.