📄 readme.c
字号:
printf("Usage: slv(). This finds the shortest vectors in the lattice\n");
printf("spanned by the LI family b[1],...,b[m]. \n");
printf("It applies Fincke-Pohst to examine all nonzero X in L\n");
printf("satisfying ||X||^2<=C=||b[1]||^2. If it finds an X\n");
printf("shorter than b[1], the new bound C=||X||^2 is chosen.\n");
printf("At the end, Fincke-Pohst has only the shortest vectors to enumerate.\n");
printf("Only the vectors with highest positive coefficient of b[i] are given.\n");
printf("The output is sent to slv.out. \n");
printf("It is suggested that the input matrix is LLL reduced.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, lcm_str) == 0)
{
printf(" **************************\n");
printf("lcm: usage: z=lcm(x,y) \n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, lcma_str) == 0)
{
printf(" **************************\n");
printf("lcma: usage: z=lcma(a[]) \n");
printf("z=lcm(a[0],...,a[n-1]) (n is size of array.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, length_str) == 0)
{
printf(" **************************\n");
printf("length: usage: z=length(n)\n");
printf("z is the number of decimal digits of n.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, pollard_str) == 0)
{
printf(" **************************\n");
printf("pollard: usage: z=pollard(x) \n");
printf("This attempts to return a factor of a composite x\n");
printf("using Pollard's p-1 method.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, nprime_str) == 0)
{
printf(" **************************\n");
printf("nprime: usage: z=nprime(x)\n");
printf("This finds the first integer after x which passes the\n");
printf("strong base 2 pseudoprime test and the Lucas pseudoprime test.\n");
printf("This integer is likely to be prime.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, nprimeap_str) == 0)
{
printf(" **************************\n");
printf("nprimeap: usage: z=nprimeap(a,b,m)\n");
printf("This finds the first p, p=b(mod a), m <= p,\n");
printf("which passes the strong base 2 pseudoprime test\n");
printf("and the Lucas pseudoprime test. \n");
printf("Here a must be even, b odd, 1 <= b < a, gcd(a,b)=1, b <= m. \n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, jacobi_str) == 0)
{
printf(" **************************\n");
printf("jacobi: usage: z=jacobi(x,y)\n");
printf("z is the value of the Jacobi symbol (x/y).\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, peralta_str) == 0)
{
printf(" **************************\n");
printf("peralta: usage: z=peralta(a,p)\n");
printf("Peralta's algorithm is used to return a square root z of a (mod p).\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, cong_str) == 0)
{
printf(" **************************\n");
printf("congr: usage: x=congr(a,b,m,&n)\n");
printf("Returns the solution x of the congruence ax=b(mod m).\n");
printf("Also n=m/gcd(a,m) is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, chinese_str) == 0)
{
printf(" **************************\n");
printf("chinese: usage: x=chinese(a,b,m,n,&l)\n");
printf("Returns the solution x(mod l) of the system of congruences\n");
printf("x=a(mod m) and x=b(mod n).\n");
printf("Also l=lcm(m,n) is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, chinesea_str) == 0)
{
printf(" **************************\n");
printf("chinesea: usage: x=chinesea(a[],m[],&l)\n");
printf("Returns the solution x(mod l) of the system of congruences\n");
printf("x=a[i](mod m[i]), 0<= i<n. (n = smaller of two array sizes)\n");
printf("Also l=lcm(m[0],...,m[n-1]) is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, mthroot_str) == 0)
{
printf(" **************************\n");
printf("mthroot: usage: z=mthroot(x,m)\n");
printf("The integer part of the m-th root of x is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, mthrootr_str) == 0)
{
printf(" **************************\n");
printf("mthrootr: usage: mthrootr(x,y,m,r)\n");
printf("The m-th root of x/y is computed to r decimal places.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, fund_str) == 0)
{
printf(" **************************\n");
printf("fund: usage: z=fund(d,&x,&y)\n");
printf("x+y*omega is the fundamental unit of Q(sqrt{d}).\n");
printf("z=Norm(x+y*omega) is also returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, pell_str) == 0)
{
printf(" **************************\n");
printf("pell: usage: z=pell(d,e,&x,&y)\n");
printf("The continued fraction expansion of sqrt{d}\n");
printf("is periodic after the first term:\n");
printf("a[0],a[1],...,a[n-1],2a[0],a[1],...,a[n-1],2a[0],....\n");
printf("Also the section a[1],...,a[n-1] is palindromic.\n");
printf("We print a[0] and half the palindrome iff e is nonzero,\n");
printf("sending the output to a file called pell.out.\n");
printf("The least solution x and y of Pell's equation\n");
printf("x^2-dy^2=epsilon is returned, where epsilon=1 or -1.\n");
printf("z=epsilon is also returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, surd_str) == 0)
{
printf(" **************************\n");
printf("surd: usage: z=surd(d,t,u,v,&a[],&u[],&v[],&p[],&q[])\n");
printf("The continued fraction of (u+t*sqrt{d})/v\n");
printf("is determined up to the end of the period.\n");
printf("a[i] is the ith partial quotient.\n");
printf("u[i]+sqrt(d))/v[i] is the ith complete convergent.\n");
printf("p[i]/q[i] is the ith convergent.\n");
printf("The period length z is returned\n");
printf("Output is sent to file surd.out.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, mpower_str) == 0)
{
printf(" **************************\n");
printf("mpower: usage: z=mpower(a,b,c)\n");
printf("z=a^b(mod c) is returned.\n");
printf("a,b,c integers, b>=0,c>0.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, inv_str) == 0)
{
printf(" **************************\n");
printf("inv: usage: z=inv(a,m)\n");
printf("z=a^{-1}(mod m) is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, elliptic_str) == 0)
{
printf(" **************************\n");
printf("elliptic: usage: z=elliptic(n,m,p)\n");
printf("The elliptic curve method is used to try to find\n");
printf("a factor z of a composite number n.\n");
printf("Here 1 <= p < 2^32 and 10 < m < 1279.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, factor_str) == 0)
{
printf(" **************************\n");
printf("factor: usage: z=factor(n)\n");
printf("The factorization of n is performed using the\n");
printf("multiple polynomial quadratic sieve if length(n) <= 55;\n");
printf("otherwise the elliptic curve method is used.\n");
printf("z=omega(n), the number of distinct prime factors of n.\n");
printf("One can nominate the number of elliptic curves to be used.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, tau_str) == 0)
{
printf(" **************************\n");
printf("tau: usage: z=tau(n)\n");
printf("The divisor function z=tau(n) is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, sigma_str) == 0)
{
printf(" **************************\n");
printf("sigma: usage: z=sigma(n)\n");
printf("z=sigma(n), the sum of the divisors of n, is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, mobius_str) == 0)
{
printf(" **************************\n");
printf("mobius: usage: z=mobius(n)\n");
printf("The Moebius function z=mu(n) is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, euler_str) == 0)
{
printf(" **************************\n");
printf("euler: usage: z=euler(n)\n");
printf("Euler's function z=phi(n) is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, lprimroot_str) == 0)
{
printf(" **************************\n");
printf("lprimroot: usage: z=lprimroot(n)\n");
printf("The least primitive root mod p, an odd prime, is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, orderm_str) == 0)
{
printf(" **************************\n");
printf("orderm: usage: z=orderm(a,n)\n");
printf("The order of a(mod n) is returned.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, lucas_str) == 0)
{
printf(" **************************\n");
printf("lucas: usage: z=lucas(n)\n");
printf("n is subjected to a strong pseudoprime test to base 2,\n");
printf("together with a Lucas pseudoprime test.\n");
printf("If z=0 is returned, n is composite;\n");
printf("if z=1 is returned, n is a Lucas probable prime,\n");
printf("as well as a base 2 strong pseudoprime.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, serret_str) == 0)
{
printf(" **************************\n");
printf("serret: usage: serret(p,&x,&y)\n");
printf("Here p is a prime of the form 4n+1.\n");
printf("Serret's algorithm finds integers x and y such that p=x^2+y^2. \n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, collatz_str) == 0)
{
printf(" **************************\n");
printf("collatz: usage: collatz(x, n)\n");
printf("Collatz' 3x+1 conjecture is tested.\n");
printf("The iterates x,T(x),.. are printed iff n is nonzero.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, cycle_str) == 0)
{
printf(" **************************\n");
printf("cycle: usage cycle()\n");
printf("Tries to find all cycles for the generalised Collatz mapping T,\n");
printf("which arise from starting numbers p, |p|<= RANGE/2.\n");
printf("Trajectories containing an iterate whose magnitude\n");
printf("exceeds a prescribed value INFINITY are deemed non-cycling.\n");
printf("T(x)=int(m[i]*x/d)+X[i] if x=i (mod d).\n");
printf("The d nonzero moduli m[i] and d shifts X[i] are entered from the keyboard.\n");
printf("(See http://www.numbertheory.org/pdfs/survey.pdf)\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, miller_str) == 0)
{
printf(" **************************\n");
printf("miller: usage: miller(m,b)\n");
printf("Here m>1,b>1 and m does not divide b.\n");
printf("Miller's test to base b is applied to m.\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, hermite_str) == 0)
{
printf(" **************************\n");
printf("hermite: usage: hermite()\n");
printf("The Hermite normal form HNF(A) of an integer matrix A\n");
printf("is found using the Kannan-Bachem algorithm.\n");
printf("A can be entered either from the keyboard or from a file\n");
printf("such as \n");
printf(" 2 3\n");
printf(" 1 -4 5\n");
printf(" 3 2 1\n");
printf("in the case of a 2 x 3 matrix.\n");
printf("The hermite normal form is sent to a file called hermite.out.\n");
printf("A unimodular integer matrix P such that PA = HNF(A) is sent to hermitep.out, if desired.\n");
printf("The last line of this file contains the value of rank(A).\n");
printf(" **************************\n");
GetReturn();
}
else if (strcmp(name, improvep_str) == 0)
{
printf(" **************************\n");
printf("improvep: usage: improvep()\n");
printf("The unimodular matrix contained in the file hermitep.out is improved\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -