The functions in this section are for various special purposes. Most applications will not need them.
This is a special type of initialization. Fixed space of fixed_num_bits is allocated to each of the array_size integers in integer_array. There is no way to free the storage allocated by this function. Don't call
The integer_array parameter is the first
mpz_tin the array. For example,mpz_t arr; mpz_array_init (arr, 20000, 512);
This function is only intended for programs that create a large number of integers and need to reduce memory usage by avoiding the overheads of allocating and reallocating lots of small blocks. In normal programs this function is not recommended.
The space allocated to each integer by this function will not be automatically increased, unlike the normal
mpz_init, so an application must ensure it is sufficient for any value stored. The following space requirements apply to various routines,
mpz_set_uineed room for the value they store.
mpz_sub_uineed room for the larger of the two operands, plus an extra
mpz_mul_sineed room for the sum of the number of bits in their operands, but each rounded up to a multiple of
mpz_swapcan be used between two array variables, but not between an array and a normal variable.
For other functions, or if in doubt, the suggestion is to calculate in a regular
mpz_initvariable and copy the result to an array variable with
Change the space for integer to new_alloc limbs. The value in integer is preserved if it fits, or is set to 0 if not. The return value is not useful to applications and should be ignored.
mpz_realloc2is the preferred way to accomplish allocation changes like this.
_mpz_reallocare the same except that
_mpz_realloctakes its size in limbs.
Return limb number n from op. The sign of op is ignored, just the absolute value is used. The least significant limb is number 0.
mpz_sizecan be used to find how many limbs make up op.
mpz_getlimbnreturns zero if n is outside the range 0 to