gmp_lib Methods

GMP Native Interface for .NET

gmp_lib Methods

The gmp_lib type exposes the following members.

Methods
  NameDescription
Public methodStatic memberCode example_mpz_realloc
Change the space for integer to new_alloc limbs.
Public methodStatic memberallocate
Return a pointer to newly allocated space with at least alloc_size bytes.
Public methodStatic memberfree(IntPtr)
Free the unmanaged memory at ptr.
Public methodStatic memberfree(char_ptr)
De-allocate the space pointed to by ptr.
Public methodStatic memberfree(gmp_randstate_t)
De-allocate the space pointed to by ptr.
Public methodStatic memberfree(mp_ptr)
De-allocate the space pointed to by ptrs.
Public methodStatic memberfree(void_ptr)
De-allocate the space pointed to by ptr.
Public methodStatic memberfree(void_ptr, size_t)
De-allocate the space pointed to by ptr.
Public methodStatic memberCode examplegmp_asprintf
Form a null-terminated string in a block of memory obtained from the current memory allocation function.
Public methodStatic memberCode examplegmp_fprintf
Print to the stream fp.
Public methodStatic memberCode examplegmp_fscanf
Read from the stream fp.
Public methodStatic memberCode examplegmp_printf
Print to the standard output stdout.
Public methodStatic membergmp_randclear
Free all memory occupied by state.
Public methodStatic memberCode examplegmp_randinit_default
Initialize state with a default algorithm.
Public methodStatic memberCode examplegmp_randinit_lc_2exp
Initialize state with a linear congruential algorithm X = (aX + c) mod 2^m2exp.
Public methodStatic memberCode examplegmp_randinit_lc_2exp_size
Initialize state for a linear congruential algorithm as per gmp_randinit_lc_2exp.
Public methodStatic memberCode examplegmp_randinit_mt
Initialize state for a Mersenne Twister algorithm.
Public methodStatic memberCode examplegmp_randinit_set
Initialize rop with a copy of the algorithm and state from op.
Public methodStatic memberCode examplegmp_randseed
Set an initial seed value into state.
Public methodStatic memberCode examplegmp_randseed_ui
Set an initial seed value into state.
Public methodStatic memberCode examplegmp_scanf
Read from the standard input stdin.
Public methodStatic memberCode examplegmp_snprintf
Form a null-terminated string in buf.
Public methodStatic memberCode examplegmp_sprintf
Form a null-terminated string in buf.
Public methodStatic memberCode examplegmp_sscanf
Read from a null-terminated string s.
Public methodStatic memberCode examplegmp_urandomb_ui
Generate a uniformly distributed random number of n bits, i.e. in the range 0 to 2^n - 1 inclusive.
Public methodStatic memberCode examplegmp_urandomm_ui
Generate a uniformly distributed random number in the range 0 to n - 1, inclusive.
Public methodStatic memberCode examplegmp_vasprintf
Form a null-terminated string in a block of memory obtained from the current memory allocation function.
Public methodStatic memberCode examplegmp_vfprintf
Print to the stream fp.
Public methodStatic memberCode examplegmp_vfscanf
Read from the stream fp.
Public methodStatic memberCode examplegmp_vprintf
Print to the standard output stdout.
Public methodStatic memberCode examplegmp_vscanf
Read from the standard input stdin.
Public methodStatic memberCode examplegmp_vsnprintf
Form a null-terminated string in buf.
Public methodStatic memberCode examplegmp_vsprintf
Form a null-terminated string in buf.
Public methodStatic memberCode examplegmp_vsscanf
Read from a null-terminated string s.
Public methodStatic memberCode examplemp_get_memory_functions
Get the current allocation functions, storing function pointers to the locations given by the arguments.
Public methodStatic memberCode examplemp_set_memory_functions
Replace the current allocation functions from the arguments.
Public methodStatic memberCode examplempf_abs
Set rop to | op |.
Public methodStatic memberCode examplempf_add
Set rop to op1 + op2.
Public methodStatic memberCode examplempf_add_ui
Set rop to op1 + op2.
Public methodStatic memberCode examplempf_ceil
Set rop to op rounded to the next higher integer.
Public methodStatic memberCode examplempf_clear
Free the space occupied by x.
Public methodStatic memberCode examplempf_clears
Free the space occupied by a NULL-terminated list of mpf_t variables.
Public methodStatic memberCode examplempf_cmp
Compare op1 and op2.
Public methodStatic memberCode examplempf_cmp_d
Compare op1 and op2.
Public methodStatic memberCode examplempf_cmp_si
Compare op1 and op2.
Public methodStatic memberCode examplempf_cmp_ui
Compare op1 and op2.
Public methodStatic memberCode examplempf_cmp_z
Compare op1 and op2.
Public methodStatic memberCode examplempf_div
Set rop to op1 / op2.
Public methodStatic memberCode examplempf_div_2exp
Set rop to op1 / 2^op2.
Public methodStatic memberCode examplempf_div_ui
Set rop to op1 / op2.
Public methodStatic memberCode examplempf_fits_sint_p
Return non-zero if op fits in a 32-bit integer, when truncated to an integer.
Public methodStatic memberCode examplempf_fits_slong_p
Return non-zero if op fits in a 32-bit integer, when truncated to an integer.
Public methodStatic memberCode examplempf_fits_sshort_p
Return non-zero if op fits in a 16-bit integer, when truncated to an integer.
Public methodStatic memberCode examplempf_fits_uint_p
Return non-zero if op fits in an unsigned 32-bit integer, when truncated to an integer.
Public methodStatic memberCode examplempf_fits_ulong_p
Return non-zero if op fits in an unsigned 32-bit integer, when truncated to an integer.
Public methodStatic memberCode examplempf_fits_ushort_p
Return non-zero if op fits in an unsigned 16-bit integer, when truncated to an integer.
Public methodStatic memberCode examplempf_floor
Set rop to op rounded to the next lower integer.
Public methodStatic memberCode examplempf_get_d
Convert op to a double, truncating if necessary (i.e. rounding towards zero).
Public methodStatic memberCode examplempf_get_d_2exp
Convert op to a double, truncating if necessary (i.e. rounding towards zero), and with an exponent returned separately.
Public methodStatic memberCode examplempf_get_default_prec
Return the default precision actually used.
Public methodStatic memberCode examplempf_get_prec
Return the current precision of op, in bits.
Public methodStatic memberCode examplempf_get_si
Convert op to a 32-bit integer, truncating any fraction part.
Public methodStatic memberCode examplempf_get_str(char_ptr, mp_exp_t, Int32, size_t, mpf_t)
Convert op to a string of digits in base base.
Public methodStatic memberCode examplempf_get_str(char_ptr, ptrmp_exp_t, Int32, size_t, mpf_t)
Convert op to a string of digits in base base.
Public methodStatic memberCode examplempf_get_ui
Convert op to an unsigned 32-bit integer, truncating any fraction part.
Public methodStatic memberCode examplempf_init
Initialize x to 0.
Public methodStatic memberCode examplempf_init_set
Initialize rop and set its value from op.
Public methodStatic memberCode examplempf_init_set_d
Initialize rop and set its value from op.
Public methodStatic memberCode examplempf_init_set_si
Initialize rop and set its value from op.
Public methodStatic memberCode examplempf_init_set_str
Initialize rop and set its value from the string in str.
Public methodStatic memberCode examplempf_init_set_ui
Initialize rop and set its value from op.
Public methodStatic memberCode examplempf_init2
Initialize x to 0 and set its precision to be at least prec bits.
Public methodStatic memberCode examplempf_inits
Initialize a NULL-terminated list of mpf_t variables, and set their values to 0.
Public methodStatic memberCode examplempf_inp_str
Read a string in base base from stream, and put the read float in rop.
Public methodStatic memberCode examplempf_integer_p
Return non-zero if op is an integer.
Public methodStatic memberCode examplempf_mul
Set rop to op1 * op2.
Public methodStatic memberCode examplempf_mul_2exp
Set rop to op1 * 2^op2.
Public methodStatic memberCode examplempf_mul_ui
Set rop to op1 * op2.
Public methodStatic memberCode examplempf_neg
Set rop to -op.
Public methodStatic memberCode examplempf_out_str
Print op to stream, as a string of digits.
Public methodStatic memberCode examplempf_pow_ui
Set rop to op1^op2.
Public methodStatic memberCode examplempf_random2
Generate a random float of at most max_size limbs, with long strings of zeros and ones in the binary representation.
Public methodStatic memberCode examplempf_reldiff
Compute the relative difference between op1 and op2 and store the result in rop. This is | op1 - op2 | / op1.
Public methodStatic memberCode examplempf_set
Set the value of rop from op.
Public methodStatic memberCode examplempf_set_d
Set the value of rop from op.
Public methodStatic memberCode examplempf_set_default_prec
Set the default precision to be at least prec bits.
Public methodStatic memberCode examplempf_set_prec
Set the precision of rop to be at least prec bits.
Public methodStatic memberCode examplempf_set_prec_raw
Set the precision of rop to be at least prec bits, without changing the memory allocated.
Public methodStatic memberCode examplempf_set_q
Set the value of rop from op.
Public methodStatic memberCode examplempf_set_si
Set the value of rop from op.
Public methodStatic memberCode examplempf_set_str
Set the value of rop from the string in str.
Public methodStatic memberCode examplempf_set_ui
Set the value of rop from op.
Public methodStatic memberCode examplempf_set_z
Set the value of rop from op.
Public methodStatic memberCode examplempf_sgn
Return +1 if op > 0, 0 if op = 0, and -1 if op < 0.
Public methodStatic memberCode examplempf_size
Return the number of limbs currently in use.
Public methodStatic memberCode examplempf_sqrt
Set rop to the square root of op.
Public methodStatic memberCode examplempf_sqrt_ui
Set rop to the square root of op.
Public methodStatic memberCode examplempf_sub
Set rop to op1 - op2.
Public methodStatic memberCode examplempf_sub_ui
Set rop to op1 - op2.
Public methodStatic memberCode examplempf_swap
Swap rop1 and rop2 efficiently.
Public methodStatic memberCode examplempf_trunc
Set rop to op rounded to the integer towards zero.
Public methodStatic memberCode examplempf_ui_div
Set rop to op1 / op2.
Public methodStatic memberCode examplempf_ui_sub
Set rop to op1 - op2.
Public methodStatic memberCode examplempf_urandomb
Generate a uniformly distributed random float in rop, such that 0 ≤ rop < 1, with nbits significant bits in the mantissa or less if the precision of rop is smaller.
Public methodStatic memberCode examplempn_add
Add {s1p, s1n} and {s2p, s2n}, and write the s1n least significant limbs of the result to rp.
Public methodStatic memberCode examplempn_add_1
Add {s1p, n} and s2limb, and write the n least significant limbs of the result to rp.
Public methodStatic memberCode examplempn_add_n
Add {s1p, n} and {s2p, n}, and write the n least significant limbs of the result to rp.
Public methodStatic memberCode examplempn_addmul_1
Multiply {s1p, n} and s2limb, and add the n least significant limbs of the product to {rp, n} and write the result to rp.
Public methodStatic memberCode examplempn_and_n
Perform the bitwise logical and of {s1p, n} and {s2p, n}, and write the result to {rp, n}.
Public methodStatic memberCode examplempn_andn_n
Perform the bitwise logical and of {s1p, n} and the bitwise complement of {s2p, n}, and write the result to {rp, n}.
Public methodStatic memberCode examplempn_cmp
Compare {s1p, n} and {s2p, n}.
Public methodStatic memberCode examplempn_cnd_add_n
If cnd is non-zero, it produces the same result as a regular mpn_add_n, and if cnd is zero, it copies {s1p, n} to the result area and returns zero.
Public methodStatic memberCode examplempn_cnd_sub_n
If cnd is non-zero, it produces the same result as a regular mpn_sub_n, and if cnd is zero, it copies {s1p, n} to the result area and returns zero.
Public methodStatic memberCode examplempn_cnd_swap
If cnd is non-zero, swaps the contents of the areas {ap, n} and {bp, n}. Otherwise, the areas are left unmodified.
Public methodStatic memberCode examplempn_com
Perform the bitwise complement of {sp, n}, and write the result to {rp, n}.
Public methodStatic memberCode examplempn_copyd
Copy from {s1p, n} to {rp, n}, decreasingly.
Public methodStatic memberCode examplempn_copyi
Copy from {s1p, n} to {rp, n}, increasingly.
Public methodStatic memberCode examplempn_divexact_1
Divide {sp, n} by d, expecting it to divide exactly, and writing the result to {rrp, n}.
Public methodStatic memberCode examplempn_divexact_by3
Divide {sp, n} by 3, expecting it to divide exactly, and writing the result to {rp, n}.
Public methodStatic memberCode examplempn_divexact_by3c
Divide {sp, n} by 3, expecting it to divide exactly, and writing the result to {rp, n}.
Public methodStatic memberCode examplempn_divmod_1
Divide {s2p, s2n} by s3limb, and write the quotient at r1p.
Public methodStatic memberCode examplempn_divrem_1
Divide {s2p, s2n} by s3limb, and write the quotient at r1p.
Public methodStatic memberCode examplempn_gcd
Set {rp, retval} to the greatest common divisor of {xp, xn} and {yp, yn}.
Public methodStatic memberCode examplempn_gcd_1
Return the greatest common divisor of {xp, xn} and ylimb.
Public methodStatic memberCode examplempn_gcdext(mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_ptr, mp_size_t)
Compute the greatest common divisor G of U and V. Compute a cofactor S such that G = US + VT.
Public methodStatic memberCode examplempn_gcdext(mp_ptr, mp_ptr, ptrmp_size_t, mp_ptr, mp_size_t, mp_ptr, mp_size_t)
Compute the greatest common divisor G of U and V. Compute a cofactor S such that G = US + VT.
Public methodStatic memberCode examplempn_get_str
Convert {s1p, s1n} to a raw unsigned char array at str in base base, and return the number of characters produced.
Public methodStatic memberCode examplempn_hamdist
Compute the hamming distance between {s1p, n} and {s2p, n}, which is the number of bit positions where the two operands have different bit values.
Public methodStatic memberCode examplempn_ior_n
Perform the bitwise logical inclusive or of {s1p, n} and {s2p, n}, and write the result to {rp, n}.
Public methodStatic memberCode examplempn_iorn_n
Perform the bitwise logical inclusive or of {s1p, n} and the bitwise complement of {s2p, n}, and write the result to {rp, n}.
Public methodStatic memberCode examplempn_lshift
Shift {sp, n} left by count bits, and write the result to {rp, n}.
Public methodStatic memberCode examplempn_mod_1
Divide {s1p, s1n} by s2limb, and return the remainder.
Public methodStatic memberCode examplempn_mul
Multiply {s1p, s1n} and {s2p, s2n}, and write the (s1n + s2n)-limb result to rp.
Public methodStatic memberCode examplempn_mul_1
Multiply {s1p, n} by s2limb, and write the n least significant limbs of the product to rp.
Public methodStatic memberCode examplempn_mul_n
Multiply {s1p, n} and {s2p, n}, and write the (2 * n)-limb result to rp.
Public methodStatic memberCode examplempn_nand_n
Perform the bitwise logical and of {s1p, n} and {s2p, n}, and write the bitwise complement of the result to {rp, n}.
Public methodStatic memberCode examplempn_neg
Perform the negation of {sp, n}, and write the result to {rp, n}.
Public methodStatic memberCode examplempn_nior_n
Perform the bitwise logical inclusive or of {s1p, n} and {s2p, n}, and write the bitwise complement of the result to {rp, n}.
Public methodStatic memberCode examplempn_perfect_power_p
Return non-zero iff {sp, n} is a perfect power.
Public methodStatic memberCode examplempn_perfect_square_p
Return non-zero iff {s1p, n} is a perfect square.
Public methodStatic memberCode examplempn_popcount
Count the number of set bits in {s1p, n}.
Public methodStatic memberCode examplempn_random
Generate a random number of length r1n and store it at r1p.
Public methodStatic memberCode examplempn_random2
Generate a random number of length r1n and store it at r1p.
Public methodStatic memberCode examplempn_rshift
Shift {sp, n} right by count bits, and write the result to {rp, n}.
Public methodStatic memberCode examplempn_scan0
Scan s1p from bit position bit for the next clear bit.
Public methodStatic memberCode examplempn_scan1
Scan s1p from bit position bit for the next set bit.
Public methodStatic memberCode examplempn_sec_add_1
Set R to A + b, where R = {rp, n}, A = {ap, n}, and b is a single limb.
Public methodStatic membermpn_sec_add_1_itch
Return the scratch space in number of limbs required by the function mpn_sec_add_1.
Public methodStatic memberCode examplempn_sec_div_qr
Set Q to the truncated quotient N / D and R to N modulo D, where N = {np, nn}, D = {dp, dn}, Q’s most significant limb is the function return value and the remaining limbs are {qp, nn - dn}, and R = {np, dn}.
Public methodStatic membermpn_sec_div_qr_itch
Return the scratch space in number of limbs required by the function mpn_sec_div_qr.
Public methodStatic memberCode examplempn_sec_div_r
Set R to N modulo D, where N = {np, nn}, D = {dp, dn}, and R = {np, dn}.
Public methodStatic membermpn_sec_div_r_itch
Return the scratch space in number of limbs required by the function mpn_sec_div_r.
Public methodStatic memberCode examplempn_sec_invert
Set R to the inverse of A modulo M, where R = {rp, n}, A = {ap, n}, and M = {mp, n}. This function’s interface is preliminary.
Public methodStatic membermpn_sec_invert_itch
Return the scratch space in number of limbs required by the function mpn_sec_invert.
Public methodStatic memberCode examplempn_sec_mul
Set R to A * B, where A = {ap, an}, B = {bp, bn}, and R = {rp, an + bn}.
Public methodStatic membermpn_sec_mul_itch
Return the scratch space in number of limbs required by the function mpn_sec_mul.
Public methodStatic memberCode examplempn_sec_powm
Set R to (B^E) modulo M, where R = {rp, n}, M = {mp, n}, and E = {ep, ceil(enb / mp_bits_per_limb)}.
Public methodStatic membermpn_sec_powm_itch
Return the scratch space in number of limbs required by the function mpn_sec_powm.
Public methodStatic memberCode examplempn_sec_sqr
Set R to A^2, where A = {ap, an}, and R = {rp, 2 * an}.
Public methodStatic membermpn_sec_sqr_itch
Return the scratch space in number of limbs required by the function mpn_sec_sqr.
Public methodStatic memberCode examplempn_sec_sub_1
Set R to A - b, where R = {rp, n}, A = {ap, n}, and b is a single limb.
Public methodStatic membermpn_sec_sub_1_itch
Return the scratch space in number of limbs required by the function mpn_sec_sub_1.
Public methodStatic memberCode examplempn_sec_tabselect
Select entry which from table tab, which has nents entries, each n limbs. Store the selected entry at rp.
Public methodStatic memberCode examplempn_set_str
Convert bytes {str, strsize} in the given base to limbs at rp.
Public methodStatic memberCode examplempn_sizeinbase
Return the size of {xp, n} measured in number of digits in the given base.
Public methodStatic memberCode examplempn_sqr
Compute the square of {s1p, n} and write the (2 * n)-limb result to rp.
Public methodStatic memberCode examplempn_sqrtrem
Compute the square root of {sp, n} and put the result at {r1p, ceil(n / 2)} and the remainder at {r2p, retval}.
Public methodStatic memberCode examplempn_sub
Subtract {s2p, s2n} from {s1p, s1n}, and write the s1n least significant limbs of the result to rp.
Public methodStatic memberCode examplempn_sub_1
Subtract s2limb from {s1p, n}, and write the n least significant limbs of the result to rp.
Public methodStatic memberCode examplempn_sub_n
Subtract {s2p, n} from {s1p, n}, and write the n least significant limbs of the result to rp.
Public methodStatic memberCode examplempn_submul_1
Multiply {s1p, n} and s2limb, and subtract the n least significant limbs of the product from {rp, n} and write the result to rp.
Public methodStatic memberCode examplempn_tdiv_qr
Divide {np, nn} by {dp, dn} and put the quotient at {qp, nn - dn + 1} and the remainder at {rp, dn}.
Public methodStatic memberCode examplempn_xnor_n
Perform the bitwise logical exclusive or of {s1p, n} and {s2p, n}, and write the bitwise complement of the result to {rp, n}.
Public methodStatic memberCode examplempn_xor_n
Perform the bitwise logical exclusive or of {s1p, n} and {s2p, n}, and write the result to {rp, n}.
Public methodStatic memberCode examplempn_zero
Zero {rp, n}.
Public methodStatic memberCode examplempn_zero_p
Test {sp, n} and return 1 if the operand is zero, 0 otherwise.
Public methodStatic memberCode examplempq_abs
Set rop to the absolute value of op.
Public methodStatic memberCode examplempq_add
Set sum to addend1 + addend2.
Public methodStatic memberCode examplempq_canonicalize
Remove any factors that are common to the numerator and denominator of op, and make the denominator positive.
Public methodStatic memberCode examplempq_clear
Free the space occupied by x.
Public methodStatic memberCode examplempq_clears
Free the space occupied by a NULL-terminated list of mpq_t variables.
Public methodStatic memberCode examplempq_cmp
Compare op1 and op2.
Public methodStatic memberCode examplempq_cmp_si
Compare op1 and num2 / den2.
Public methodStatic memberCode examplempq_cmp_ui
Compare op1 and num2 / den2.
Public methodStatic memberCode examplempq_cmp_z
Compare op1 and op2.
Public methodStatic memberCode examplempq_denref
Return a reference to the denominator op.
Public methodStatic memberCode examplempq_div
Set quotient to dividend / divisor.
Public methodStatic memberCode examplempq_div_2exp
Set rop to op1 / 2^op2.
Public methodStatic memberCode examplempq_equal
Return non-zero if op1 and op2 are equal, zero if they are non-equal.
Public methodStatic memberCode examplempq_get_d
Convert op to a double, truncating if necessary (i.e. rounding towards zero).
Public methodStatic memberCode examplempq_get_den
Set denominator to the denominator of rational.
Public methodStatic memberCode examplempq_get_num
Set numerator to the numerator of rational.
Public methodStatic memberCode examplempq_get_str
Convert op to a string of digits in base base.
Public methodStatic memberCode examplempq_init
Initialize x and set it to 0/1.
Public methodStatic memberCode examplempq_inits
Initialize a NULL-terminated list of mpq_t variables, and set their values to 0/1.
Public methodStatic memberCode examplempq_inp_str
Read a string of digits from stream and convert them to a rational in rop.
Public methodStatic memberCode examplempq_inv
Set inverted_number to 1 / number.
Public methodStatic memberCode examplempq_mul
Set product to multiplier * multiplicand.
Public methodStatic memberCode examplempq_mul_2exp
Set rop to op1 * 2*op2.
Public methodStatic memberCode examplempq_neg
Set negated_operand to -operand.
Public methodStatic memberCode examplempq_numref
Return a reference to the numerator op.
Public methodStatic memberCode examplempq_out_str
Output op on stdio stream stream, as a string of digits in base base.
Public methodStatic memberCode examplempq_set
Assign rop from op.
Public methodStatic memberCode examplempq_set_d
Set rop to the value of op. There is no rounding, this conversion is exact.
Public methodStatic memberCode examplempq_set_den
Set the denominator of rational to denominator.
Public methodStatic memberCode examplempq_set_f
Set rop to the value of op. There is no rounding, this conversion is exact.
Public methodStatic memberCode examplempq_set_num
Set the numerator of rational to numerator.
Public methodStatic memberCode examplempq_set_si
Set the value of rop to op1 / op2.
Public methodStatic memberCode examplempq_set_str
Set rop from a null-terminated string str in the given base.
Public methodStatic memberCode examplempq_set_ui
Set the value of rop to op1 / op2.
Public methodStatic memberCode examplempq_set_z
Assign rop from op.
Public methodStatic memberCode examplempq_sgn
Return +1 if op > 0, 0 if op = 0, and -1 if op < 0.
Public methodStatic memberCode examplempq_sub
Set difference to minuend - subtrahend.
Public methodStatic memberCode examplempq_swap
Swap the values rop1 and rop2 efficiently.
Public methodStatic memberCode examplempz_2fac_ui
Set rop to the double-factorial n!!.
Public methodStatic memberCode examplempz_abs
Set rop to the absolute value of op.
Public methodStatic memberCode examplempz_add
Set rop to op1 + op2.
Public methodStatic memberCode examplempz_add_ui
Set rop to op1 + op2.
Public methodStatic memberCode examplempz_addmul
Set rop to rop + op1 * op2.
Public methodStatic memberCode examplempz_addmul_ui
Set rop to rop + op1 * op2.
Public methodStatic memberCode examplempz_and
Set rop to op1 bitwise-and op2.
Public methodStatic memberCode examplempz_bin_ui
Compute the binomial coefficient n over k and store the result in rop.
Public methodStatic memberCode examplempz_bin_uiui
Compute the binomial coefficient n over k and store the result in rop.
Public methodStatic memberCode examplempz_cdiv_q
Set the quotient q to ceiling(n / d).
Public methodStatic memberCode examplempz_cdiv_q_2exp
Set the quotient q to ceiling(n / 2^b).
Public methodStatic memberCode examplempz_cdiv_q_ui
Set the quotient q to ceiling(n / d), and return the remainder r = | n - q * d |.
Public methodStatic memberCode examplempz_cdiv_qr
Set the quotient q to ceiling(n / d), and set the remainder r to n - q * d.
Public methodStatic memberCode examplempz_cdiv_qr_ui
Set quotient q to ceiling(n / d), set the remainder r to n - q * d, and return | r |.
Public methodStatic memberCode examplempz_cdiv_r
Set the remainder r to n - q * d where q = ceiling(n / d).
Public methodStatic memberCode examplempz_cdiv_r_2exp
Set the remainder r to n - q * 2^b where q = ceiling(n / 2^b).
Public methodStatic memberCode examplempz_cdiv_r_ui
Set the remainder r to n - q * d where q = ceiling(n / d), and return | r |.
Public methodStatic memberCode examplempz_cdiv_ui
Return the remainder | r | where r = n - q * d, and where q = ceiling(n / d).
Public methodStatic memberCode examplempz_clear
Free the space occupied by x.
Public methodStatic memberCode examplempz_clears
Free the space occupied by a NULL-terminated list of mpz_t variables.
Public methodStatic memberCode examplempz_clrbit
Clear bit bit_index in rop.
Public methodStatic memberCode examplempz_cmp
Compare op1 and op2.
Public methodStatic memberCode examplempz_cmp_d
Compare op1 and op2.
Public methodStatic memberCode examplempz_cmp_si
Compare op1 and op2.
Public methodStatic memberCode examplempz_cmp_ui
Compare op1 and op2.
Public methodStatic memberCode examplempz_cmpabs
Compare the absolute values of op1 and op2.
Public methodStatic memberCode examplempz_cmpabs_d
Compare the absolute values of op1 and op2.
Public methodStatic memberCode examplempz_cmpabs_ui
Compare the absolute values of op1 and op2.
Public methodStatic memberCode examplempz_com
Set rop to the one’s complement of op.
Public methodStatic memberCode examplempz_combit
Complement bit bit_index in rop.
Public methodStatic memberCode examplempz_congruent_2exp_p
Return non-zero if n is congruent to c modulo 2^b.
Public methodStatic memberCode examplempz_congruent_p
Return non-zero if n is congruent to c modulo d.
Public methodStatic memberCode examplempz_congruent_ui_p
Return non-zero if n is congruent to c modulo d.
Public methodStatic memberCode examplempz_divexact
Set q to n / d when it is known in advance that d divides n.
Public methodStatic memberCode examplempz_divexact_ui
Set q to n / d when it is known in advance that d divides n.
Public methodStatic memberCode examplempz_divisible_2exp_p
Return non-zero if n is exactly divisible by 2^b.
Public methodStatic memberCode examplempz_divisible_p
Return non-zero if n is exactly divisible by d.
Public methodStatic memberCode examplempz_divisible_ui_p
Return non-zero if n is exactly divisible by d.
Public methodStatic memberCode examplempz_even_p
Determine whether op is even.
Public methodStatic memberCode examplempz_export(void_ptr, ptrsize_t, Int32, size_t, Int32, size_t, mpz_t)
Fill rop with word data from op.
Public methodStatic memberCode examplempz_export(void_ptr, size_t, Int32, size_t, Int32, size_t, mpz_t)
Fill rop with word data from op.
Public methodStatic memberCode examplempz_fac_ui
Set rop to the factorial n!.
Public methodStatic memberCode examplempz_fdiv_q
Set the quotient q to floor(n / d).
Public methodStatic memberCode examplempz_fdiv_q_2exp
Set the quotient q to floor(n / 2^b).
Public methodStatic memberCode examplempz_fdiv_q_ui
Set the quotient q to floor(n / d), and return the remainder r = | n - q * d |.
Public methodStatic memberCode examplempz_fdiv_qr
Set the quotient q to floor(n / d), and set the remainder r to n - q * d.
Public methodStatic memberCode examplempz_fdiv_qr_ui
Set quotient q to floor(n / d), set the remainder r to n - q * d, and return | r |.
Public methodStatic memberCode examplempz_fdiv_r
Set the remainder r to n - q * d where q = floor(n / d).
Public methodStatic memberCode examplempz_fdiv_r_2exp
Set the remainder r to n - q * 2^b where q = floor(n / 2^b).
Public methodStatic memberCode examplempz_fdiv_r_ui
Set the remainder r to n - q * d where q = floor(n / d), and return | r |.
Public methodStatic memberCode examplempz_fdiv_ui
Return the remainder | r | where r = n - q * d, and where q = floor(n / d).
Public methodStatic memberCode examplempz_fib_ui
Sets fn to to F[n], the n’th Fibonacci number.
Public methodStatic memberCode examplempz_fib2_ui
Sets fn to F[n], and fnsub1 to F[n - 1].
Public methodStatic memberCode examplempz_fits_sint_p
Return non-zero iff the value of op fits in a signed 32-bit integer. Otherwise, return zero.
Public methodStatic memberCode examplempz_fits_slong_p
Return non-zero iff the value of op fits in a signed 32-bit integer. Otherwise, return zero.
Public methodStatic memberCode examplempz_fits_sshort_p
Return non-zero iff the value of op fits in a signed 16-bit integer. Otherwise, return zero.
Public methodStatic memberCode examplempz_fits_uint_p
Return non-zero iff the value of op fits in an unsigned 32-bit integer. Otherwise, return zero.
Public methodStatic memberCode examplempz_fits_ulong_p
Return non-zero iff the value of op fits in an unsigned 32-bit integer. Otherwise, return zero.
Public methodStatic memberCode examplempz_fits_ushort_p
Return non-zero iff the value of op fits in an unsigned 16-bit integer. Otherwise, return zero.
Public methodStatic memberCode examplempz_gcd
Set rop to the greatest common divisor of op1 and op2.
Public methodStatic memberCode examplempz_gcd_ui
Compute the greatest common divisor of op1 and op2. If rop is not null, store the result there.
Public methodStatic memberCode examplempz_gcdext
Set g to the greatest common divisor of a and b, and in addition set s and t to coefficients satisfying a * s + b * t = g.
Public methodStatic memberCode examplempz_get_d
Convert op to a double, truncating if necessary (i.e. rounding towards zero).
Public methodStatic memberCode examplempz_get_d_2exp
Convert op to a double, truncating if necessary (i.e. rounding towards zero), and returning the exponent separately.
Public methodStatic memberCode examplempz_get_si
Return the value of op as an signed long.
Public methodStatic memberCode examplempz_get_str
Convert op to a string of digits in base base.
Public methodStatic memberCode examplempz_get_ui
Return the value of op as an unsigned long.
Public methodStatic memberCode examplempz_getlimbn
Return limb number n from op.
Public methodStatic memberCode examplempz_hamdist
Return the hamming distance between the two operands.
Public methodStatic memberCode examplempz_import
Set rop from an array of word data at op.
Public methodStatic memberCode examplempz_init
Initialize x, and set its value to 0.
Public methodStatic memberCode examplempz_init_set
Initialize rop with limb space and set the initial numeric value from op.
Public methodStatic memberCode examplempz_init_set_d
Initialize rop with limb space and set the initial numeric value from op.
Public methodStatic memberCode examplempz_init_set_si
Initialize rop with limb space and set the initial numeric value from op.
Public methodStatic memberCode examplempz_init_set_str
Initialize rop and set its value like mpz_set_str.
Public methodStatic memberCode examplempz_init_set_ui
Initialize rop with limb space and set the initial numeric value from op.
Public methodStatic memberCode examplempz_init2
Initialize x, with space for n-bit numbers, and set its value to 0.
Public methodStatic memberCode examplempz_inits
Initialize a NULL-terminated list of mpz_t variables, and set their values to 0.
Public methodStatic memberCode examplempz_inp_raw
Input from stdio stream stream in the format written by mpz_out_raw, and put the result in rop.
Public methodStatic memberCode examplempz_inp_str
Input a possibly white-space preceded string in base base from stdio stream stream, and put the read integer in rop.
Public methodStatic memberCode examplempz_invert
Compute the inverse of op1 modulo op2 and put the result in rop.
Public methodStatic memberCode examplempz_ior
Set rop to op1 bitwise inclusive-or op2.
Public methodStatic memberCode examplempz_jacobi
Calculate the Jacobi symbol (a/b).
Public methodStatic memberCode examplempz_kronecker
Calculate the Jacobi symbol (a/b) with the Kronecker extension (a/2) = (2/a) when a odd, or (a/2) = 0 when a even.
Public methodStatic memberCode examplempz_kronecker_si
Calculate the Jacobi symbol (a/b) with the Kronecker extension (a/2) = (2/a) when a odd, or (a/2) = 0 when a even.
Public methodStatic memberCode examplempz_kronecker_ui
Calculate the Jacobi symbol (a/b) with the Kronecker extension (a/2) = (2/a) when a odd, or (a/2) = 0 when a even.
Public methodStatic memberCode examplempz_lcm
Set rop to the least common multiple of op1 and op2.
Public methodStatic memberCode examplempz_lcm_ui
Set rop to the least common multiple of op1 and op2.
Public methodStatic memberCode examplempz_legendre
Calculate the Legendre symbol (a/p).
Public methodStatic membermpz_limbs_finish
Updates the internal size field of x.
Public methodStatic memberCode examplempz_limbs_modify
Return a pointer to the limb array of x, intended for write access.
Public methodStatic memberCode examplempz_limbs_read
Return a pointer to the limb array representing the absolute value of x.
Public methodStatic memberCode examplempz_limbs_write
Return a pointer to the limb array of x, intended for write access.
Public methodStatic memberCode examplempz_lucnum_ui
Sets ln to to L[n], the n’th Lucas number.
Public methodStatic memberCode examplempz_lucnum2_ui
Sets ln to L[n], and lnsub1 to L[n - 1].
Public methodStatic memberCode examplempz_mfac_uiui
Set rop to the m-multi-factorial n!^(m)n.
Public methodStatic memberCode examplempz_millerrabin
An implementation of the probabilistic primality test found in Knuth's Seminumerical Algorithms book.
Public methodStatic memberCode examplempz_mod
Set r to n mod d.
Public methodStatic memberCode examplempz_mod_ui
Set r to n mod d.
Public methodStatic memberCode examplempz_mul
Set rop to op1 * op2.
Public methodStatic memberCode examplempz_mul_2exp
Set rop to op1 * 2^op2.
Public methodStatic memberCode examplempz_mul_si
Set rop to op1 * op2.
Public methodStatic memberCode examplempz_mul_ui
Set rop to op1 * op2.
Public methodStatic memberCode examplempz_neg
Set rop to -op.
Public methodStatic memberCode examplempz_nextprime
Set rop to the next prime greater than op.
Public methodStatic memberCode examplempz_odd_p
Determine whether op is odd.
Public methodStatic memberCode examplempz_out_raw
Output op on stdio stream stream, in raw binary format.
Public methodStatic memberCode examplempz_out_str
Output op on stdio stream stream, as a string of digits in base base.
Public methodStatic memberCode examplempz_perfect_power_p
Return non-zero if op is a perfect power, i.e., if there exist integers a and b, with b > 1, such that op = a^b.
Public methodStatic memberCode examplempz_perfect_square_p
Return non-zero if op is a perfect square, i.e., if the square root of op is an integer.
Public methodStatic memberCode examplempz_popcount
Return the population count of op.
Public methodStatic memberCode examplempz_pow_ui
Set rop to base^exp. The case 0^0 yields 1.
Public methodStatic memberCode examplempz_powm
Set rop to (base^exp) modulo mod.
Public methodStatic memberCode examplempz_powm_sec
Set rop to (base^exp) modulo mod.
Public methodStatic memberCode examplempz_powm_ui
Set rop to (base^exp) modulo mod.
Public methodStatic memberCode examplempz_primorial_ui
Set rop to the primorial of n, i.e. the product of all positive prime numbers ≤ n.
Public methodStatic memberCode examplempz_probab_prime_p
Determine whether n is prime.
Public methodStatic memberCode examplempz_random
Generate a random integer of at most max_size limbs.
Public methodStatic memberCode examplempz_random2
Generate a random integer of at most max_size limbs, with long strings of zeros and ones in the binary representation.
Public methodStatic memberCode examplempz_realloc2
Change the space allocated for x to n bits.
Public methodStatic memberCode examplempz_remove
Remove all occurrences of the factor f from op and store the result in rop.
Public methodStatic memberCode examplempz_roinit_n
Special initialization of x, using the given limb array and size.
Public methodStatic memberCode examplempz_root
Set rop to the truncated integer part of the nth root of op.
Public methodStatic memberCode examplempz_rootrem
Set root to the truncated integer part of the nth root of u. Set rem to the remainder, u - root^n.
Public methodStatic memberCode examplempz_rrandomb
Generate a random integer with long strings of zeros and ones in the binary representation.
Public methodStatic memberCode examplempz_scan0
Scan op for 0 bit.
Public methodStatic memberCode examplempz_scan1
Scan op for 1 bit.
Public methodStatic memberCode examplempz_set
Set the value of rop from op.
Public methodStatic memberCode examplempz_set_d
Set the value of rop from op.
Public methodStatic memberCode examplempz_set_f
Set the value of rop from op.
Public methodStatic memberCode examplempz_set_q
Set the value of rop from op.
Public methodStatic memberCode examplempz_set_si
Set the value of rop from op.
Public methodStatic memberCode examplempz_set_str
Set the value of rop from str, a null-terminated C string in base base.
Public methodStatic memberCode examplempz_set_ui
Set the value of rop from op.
Public methodStatic memberCode examplempz_setbit
Set bit bit_index in rop.
Public methodStatic memberCode examplempz_sgn
Return +1 if op > 0, 0 if op = 0, and -1 if op < 0.
Public methodStatic memberCode examplempz_si_kronecker
Calculate the Jacobi symbol (a/b) with the Kronecker extension (a/2) = (2/a) when a odd, or (a/2) = 0 when a even.
Public methodStatic memberCode examplempz_size
Return the size of op measured in number of limbs.
Public methodStatic memberCode examplempz_sizeinbase
Return the size of op measured in number of digits in the given base.
Public methodStatic memberCode examplempz_sqrt
Set rop to the truncated integer part of the square root of op.
Public methodStatic memberCode examplempz_sqrtrem
Set rop1 to the truncated integer part of the square root of op, like mpz_sqrt. Set rop2 to the remainder op - rop1 * rop1, which will be zero if op is a perfect square.
Public methodStatic memberCode examplempz_sub
Set rop to op1 - op2.
Public methodStatic memberCode examplempz_sub_ui
Set rop to op1 - op2.
Public methodStatic memberCode examplempz_submul
Set rop to rop - op1 * op2.
Public methodStatic memberCode examplempz_submul_ui
Set rop to rop - op1 * op2.
Public methodStatic memberCode examplempz_swap
Swap the values rop1 and rop2 efficiently.
Public methodStatic memberCode examplempz_tdiv_q
Set the quotient q to trunc(n / d).
Public methodStatic memberCode examplempz_tdiv_q_2exp
Set the quotient q to trunc(n / 2^b).
Public methodStatic memberCode examplempz_tdiv_q_ui
Set the quotient q to trunc(n / d), and return the remainder r = | n - q * d |.
Public methodStatic memberCode examplempz_tdiv_qr
Set the quotient q to trunc(n / d), and set the remainder r to n - q * d.
Public methodStatic memberCode examplempz_tdiv_qr_ui
Set quotient q to trunc(n / d), set the remainder r to n - q * d, and return | r |.
Public methodStatic memberCode examplempz_tdiv_r
Set the remainder r to n - q * d where q = trunc(n / d).
Public methodStatic memberCode examplempz_tdiv_r_2exp
Set the remainder r to n - q * 2^b where q = trunc(n / 2^b).
Public methodStatic memberCode examplempz_tdiv_r_ui
Set the remainder r to n - q * d where q = trunc(n / d), and return | r |.
Public methodStatic memberCode examplempz_tdiv_ui
Return the remainder | r | where r = n - q * d, and where q = trunc(n / d).
Public methodStatic memberCode examplempz_tstbit
Test bit bit_index in op and return 0 or 1 accordingly.
Public methodStatic memberCode examplempz_ui_kronecker
Calculate the Jacobi symbol (a/b) with the Kronecker extension (a/2) = (2/a) when a odd, or (a/2) = 0 when a even.
Public methodStatic memberCode examplempz_ui_pow_ui
Set rop to base^exp. The case 0^0 yields 1.
Public methodStatic memberCode examplempz_ui_sub
Set rop to op1 - op2.
Public methodStatic memberCode examplempz_urandomb
Generate a uniformly distributed random integer in the range 0 to 2^n - 1, inclusive.
Public methodStatic memberCode examplempz_urandomm
Generate a uniform random integer in the range 0 to n - 1, inclusive.
Public methodStatic memberCode examplempz_xor
Set rop to op1 bitwise exclusive-or op2.
Public methodStatic memberreallocate
Resize a previously allocated block ptr of old_size bytes to be new_size bytes.
Public methodStatic memberZeroMemory
The ZeroMemory routine fills a block of memory with zeros, given a pointer to the block and the length, in bytes, to be filled.
Top
See Also