EGlpNum


Detailed Description

Here we define a common interface to handle numbers in general, the idea is to be able to work with infinite precicion numbers, plain doubles, floats, integers, or fixed point numbers, without actually making different codes for each of those types, rather we preffer to fix that at compyle time.

History:
Revision 0.0.2 We start doing the migration to gmp and 'natural' types, this means that we drop support for EGrat, this allow us to drop the requirement to use pointers, and instead we can just call the functions with the original parameters, still we have to be VERY carefull regarding changing local/external copies.


Files

file  eg_lpnum.c
file  eg_lpnum.dbl.h
file  eg_lpnum.ex.c
file  eg_lpnum.float128.h
file  eg_lpnum.fp20.h
 Here we provide an implementation of the common EGlpNum interface using EGlib fixed point numbers, on the case where we store 20 bits for fractional values, 11 bits for integers part and one sign bit. See eg_fp.h for more details.
file  eg_lpnum.h
file  eg_lpnum.int.h
file  eg_lpnum.ldbl.h
file  eg_lpnum.llint.h
file  eg_lpnum.mpf.h
file  eg_lpnum.mpq.h
file  eg_lpnum.mpz.h

Data Structures

union  f64dbl_t
 union to conver C doubles to float64 types as provided by SoftFloat. This is needed because the default conversion does not apply. More...
#define EGLPNUM_ISFP   1
#define EGLPNUM_MAXCONVORDER   2U
#define EGlpNum_t   double
#define EGlpNumAddInnProdTo(a, b, c)   dbl_EGlpNumAddInnProdTo(a,b,c)
#define EGlpNumAddTo(a, b)   dbl_EGlpNumAddTo(a,b)
#define EGlpNumAddUiTo(a, b)   dbl_EGlpNumAddUiTo(a,b)
#define EGlpNumAllocArray(size)   dbl_EGlpNumAllocArray(size)
#define EGlpNumCeil(a, b)   dbl_EGlpNumCeil(a,b)
#define EGlpNumClearVar(a)   dbl_EGlpNumClearVar(a)
#define EGlpNumCopy(dest, orig)   dbl_EGlpNumCopy(dest,orig)
#define EGlpNumCopyAbs(dest, orig)   dbl_EGlpNumCopyAbs(dest,orig)
#define EGlpNumCopyArray(dest, orig, size)   dbl_EGlpNumCopyArray(dest,orig,size)
#define EGlpNumCopyDiff(dest, a, b)   dbl_EGlpNumCopyDiff(dest,a,b)
#define EGlpNumCopyDiffRatio(a, b, c, d)   dbl_EGlpNumCopyDiffRatio(a,b,c,d)
#define EGlpNumCopyFrac(dest, op1, op2)   dbl_EGlpNumCopyFrac(dest,op1,op2)
#define EGlpNumCopyNeg(dest, orig)   dbl_EGlpNumCopyNeg(dest,orig)
#define EGlpNumCopySqrOver(dest, orig, den)   dbl_EGlpNumCopySqrOver(dest,orig,den)
#define EGlpNumCopySum(dest, a, b)   dbl_EGlpNumCopySum(dest,a,b)
#define EGlpNumDivTo(a, b)   dbl_EGlpNumDivTo(a,b)
#define EGlpNumDivUiTo(a, b)   dbl_EGlpNumDivUiTo(a,b)
#define EGlpNumFloor(a, b)   dbl_EGlpNumFloor(a,b)
#define EGlpNumFreeArray(ea)   dbl_EGlpNumFreeArray(ea)
#define EGlpNumGetStr(a)   dbl_EGlpNumGetStr(a)
#define EGlpNumInitVar(a)   dbl_EGlpNumInitVar(a)
#define EGlpNumInv(a)   dbl_EGlpNumInv(a)
#define EGlpNumIsDiffLess(a, b, c)   dbl_EGlpNumIsDiffLess(a,b,c)
#define EGlpNumIsEqqual(a, b)   dbl_EGlpNumIsEqqual(a,b)
#define EGlpNumIsEqual(a, b, error)   dbl_EGlpNumIsEqual(a,b,error)
#define EGlpNumIsGreaDbl(a, b)   dbl_EGlpNumIsGreaDbl(a,b)
#define EGlpNumIsLeq(a, b)   dbl_EGlpNumIsLeq(a,b)
#define EGlpNumIsLess(a, b)   dbl_EGlpNumIsLess(a,b)
#define EGlpNumIsLessDbl(a, b)   dbl_EGlpNumIsLessDbl(a,b)
#define EGlpNumIsNeq(a, b, error)   dbl_EGlpNumIsNeq(a,b,error)
#define EGlpNumIsNeqq(a, b)   dbl_EGlpNumIsNeqq(a,b)
#define EGlpNumIsNeqqZero(a)   dbl_EGlpNumIsNeqqZero(a)
#define EGlpNumIsNeqZero(a, error)   dbl_EGlpNumIsNeqZero(a,error)
#define EGlpNumIsSumLess(a, b, c)   dbl_EGlpNumIsSumLess(a,b,c)
#define EGlpNumMultTo(a, b)   dbl_EGlpNumMultTo(a,b)
#define EGlpNumMultUiTo(a, b)   dbl_EGlpNumMultUiTo(a,b)
#define EGlpNumOne(a)   dbl_EGlpNumOne(a)
#define EGlpNumReadStr(a, str)   dbl_EGlpNumReadStr(a,str)
#define EGlpNumReallocArray(lptr, size)   dbl_EGlpNumReallocArray(lptr,size)
#define EGlpNumSet(var, dbl)   dbl_EGlpNumSet(var,dbl)
#define EGlpNumSetToMaxAbs(dest, orig)   dbl_EGlpNumSetToMaxAbs(dest,orig)
#define EGlpNumSetToMinAbs(dest, orig)   dbl_EGlpNumSetToMinAbs(dest,orig)
#define EGlpNumSign(a)   dbl_EGlpNumSign(a)
#define EGlpNumSubInnProdTo(a, b, c)   dbl_EGlpNumSubInnProdTo(a,b,c)
#define EGlpNumSubTo(a, b)   dbl_EGlpNumSubTo(a,b)
#define EGlpNumSubUiTo(a, b)   dbl_EGlpNumSubUiTo(a,b)
#define EGlpNumToLf(a)   dbl_EGlpNumToLf(a)
#define EGlpNumZero(a)   dbl_EGlpNumZero(a)
#define epsLpNum   dbl_epsLpNum
#define oneLpNum   dbl_oneLpNum
#define zeroLpNum   dbl_zeroLpNum
float128 __lpnum_float128__
mpf_t __lpnum_mpf__
mpq_t __lpnum_mpq__
mpz_t __lpnum_mpz__
float128 __oneLpNum_float128__ = {.high = 0x3fff000000000000LL,.low = 0 }
mpf_t __oneLpNum_mpf__
mpq_t __oneLpNum_mpq__
mpz_t __oneLpNum_mpz__
float128 __zeroLpNum_float128__ = { 0, 0 }
mpf_t __zeroLpNum_mpf__
mpq_t __zeroLpNum_mpq__
mpz_t __zeroLpNum_mpz__
 type-dependant constants and helper numbers
float128 float128_eps = {.high = 0x3f8f000000000000,.low = 0 }
 This is the smallest difference (with the current precision) that can be distinguished betwen 1.0 and it's clossest representable number, in some sense it is the absolute minimum epsilon for comparisons.

Defines

#define __EGlpNumAllocArray(type, size)
 Allocate an array of a given type and store (four bytes before the actual array) the size of the allocated array.
#define __EGlpNumArraySize(array)
 Given an array allocated with __EGlpNumAllocArray, return the size of the given array, if the array is null, return zero.
#define __EGlpNumFreeArray(array)
 , given an array allocated by __EGlpNumAllocArray, free the allocated memory.
#define dbl_EGlpNumAddInnProdTo(a, b, c)   ((a) += (b)*(c))
 Add to a given number the product of two numbers.
#define dbl_EGlpNumAddTo(a, b)   ((a) += (b))
 Add to a given number the value of the second number.
#define dbl_EGlpNumAddUiTo(a, b)   ((a) += (b))
 Add to a given number the value of the second number.
#define dbl_EGlpNumAllocArray(size)   __EGlpNumAllocArray(double,size)
 Allocate and initialize (if needed) 'size' elements of type double and return it, if no more memory, exit(1).
#define dbl_EGlpNumCeil(a, b)   ((a) = ceil(b))
 Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
#define dbl_EGlpNumClearVar(a)
 free the internal memory of a given variable
#define dbl_EGlpNumCopy(dest, orig)   ((dest) = (orig))
 copy the value of the second number to the first.
#define dbl_EGlpNumCopyAbs(dest, orig)   ((dest) = fabs(orig))
 copy the value of the absolute value of the second parameter to the first parameter.
#define dbl_EGlpNumCopyArray(dest, orig, size)   memcpy(dest,orig,sizeof(double)*(size))
 copy the first 'size' values in the second array to the first array.
#define dbl_EGlpNumCopyDiff(dest, a, b)   ((dest) = (a) - (b))
 copy the value of the second number to the first.
#define dbl_EGlpNumCopyDiffRatio(dest, a, b, den)   ((dest) = ((a) - (b)) / (den))
 copy the value of the second number to the first.
#define dbl_EGlpNumCopyFrac(dest, op1, op2)   ((dest) = (op1)/(op2))
 Set des = op1/op2.
#define dbl_EGlpNumCopyNeg(dest, orig)   ((dest) = -(orig))
 copy minus the value of the second parameter to the first parameter.
#define dbl_EGlpNumCopySqrOver(dest, orig, den)   ((dest) = (orig)*(orig)/(den))
 copy the square of the second argument, divided by the third argument into the first argument.
#define dbl_EGlpNumCopySum(dest, a, b)   ((dest) = (a) + (b))
 copy the value of the sum of the second and third parameter
#define dbl_EGlpNumDivTo(a, b)   ((a) /= (b))
 Divide a given number by the value of the second number.
#define dbl_EGlpNumDivUiTo(a, b)   ((a) /= (b))
 Divide a given number by the value of the second number.
#define dbl_EGlpNumFloor(a, b)   ((a) = floor(b))
 Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
#define dbl_EGlpNumFreeArray(ea)   __EGlpNumFreeArray(ea)
 given an array of type double, free it, if the pointer is NULL nothing happen.
#define dbl_EGlpNumGetStr(a)
 given a double, write it to a string (to be allocated internally), and return it.
#define dbl_EGlpNumInitVar(a)   dbl_EGlpNumZero(a)
 initialize the internal memory of a given variable
#define dbl_EGlpNumInv(a)   ((a) = 1.0/(a))
 store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
#define dbl_EGlpNumIsDiffLess(a, b, c)   ((a) - (b) < (c))
 test if the diference of the first two numbers is less thatn the third number.
#define dbl_EGlpNumIsEqqual(a, b)   ((a) == (b))
 Compare if two numbers are equal within a maximum error.
#define dbl_EGlpNumIsEqual(a, b, error)   (fabs((a)-(b)) <= (error))
 Compare if two numbers are equal within a maximum error.
#define dbl_EGlpNumIsGreaDbl(a, b)   ((a) > (b))
 test if the first number is bigger to the second number
#define dbl_EGlpNumIsLeq(a, b)   ((a) <= (b))
 test if the first number is bigger to the second number
#define dbl_EGlpNumIsLess(a, b)   (a < b)
 test if the first number is bigger to the second number
#define dbl_EGlpNumIsLessDbl(a, b)   ((a) < (b))
 test if the first number is bigger to the second number
#define dbl_EGlpNumIsNeq(a, b, error)   (((a)-(b) > (error)) || ((b)-(a) > (error)))
#define dbl_EGlpNumIsNeqq(a, b)   ((a) != (b))
#define dbl_EGlpNumIsNeqqZero(a)   ((a) != 0.0)
#define dbl_EGlpNumIsNeqZero(a, error)   (((a) > (error)) || (-(a) > (error)))
#define dbl_EGlpNumIsSumLess(a, b, c)   ((a) + (b) < (c))
 test if the sum of the first two numbers is less thatn the third number.
#define dbl_EGlpNumMultTo(a, b)   ((a) *= (b))
 Multiply a given number by the value of the second number.
#define dbl_EGlpNumMultUiTo(a, b)   ((a) *= (b))
 Multiply a given number by the value of the second number.
#define dbl_EGlpNumOne(a)   ((a) = 1.0)
 Reset the value of the pointed number to one.
#define dbl_EGlpNumReadStr(a, str)
 Read from a string a number and store it in the given double,.
#define dbl_EGlpNumReallocArray(lptr, lsize)
 Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1).
#define dbl_EGlpNumSet(var, dbl)   ((var) = (dbl))
 set the given number pointer, set its value to the given double.
#define dbl_EGlpNumSetToMaxAbs(dest, orig)
 change the fist number to the maximum between itself and the absolute value of the second.
#define dbl_EGlpNumSetToMinAbs(dest, orig)
#define dbl_EGlpNumSign(a)   ((a) = -(a))
 Change the sign of the number.
#define dbl_EGlpNumSubInnProdTo(a, b, c)   ((a) -= (b)*(c))
 Sub to a given number the product of two numbers.
#define dbl_EGlpNumSubTo(a, b)   ((a) -= (b))
 Substract to a given number the value of the second number.
#define dbl_EGlpNumSubUiTo(a, b)   ((a) -= (b))
 Substract to a given number the value of the second number.
#define dbl_EGlpNumToLf(a)   (a)
 return the closest double value of the given pointer number.
#define dbl_EGlpNumZero(a)   ((a) = 0.0)
 Reset the value of the pointed number to zero.
#define dbl_epsLpNum   DBL_EPSILON
#define dbl_oneLpNum   1.0
#define dbl_zeroLpNum   0.0
#define EGabs(var)
 a general macro to return the absolute value of the given variable
#define EGLPNUM_DEBUGL   100
 Debugging verbosity messages deped on the value of DEBUG (defined in eg_configure.h) and on the value of EGLPNUM_DEBUGL macro defined here.
#define EGLPNUM_MINEPS   3e-10
 This constant define the of the acuracy required while converting doubles to rationals, a good number is 1e-5. More exactly, we stop the continued fraction method whenever the next e_i-[e_i] computed is less than EGLPNUM_MINEPS. Note that this value can't be smaller than 1/ULONG_MAX, otherwise we will have problems in the confertion step.
#define EGLPNUM_TYPE   DBL_TYPE
 default type for EGLPNUM_TYPE
#define EGmax(a, b)
 given two variables (of the same type, and of some predefined type) return the maximum value among the two of them.
#define EGmin(a, b)
 given two variables (of the same type, and of some predefined type) return the minimum value among the two of them.
#define EGswap(N1, N2, Ntmp)
 Given tree numbers N1, N2 and Ntmp, swap values of N1 and N2 using Ntmp as a temporal number. The variables should be of some primitive type of C for this macro to work.
#define float128_EGlpNumAddInnProdTo(a, b, c)
 Add to a given number the product of two numbers.
#define float128_EGlpNumAddTo(a, b)   ((a) = float128_add(a,b))
 Add to a given number the value of the second number.
#define float128_EGlpNumAddUiTo(a, b)
 Add to a given number the value of the second number.
#define float128_EGlpNumAllocArray(size)
 Allocate and initialize (if needed) 'size' elements of type float128 and return it, if no more memory, exit(1).
#define float128_EGlpNumCeil(a, b)
 Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
#define float128_EGlpNumClearVar(a)
 free the internal memory of a given variable
#define float128_EGlpNumCopy(dest, orig)   (dest=orig)
 copy the value of the second number to the first.
#define float128_EGlpNumCopyAbs(dest, orig)
 copy the value of the absolute value of the second parameter to the first parameter.
#define float128_EGlpNumCopyArray(dest, orig, size)   memcpy(dest,orig,sizeof(float128)*(size))
 copy the first 'size' values in the second array to the first array.
#define float128_EGlpNumCopyDiff(dest, a, b)   (dest = float128_sub(a,b))
 copy the value of the second number to the first.
#define float128_EGlpNumCopyDiffRatio(a, b, c, d)
 copy the value of the second number to the first.
#define float128_EGlpNumCopyFrac(dest, op1, op2)   ((dest) = float128_div(op1,op2))
 Set des = op1/op2.
#define float128_EGlpNumCopyNeg(dest, orig)
 copy minus the value of the second parameter to the first parameter.
#define float128_EGlpNumCopySqrOver(dest, orig, den)
 copy the square of the second argument, divided by the third argument into the first argument.
#define float128_EGlpNumCopySum(dest, a, b)   (dest = float128_add(a,b))
 copy the value of the sum of the second and third parameter
#define float128_EGlpNumDivTo(a, b)   ((a) = float128_div(a,b))
 Divide a given number by the value of the second number.
#define float128_EGlpNumDivUiTo(a, b)
 Divide a given number by the value of the second number.
#define float128_EGlpNumEpow(num, exp)
 Given a double exp, compute $ e^{exp} $ and store it in the given float128 number.
#define float128_EGlpNumFloor(a, b)
 Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
#define float128_EGlpNumFreeArray(ea)   __EGlpNumFreeArray(ea)
 given an array of type float128, free it, if the pointer is NULL nothing happen.
#define float128_EGlpNumGetStr(a)
 given a float128, write it to a string (to be allocated internally), and return it.
#define float128_EGlpNumInitVar(a)   (a = (float128){0,0})
 initialize the internal memory of a given variable
#define float128_EGlpNumInv(a)   ((a) = float128_div(float128_oneLpNum,a))
 store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
#define float128_EGlpNumIsDiffLess(a, b, c)
 test if the diference of the first two numbers is less thatn the third number.
#define float128_EGlpNumIsEqqual(a, b)   (float128_eq(a,b))
 Compare if two numbers are equal within a maximum error.
#define float128_EGlpNumIsEqual(a, b, error)
 Compare if two numbers are equal within a maximum error.
#define float128_EGlpNumIsGreaDbl(a, b)
 test if the first number is bigger to the second number
#define float128_EGlpNumIsLeq(a, b)   float128_le(a,b)
 test if the first number is bigger to the second number
#define float128_EGlpNumIsLess(a, b)   (float128_lt(a,b))
 test if the first number is bigger to the second number
#define float128_EGlpNumIsLessDbl(a, b)
 test if the first number is bigger to the second number
#define float128_EGlpNumIsNeq(a, b, error)
#define float128_EGlpNumIsNeqq(a, b)   (!float128_eq(a,b))
#define float128_EGlpNumIsNeqqZero(a)   (!float128_eq(a,float128_zeroLpNum))
#define float128_EGlpNumIsNeqZero(a, error)
#define float128_EGlpNumIsSumLess(a, b, c)
 test if the sum of the first two numbers is less thatn the third number.
#define float128_EGlpNumMultTo(a, b)   ((a) = float128_mul(a,b))
 Multiply a given number by the value of the second number.
#define float128_EGlpNumMultUiTo(a, b)
 Multiply a given number by the value of the second number.
#define float128_EGlpNumOne(a)   ((a) = (float128){.high = 0x3fff000000000000LL, .low = 0})
 Reset the value of the pointed number to one.
#define float128_EGlpNumReadStr(a, str)
 Read from a string a number and store it in the given float128,.
#define float128_EGlpNumReallocArray(lptr, lsize)
 Reallocate and initialize (if needed) 'size' elements of type float128 and return it, if no more memory, exit(1).
#define float128_EGlpNumSet(var, edbl)
 set the given number pointer, set its value to the given double.
#define float128_EGlpNumSetToMaxAbs(dest, orig)
 change the fist number to the maximum between itself and the absolute value of the second.
#define float128_EGlpNumSetToMinAbs(dest, orig)
#define float128_EGlpNumSign(a)   ((a).high ^= 0x8000000000000000LL)
 Change the sign of the number.
#define float128_EGlpNumSubInnProdTo(a, b, c)
 Sub to a given number the product of two numbers.
#define float128_EGlpNumSubTo(a, b)   ((a) = float128_sub(a,b))
 Substract to a given number the value of the second number.
#define float128_EGlpNumSubUiTo(a, b)
 Substract to a given number the value of the second number.
#define float128_EGlpNumToLf(a)
 return the closest double value of the given pointer number.
#define float128_EGlpNumZero(a)   ((a) = (float128){0,0})
 Reset the value of the pointed number to zero.
#define float128_epsLpNum   float128_eps
#define float128_oneLpNum   __oneLpNum_float128__
#define float128_zeroLpNum   __zeroLpNum_float128__
#define fp20_EGlpNumAddInnProdTo(a, b, c)   ((a) += ((EGfp20_t)((((long long)(b))*(c))/fp20_oneLpNum)))
 Add to a given number the product of two numbers.
#define fp20_EGlpNumAddTo(a, b)   ((a) += (b))
 Add to a given number the value of the second number.
#define fp20_EGlpNumAddUiTo(a, b)   ((a) += (b)*fp20_oneLpNum)
 Add to a given number the value of the second number.
#define fp20_EGlpNumAllocArray(size)   __EGlpNumAllocArray(EGfp20_t,size)
 Allocate and initialize (if needed) 'size' elements of type int and return it, if no more memory, exit(1).
#define fp20_EGlpNumCeil(a, b)
 Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
#define fp20_EGlpNumClearVar(a)
 free the internal memory of a given variable
#define fp20_EGlpNumCopy(dest, orig)   ((dest) = (orig))
 copy the value of the second number to the first.
#define fp20_EGlpNumCopyAbs(dest, orig)   ((dest) = EGabs(orig))
 copy the value of the absolute value of the second parameter to the first parameter.
#define fp20_EGlpNumCopyArray(dest, orig, size)   memcpy(dest,orig,sizeof(EGfp20_t)*(size))
 copy the first 'size' values in the second array to the first array.
#define fp20_EGlpNumCopyDiff(dest, a, b)   ((dest) = (a) - (b))
 copy the value of the second number to the first.
#define fp20_EGlpNumCopyDiffRatio(dest, a, b, den)   ((dest) = (EGfp20_t)((((long long)((a) - (b)))*fp20_oneLpNum) / (den)))
 copy the value of the second number to the first.
#define fp20_EGlpNumCopyFrac(dest, op1, op2)   ((dest) = ((EGfp20_t)((((long long)(op1))*fp20_oneLpNum)/(op2))))
 Set des = op1/op2.
#define fp20_EGlpNumCopyNeg(dest, orig)   ((dest) = -(orig))
 copy minus the value of the second parameter to the first parameter.
#define fp20_EGlpNumCopySqrOver(dest, orig, den)   ((dest) = ((EGfp20_t)((((long long)(orig))*(orig))/(den))))
 copy the square of the second argument, divided by the third argument into the first argument.
#define fp20_EGlpNumCopySum(dest, a, b)   ((dest) = (a) + (b))
 copy the value of the sum of the second and third parameter
#define fp20_EGlpNumDivTo(a, b)   ((a) = ((EGfp20_t)((((long long)(a))*fp20_oneLpNum)/(b))))
 Divide a given number by the value of the second number.
#define fp20_EGlpNumDivUiTo(a, b)   ((a) /= (b))
 Divide a given number by the value of the second number.
#define fp20_EGlpNumFloor(a, b)   ((a) = (((b)/fp20_oneLpNum)*fp20_oneLpNum))
 Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
#define fp20_EGlpNumFreeArray(ea)   __EGlpNumFreeArray(ea)
 given an array of type int, free it, if the pointer is NULL nothing happen.
#define fp20_EGlpNumGetStr(a)
 given a int, write it to a string (to be allocated internally), and return it.
#define fp20_EGlpNumInitVar(a)   fp20_EGlpNumZero(a)
 initialize the internal memory of a given variable
#define fp20_EGlpNumInv(a)
 store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
#define fp20_EGlpNumIsDiffLess(a, b, c)   ((a) - (b) < (c))
 test if the diference of the first two numbers is less thatn the third number.
#define fp20_EGlpNumIsEqqual(a, b)   ((a) == (b))
 Compare if two numbers are equal within a maximum error.
#define fp20_EGlpNumIsEqual(a, b, error)   (EGabs((a)-(b)) <= (error))
 Compare if two numbers are equal within a maximum error.
#define fp20_EGlpNumIsGreaDbl(a, b)   ((a) > ((b)*fp20_oneLpNum))
 test if the first number is bigger to the second number
#define fp20_EGlpNumIsLeq(a, b)   ((a) <= (b))
 test if the first number is bigger to the second number
#define fp20_EGlpNumIsLess(a, b)   (a < b)
 test if the first number is bigger to the second number
#define fp20_EGlpNumIsLessDbl(a, b)   ((a) < ((b)*fp20_oneLpNum))
 test if the first number is bigger to the second number
#define fp20_EGlpNumIsNeq(a, b, error)   (((a)-(b) > (error)) || ((b)-(a) > (error)))
#define fp20_EGlpNumIsNeqq(a, b)   ((a) != (b))
#define fp20_EGlpNumIsNeqqZero(a)   ((a) != 0)
#define fp20_EGlpNumIsNeqZero(a, error)   (((a) > (error)) || (-(a) > (error)))
#define fp20_EGlpNumIsSumLess(a, b, c)   ((a) + (b) < (c))
 test if the sum of the first two numbers is less thatn the third number.
#define fp20_EGlpNumMultTo(a, b)   ((a) = ((EGfp20_t)((((long long)(a))*(b))/fp20_oneLpNum)))
 Multiply a given number by the value of the second number.
#define fp20_EGlpNumMultUiTo(a, b)   ((a) *= (b))
 Multiply a given number by the value of the second number.
#define fp20_EGlpNumOne(a)   ((a) = fp20_oneLpNum)
 Reset the value of the pointed number to one.
#define fp20_EGlpNumReadStr(a, str)
 Read from a string a number and store it in the given int,.
#define fp20_EGlpNumReallocArray(lptr, lsize)
 Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1).
#define fp20_EGlpNumSet(var, dbl_var)   ((var) = (EGfp20_t)((dbl_var)*fp20_oneLpNum))
 set the given number pointer, set its value to the given int.
#define fp20_EGlpNumSetToMaxAbs(dest, orig)
 change the fist number to the maximum between itself and the absolute value of the second.
#define fp20_EGlpNumSetToMinAbs(dest, orig)
#define fp20_EGlpNumSign(a)   ((a) = -(a))
 Change the sign of the number.
#define fp20_EGlpNumSubInnProdTo(a, b, c)   ((a) -= ((EGfp20_t)((((long long)(b))*(c))/fp20_oneLpNum)))
 Sub to a given number the product of two numbers.
#define fp20_EGlpNumSubTo(a, b)   ((a) -= (b))
 Substract to a given number the value of the second number.
#define fp20_EGlpNumSubUiTo(a, b)   ((a) -= (b)*fp20_oneLpNum)
 Substract to a given number the value of the second number.
#define fp20_EGlpNumToLf(a)   (((double)(a))/fp20_oneLpNum)
 return the closest int value of the given pointer number.
#define fp20_EGlpNumZero(a)   ((a) = 0)
 Reset the value of the pointed number to zero.
#define fp20_epsLpNum   1
#define fp20_oneLpNum   0x100000
#define fp20_zeroLpNum   0
#define int_EGlpNumAddInnProdTo(a, b, c)   ((a) += (b)*(c))
 Add to a given number the product of two numbers.
#define int_EGlpNumAddTo(a, b)   ((a) += (b))
 Add to a given number the value of the second number.
#define int_EGlpNumAddUiTo(a, b)   ((a) += (b))
 Add to a given number the value of the second number.
#define int_EGlpNumAllocArray(size)   __EGlpNumAllocArray(int,size)
 Allocate and initialize (if needed) 'size' elements of type int and return it, if no more memory, exit(1).
#define int_EGlpNumCeil(a, b)   int_EGlpNumSet(a,b)
 Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
#define int_EGlpNumClearVar(a)
 free the internal memory of a given variable
#define int_EGlpNumCopy(dest, orig)   ((dest) = (orig))
 copy the value of the second number to the first.
#define int_EGlpNumCopyAbs(dest, orig)   ((dest) = EGabs(orig))
 copy the value of the absolute value of the second parameter to the first parameter.
#define int_EGlpNumCopyArray(dest, orig, size)   memcpy(dest,orig,sizeof(int)*(size))
 copy the first 'size' values in the second array to the first array.
#define int_EGlpNumCopyDiff(dest, a, b)   ((dest) = (a) - (b))
 copy the value of the second number to the first.
#define int_EGlpNumCopyDiffRatio(dest, a, b, den)   ((dest) = ((a) - (b)) / (den))
 copy the value of the second number to the first.
#define int_EGlpNumCopyFrac(dest, op1, op2)   ((dest) = (op1)/(op2))
 Set des = op1/op2.
#define int_EGlpNumCopyNeg(dest, orig)   ((dest) = -(orig))
 copy minus the value of the second parameter to the first parameter.
#define int_EGlpNumCopySqrOver(dest, orig, den)   ((dest) = (orig)*(orig)/(den))
 copy the square of the second argument, divided by the third argument into the first argument.
#define int_EGlpNumCopySum(dest, a, b)   ((dest) = (a) + (b))
 copy the value of the sum of the second and third parameter
#define int_EGlpNumDivTo(a, b)   ((a) /= (b))
 Divide a given number by the value of the second number.
#define int_EGlpNumDivUiTo(a, b)   ((a) /= (b))
 Divide a given number by the value of the second number.
#define int_EGlpNumFloor(a, b)   int_EGlpNumSet(a,b)
 Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
#define int_EGlpNumFreeArray(ea)   __EGlpNumFreeArray(ea)
 given an array of type int, free it, if the pointer is NULL nothing happen.
#define int_EGlpNumGetStr(a)
 given a int, write it to a string (to be allocated internally), and return it.
#define int_EGlpNumInitVar(a)   int_EGlpNumZero(a)
 initialize the internal memory of a given variable
#define int_EGlpNumInv(a)   ((a) = 1/(a))
 store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
#define int_EGlpNumIsDiffLess(a, b, c)   ((a) - (b) < (c))
 test if the diference of the first two numbers is less thatn the third number.
#define int_EGlpNumIsEqqual(a, b)   ((a) == (b))
 Compare if two numbers are equal within a maximum error.
#define int_EGlpNumIsEqual(a, b, error)   (EGabs((a)-(b)) <= (error))
 Compare if two numbers are equal within a maximum error.
#define int_EGlpNumIsGreaDbl(a, b)   ((a) > (b))
 test if the first number is bigger to the second number
#define int_EGlpNumIsLeq(a, b)   ((a) <= (b))
 test if the first number is bigger to the second number
#define int_EGlpNumIsLess(a, b)   (a < b)
 test if the first number is bigger to the second number
#define int_EGlpNumIsLessDbl(a, b)   ((a) < (b))
 test if the first number is bigger to the second number
#define int_EGlpNumIsNeq(a, b, error)   (((a)-(b) > (error)) || ((b)-(a) > (error)))
#define int_EGlpNumIsNeqq(a, b)   ((a) != (b))
#define int_EGlpNumIsNeqqZero(a)   ((a) != 0)
#define int_EGlpNumIsNeqZero(a, error)   (((a) > (error)) || (-(a) > (error)))
#define int_EGlpNumIsSumLess(a, b, c)   ((a) + (b) < (c))
 test if the sum of the first two numbers is less thatn the third number.
#define int_EGlpNumMultTo(a, b)   ((a) *= (b))
 Multiply a given number by the value of the second number.
#define int_EGlpNumMultUiTo(a, b)   ((a) *= (b))
 Multiply a given number by the value of the second number.
#define int_EGlpNumOne(a)   ((a) = 1)
 Reset the value of the pointed number to one.
#define int_EGlpNumReadStr(a, str)
 Read from a string a number and store it in the given int,.
#define int_EGlpNumReallocArray(lptr, lsize)
 Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1).
#define int_EGlpNumSet(var, dbl_var)   ((var) = (dbl_var))
 set the given number pointer, set its value to the given int.
#define int_EGlpNumSetToMaxAbs(dest, orig)
 change the fist number to the maximum between itself and the absolute value of the second.
#define int_EGlpNumSetToMinAbs(dest, orig)
#define int_EGlpNumSign(a)   ((a) = -(a))
 Change the sign of the number.
#define int_EGlpNumSubInnProdTo(a, b, c)   ((a) -= (b)*(c))
 Sub to a given number the product of two numbers.
#define int_EGlpNumSubTo(a, b)   ((a) -= (b))
 Substract to a given number the value of the second number.
#define int_EGlpNumSubUiTo(a, b)   ((a) -= (b))
 Substract to a given number the value of the second number.
#define int_EGlpNumToLf(a)   (a)
 return the closest int value of the given pointer number.
#define int_EGlpNumZero(a)   ((a) = 0)
 Reset the value of the pointed number to zero.
#define int_epsLpNum   0
#define int_oneLpNum   1
#define int_zeroLpNum   0
#define ldbl_EGlpNumAddInnProdTo(a, b, c)   ((a) += (b)*(c))
 Add to a given number the product of two numbers.
#define ldbl_EGlpNumAddTo(a, b)   ((a) += (b))
 Add to a given number the value of the second number.
#define ldbl_EGlpNumAddUiTo(a, b)   ((a) += (b))
 Add to a given number the value of the second number.
#define ldbl_EGlpNumAllocArray(size)   __EGlpNumAllocArray(long double,size)
 Allocate and initialize (if needed) 'size' elements of type long double and return it, if no more memory, exit(1).
#define ldbl_EGlpNumCeil(a, b)   ((a) = ceill(b))
 Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
#define ldbl_EGlpNumClearVar(a)
 free the internal memory of a given variable
#define ldbl_EGlpNumCopy(dest, orig)   ((dest) = (orig))
 copy the value of the second number to the first.
#define ldbl_EGlpNumCopyAbs(dest, orig)   ((dest) = fabsl(orig))
 copy the value of the absolute value of the second parameter to the first parameter.
#define ldbl_EGlpNumCopyArray(dest, orig, size)   memcpy(dest,orig,sizeof(long double)*(size))
 copy the first 'size' values in the second array to the first array.
#define ldbl_EGlpNumCopyDiff(dest, a, b)   ((dest) = (a) - (b))
 copy the value of the second number to the first.
#define ldbl_EGlpNumCopyDiffRatio(dest, a, b, den)   ((dest) = ((a) - (b)) / (den))
 copy the value of the second number to the first.
#define ldbl_EGlpNumCopyFrac(dest, op1, op2)   ((dest) = (op1)/(op2))
 Set des = op1/op2.
#define ldbl_EGlpNumCopyNeg(dest, orig)   ((dest) = -(orig))
 copy minus the value of the second parameter to the first parameter.
#define ldbl_EGlpNumCopySqrOver(dest, orig, den)   ((dest) = (orig)*(orig)/(den))
 copy the square of the second argument, divided by the third argument into the first argument.
#define ldbl_EGlpNumCopySum(dest, a, b)   ((dest) = (a) + (b))
 copy the value of the sum of the second and third parameter
#define ldbl_EGlpNumDivTo(a, b)   ((a) /= (b))
 Divide a given number by the value of the second number.
#define ldbl_EGlpNumDivUiTo(a, b)   ((a) /= (b))
 Divide a given number by the value of the second number.
#define ldbl_EGlpNumFloor(a, b)   ((a) = floorl(b))
 Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
#define ldbl_EGlpNumFreeArray(ea)   __EGlpNumFreeArray(ea)
 given an array of type long double, free it, if the pointer is NULL nothing happen.
#define ldbl_EGlpNumGetStr(a)
 given a long double, write it to a string (to be allocated internally), and return it.
#define ldbl_EGlpNumInitVar(a)   ldbl_EGlpNumZero(a)
 initialize the internal memory of a given variable
#define ldbl_EGlpNumInv(a)   ((a) = 1.0L/(a))
 store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
#define ldbl_EGlpNumIsDiffLess(a, b, c)   ((a) - (b) < (c))
 test if the diference of the first two numbers is less thatn the third number.
#define ldbl_EGlpNumIsEqqual(a, b)   ((a) == (b))
 Compare if two numbers are equal within a maximum error.
#define ldbl_EGlpNumIsEqual(a, b, error)   (fabsl((a)-(b)) <= (error))
 Compare if two numbers are equal within a maximum error.
#define ldbl_EGlpNumIsGreaDbl(a, b)   ((a) > (b))
 test if the first number is bigger to the second number
#define ldbl_EGlpNumIsLeq(a, b)   ((a) <= (b))
 test if the first number is bigger to the second number
#define ldbl_EGlpNumIsLess(a, b)   (a < b)
 test if the first number is bigger to the second number
#define ldbl_EGlpNumIsLessDbl(a, b)   ((a) < (b))
 test if the first number is bigger to the second number
#define ldbl_EGlpNumIsNeq(a, b, error)   (((a)-(b) > (error)) || ((b)-(a) > (error)))
#define ldbl_EGlpNumIsNeqq(a, b)   ((a) != (b))
#define ldbl_EGlpNumIsNeqqZero(a)   ((a) != 0.0)
#define ldbl_EGlpNumIsNeqZero(a, error)   (((a) > (error)) || (-(a) > (error)))
#define ldbl_EGlpNumIsSumLess(a, b, c)   ((a) + (b) < (c))
 test if the sum of the first two numbers is less thatn the third number.
#define ldbl_EGlpNumMultTo(a, b)   ((a) *= (b))
 Multiply a given number by the value of the second number.
#define ldbl_EGlpNumMultUiTo(a, b)   ((a) *= (b))
 Multiply a given number by the value of the second number.
#define ldbl_EGlpNumOne(a)   ((a) = 1.0L)
 Reset the value of the pointed number to one.
#define ldbl_EGlpNumReadStr(a, str)
 Read from a string a number and store it in the given long double,.
#define ldbl_EGlpNumReallocArray(lptr, lsize)
 Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1).
#define ldbl_EGlpNumSet(var, ldbl)   ((var) = (ldbl))
 set the given number pointer, set its value to the given long double.
#define ldbl_EGlpNumSetToMaxAbs(dest, orig)
 change the fist number to the maximum between itself and the absolute value of the second.
#define ldbl_EGlpNumSetToMinAbs(dest, orig)
#define ldbl_EGlpNumSign(a)   ((a) = -(a))
 Change the sign of the number.
#define ldbl_EGlpNumSubInnProdTo(a, b, c)   ((a) -= (b)*(c))
 Sub to a given number the product of two numbers.
#define ldbl_EGlpNumSubTo(a, b)   ((a) -= (b))
 Substract to a given number the value of the second number.
#define ldbl_EGlpNumSubUiTo(a, b)   ((a) -= (b))
 Substract to a given number the value of the second number.
#define ldbl_EGlpNumToLf(a)   ((double)(a))
 return the closest long double value of the given pointer number.
#define ldbl_EGlpNumZero(a)   ((a) = 0.0L)
 Reset the value of the pointed number to zero.
#define ldbl_epsLpNum   LDBL_EPSILON
#define ldbl_oneLpNum   1.0L
#define ldbl_zeroLpNum   0.0L
#define llint_EGlpNumAddInnProdTo(a, b, c)   ((a) += (b)*(c))
 Add to a given number the product of two numbers.
#define llint_EGlpNumAddTo(a, b)   ((a) += (b))
 Add to a given number the value of the second number.
#define llint_EGlpNumAddUiTo(a, b)   ((a) += (b))
 Add to a given number the value of the second number.
#define llint_EGlpNumAllocArray(size)   __EGlpNumAllocArray(long long int,size)
 Allocate and initialize (if needed) 'size' elements of type long long int and return it, if no more memory, exit(1).
#define llint_EGlpNumCeil(a, b)   llint_EGlpNumSet(a,b)
 Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
#define llint_EGlpNumClearVar(a)
 free the internal memory of a given variable
#define llint_EGlpNumCopy(dest, orig)   ((dest) = (orig))
 copy the value of the second number to the first.
#define llint_EGlpNumCopyAbs(dest, orig)   ((dest) = EGabs(orig))
 copy the value of the absolute value of the second parameter to the first parameter.
#define llint_EGlpNumCopyArray(dest, orig, size)   memcpy(dest,orig,sizeof(long long int)*(size))
 copy the first 'size' values in the second array to the first array.
#define llint_EGlpNumCopyDiff(dest, a, b)   ((dest) = (a) - (b))
 copy the value of the second number to the first.
#define llint_EGlpNumCopyDiffRatio(dest, a, b, den)   ((dest) = ((a) - (b)) / (den))
 copy the value of the second number to the first.
#define llint_EGlpNumCopyFrac(dest, op1, op2)   ((dest) = (op1)/(op2))
 Set des = op1/op2.
#define llint_EGlpNumCopyNeg(dest, orig)   ((dest) = -(orig))
 copy minus the value of the second parameter to the first parameter.
#define llint_EGlpNumCopySqrOver(dest, orig, den)   ((dest) = (orig)*(orig)/(den))
 copy the square of the second argument, divided by the third argument into the first argument.
#define llint_EGlpNumCopySum(dest, a, b)   ((dest) = (a) + (b))
 copy the value of the sum of the second and third parameter
#define llint_EGlpNumDivTo(a, b)   ((a) /= (b))
 Divide a given number by the value of the second number.
#define llint_EGlpNumDivUiTo(a, b)   ((a) /= (b))
 Divide a given number by the value of the second number.
#define llint_EGlpNumFloor(a, b)   llint_EGlpNumSet(a,b)
 Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
#define llint_EGlpNumFreeArray(ea)   __EGlpNumFreeArray(ea)
 given an array of type long long int, free it, if the pointer is NULL nothing happen.
#define llint_EGlpNumGetStr(a)
 given a long long int, write it to a string (to be allocated internally), and return it.
#define llint_EGlpNumInitVar(a)   llint_EGlpNumZero(a)
 initialize the internal memory of a given variable
#define llint_EGlpNumInv(a)   ((a) = 1/(a))
 store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
#define llint_EGlpNumIsDiffLess(a, b, c)   ((a) - (b) < (c))
 test if the diference of the first two numbers is less thatn the third number.
#define llint_EGlpNumIsEqqual(a, b)   ((a) == (b))
 Compare if two numbers are equal within a maximum error.
#define llint_EGlpNumIsEqual(a, b, error)   (EGabs((a)-(b)) <= (error))
 Compare if two numbers are equal within a maximum error.
#define llint_EGlpNumIsGreaDbl(a, b)   ((a) > (b))
 test if the first number is bigger to the second number
#define llint_EGlpNumIsLeq(a, b)   ((a) <= (b))
 test if the first number is bigger to the second number
#define llint_EGlpNumIsLess(a, b)   (a < b)
 test if the first number is bigger to the second number
#define llint_EGlpNumIsLessDbl(a, b)   ((a) < (b))
 test if the first number is bigger to the second number
#define llint_EGlpNumIsNeq(a, b, error)   (((a)-(b) > (error)) || ((b)-(a) > (error)))
#define llint_EGlpNumIsNeqq(a, b)   ((a) != (b))
#define llint_EGlpNumIsNeqqZero(a)   ((a) != 0)
#define llint_EGlpNumIsNeqZero(a, error)   (((a) > (error)) || (-(a) > (error)))
#define llint_EGlpNumIsSumLess(a, b, c)   ((a) + (b) < (c))
 test if the sum of the first two numbers is less thatn the third number.
#define llint_EGlpNumMultTo(a, b)   ((a) *= (b))
 Multiply a given number by the value of the second number.
#define llint_EGlpNumMultUiTo(a, b)   ((a) *= (b))
 Multiply a given number by the value of the second number.
#define llint_EGlpNumOne(a)   ((a) = 1)
 Reset the value of the pointed number to one.
#define llint_EGlpNumReadStr(a, str)
 Read from a string a number and store it in the given long long int,.
#define llint_EGlpNumReallocArray(lptr, lsize)
 Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1).
#define llint_EGlpNumSet(var, dbl_var)   ((var) = (dbl_var))
 set the given number pointer, set its value to the given long long int.
#define llint_EGlpNumSetToMaxAbs(dest, orig)
 change the fist number to the maximum between itself and the absolute value of the second.
#define llint_EGlpNumSetToMinAbs(dest, orig)
#define llint_EGlpNumSign(a)   ((a) = -(a))
 Change the sign of the number.
#define llint_EGlpNumSubInnProdTo(a, b, c)   ((a) -= (b)*(c))
 Sub to a given number the product of two numbers.
#define llint_EGlpNumSubTo(a, b)   ((a) -= (b))
 Substract to a given number the value of the second number.
#define llint_EGlpNumSubUiTo(a, b)   ((a) -= (b))
 Substract to a given number the value of the second number.
#define llint_EGlpNumToLf(a)   (a)
 return the closest long long int value of the given pointer number.
#define llint_EGlpNumZero(a)   ((a) = 0)
 Reset the value of the pointed number to zero.
#define llint_epsLpNum   0LL
#define llint_oneLpNum   1LL
#define llint_zeroLpNum   0LL
#define mpf_EGlpNumAddInnProdTo(a, b, c)
 Add to a given number the product of two numbers.
#define mpf_EGlpNumAddTo(a, b)   mpf_add(a,a,b)
 Add to a given number the value of the second number.
#define mpf_EGlpNumAddUiTo(a, b)   mpf_add_ui(a,a,((unsigned)(b)))
 Add to a given number the value of the second number.
#define mpf_EGlpNumAllocArray(size)
 Allocate and initialize (if needed) 'size' elements of type mpf_t and return it, if no more memory, exit(1).
#define mpf_EGlpNumCeil(a, b)   mpf_ceil(a,b)
 Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
#define mpf_EGlpNumClearVar(a)   mpf_clear(a)
 free the internal memory of a given variable
#define mpf_EGlpNumCopy(dest, orig)   mpf_set(dest,orig)
 copy the value of the second number to the first.
#define mpf_EGlpNumCopyAbs(dest, orig)   mpf_abs(dest,orig)
 copy the value of the absolute value of the second parameter to the first parameter.
#define mpf_EGlpNumCopyArray(dest, orig, size)
 copy the first 'size' values in the second array to the first array.
#define mpf_EGlpNumCopyDiff(dest, a, b)   mpf_sub(dest,a,b)
 copy the value of the second number to the first.
#define mpf_EGlpNumCopyDiffRatio(a, b, c, d)
 copy the value of the second number to the first.
#define mpf_EGlpNumCopyFrac(dest, op1, op2)   mpf_div(dest,op1,op2)
 Set des = op1/op2.
#define mpf_EGlpNumCopyNeg(dest, orig)   mpf_neg(dest,orig)
 copy minus the value of the second parameter to the first parameter.
#define mpf_EGlpNumCopySqrOver(dest, orig, den)
 copy the square of the second argument, divided by the third argument into the first argument.
#define mpf_EGlpNumCopySum(dest, a, b)   mpf_add(dest,a,b)
 copy the value of the sum of the second and third parameter
#define mpf_EGlpNumDivTo(a, b)   mpf_div(a,a,b)
 Divide a given number by the value of the second number.
#define mpf_EGlpNumDivUiTo(a, b)   mpf_div_ui(a,a,((unsigned)(b)))
 Divide a given number by the value of the second number.
#define mpf_EGlpNumEpow(num, exp)
 Given a double exp, compute $ e^{exp} $ and store it in the given mpf_t number.
#define mpf_EGlpNumFloor(a, b)   mpf_floor(a,b)
 Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
#define mpf_EGlpNumFreeArray(ea)
 given an array of type mpf_t, free it, if the pointer is NULL nothing happen.
#define mpf_EGlpNumGetStr(a)
 given a mpf_t, write it to a string (to be allocated internally), and return it.
#define mpf_EGlpNumInitVar(a)   mpf_init(a)
 initialize the internal memory of a given variable
#define mpf_EGlpNumInv(a)   mpf_ui_div(a,1U,a)
 store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
#define mpf_EGlpNumIsDiffLess(a, b, c)
 test if the diference of the first two numbers is less thatn the third number.
#define mpf_EGlpNumIsEqqual(a, b)   (mpf_cmp(a,b) == 0)
 Compare if two numbers are equal within a maximum error.
#define mpf_EGlpNumIsEqual(a, b, error)
 Compare if two numbers are equal within a maximum error.
#define mpf_EGlpNumIsGreaDbl(a, b)   (mpf_cmp_d(a,((double)(b))) > 0)
 test if the first number is bigger to the second number
#define mpf_EGlpNumIsLeq(a, b)   (mpf_cmp(a,b) <= 0)
 test if the first number is bigger to the second number
#define mpf_EGlpNumIsLess(a, b)   (mpf_cmp(a,b) < 0)
 test if the first number is bigger to the second number
#define mpf_EGlpNumIsLessDbl(a, b)   (mpf_cmp_d(a,((double)(b))) < 0)
 test if the first number is bigger to the second number
#define mpf_EGlpNumIsNeq(a, b, error)
#define mpf_EGlpNumIsNeqq(a, b)   (mpf_cmp(a,b)!=0)
#define mpf_EGlpNumIsNeqqZero(a)   (mpf_cmp(a,mpf_zeroLpNum)!=0)
#define mpf_EGlpNumIsNeqZero(a, error)
#define mpf_EGlpNumIsSumLess(a, b, c)
 test if the sum of the first two numbers is less thatn the third number.
#define mpf_EGlpNumMultTo(a, b)   mpf_mul(a,a,b)
 Multiply a given number by the value of the second number.
#define mpf_EGlpNumMultUiTo(a, b)   mpf_mul_ui(a,a,((unsigned)(b)))
 Multiply a given number by the value of the second number.
#define mpf_EGlpNumOne(a)   mpf_set_ui(a,1U)
 Reset the value of the pointed number to one.
#define mpf_EGlpNumReadStr(a, str)
 Read from a string a number and store it in the given mpf_t,.
#define mpf_EGlpNumReallocArray(lptr, lsize)
 Reallocate and initialize (if needed) 'size' elements of type mpf_t and return it, if no more memory, exit(1).
#define mpf_EGlpNumSet(var, dbl)   mpf_set_d(var,(double)(dbl))
 set the given number pointer, set its value to the given double.
#define mpf_EGlpNumSetToMaxAbs(dest, orig)
 change the fist number to the maximum between itself and the absolute value of the second.
#define mpf_EGlpNumSetToMinAbs(dest, orig)
#define mpf_EGlpNumSign(a)   mpf_neg(a,a)
 Change the sign of the number.
#define mpf_EGlpNumSubInnProdTo(a, b, c)
 Sub to a given number the product of two numbers.
#define mpf_EGlpNumSubTo(a, b)   mpf_sub(a,a,b)
 Substract to a given number the value of the second number.
#define mpf_EGlpNumSubUiTo(a, b)   mpf_sub_ui(a,a,((unsigned)(b)))
 Substract to a given number the value of the second number.
#define mpf_EGlpNumToLf(a)   mpf_get_d(a)
 return the closest double value of the given pointer number.
#define mpf_EGlpNumZero(a)   mpf_set_ui(a,0U)
 Reset the value of the pointed number to zero.
#define mpf_epsLpNum   mpf_eps
#define mpf_oneLpNum   __oneLpNum_mpf__
#define mpf_zeroLpNum   __zeroLpNum_mpf__
#define mpq_EGlpNumAddInnProdTo(a, b, c)
 Add to a given number the product of two numbers.
#define mpq_EGlpNumAddTo(a, b)   mpq_add(a,a,b)
 Add to a given number the value of the second number.
#define mpq_EGlpNumAddUiTo(a, b)   mpz_addmul_ui(mpq_numref(a),mpq_denref(a),b)
 Add to a given number the value of the second number.
#define mpq_EGlpNumAllocArray(size)
 Allocate and initialize (if needed) 'size' elements of type mpq_t and return it, if no more memory, exit(1).
#define mpq_EGlpNumCeil(a, b)
 Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
#define mpq_EGlpNumClearVar(a)   mpq_clear(a)
 free the internal memory of a given variable
#define mpq_EGlpNumCopy(dest, orig)   mpq_set(dest,orig)
 copy the value of the second number to the first.
#define mpq_EGlpNumCopyAbs(dest, orig)   mpq_abs(dest,orig)
 copy the value of the absolute value of the second parameter to the first parameter.
#define mpq_EGlpNumCopyArray(dest, orig, size)
 copy the first 'size' values in the second array to the first array.
#define mpq_EGlpNumCopyDiff(dest, a, b)   mpq_sub(dest,a,b)
 copy the value of the second number to the first.
#define mpq_EGlpNumCopyDiffRatio(a, b, c, d)
 copy the value of the second number to the first.
#define mpq_EGlpNumCopyFrac(dest, op1, op2)   mpq_div(dest,op1,op2)
 Set des = op1/op2.
#define mpq_EGlpNumCopyNeg(dest, orig)   mpq_neg(dest,orig)
 copy minus the value of the second parameter to the first parameter.
#define mpq_EGlpNumCopySqrOver(dest, orig, den)
 copy the square of the second argument, divided by the third argument into the first argument.
#define mpq_EGlpNumCopySum(dest, a, b)   mpq_add(dest,a,b)
 copy the value of the sum of the second and third parameter
#define mpq_EGlpNumDivTo(a, b)   mpq_div(a,a,b)
 Divide a given number by the value of the second number.
#define mpq_EGlpNumDivUiTo(a, b)   ({mpz_mul_ui(mpq_denref(a),mpq_denref(a),b);mpq_canonicalize(a);0;})
 Divide a given number by the value of the second number.
#define mpq_EGlpNumFloor(a, b)
 Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
#define mpq_EGlpNumFreeArray(ea)
 given an array of type mpq_t, free it, if the pointer is NULL nothing happen.
#define mpq_EGlpNumGetStr(a)   mpq_get_str(0,10,a)
 given a mpq_t, write it to a string (to be allocated internally), and return it.
#define mpq_EGlpNumInitVar(a)   mpq_init(a)
 initialize the internal memory of a given variable
#define mpq_EGlpNumInv(a)   mpq_inv(a,a)
 store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
#define mpq_EGlpNumIsDiffLess(a, b, c)
 test if the diference of the first two numbers is less thatn the third number.
#define mpq_EGlpNumIsEqqual(a, b)   (mpq_equal(a,b))
 Compare if two numbers are equal within a maximum error.
#define mpq_EGlpNumIsEqual(a, b, error)   (mpq_equal(a,b))
 Compare if two numbers are equal within a maximum error.
#define mpq_EGlpNumIsGreaDbl(a, b)   (mpq_get_d(a) > b)
 test if the first number is bigger to the second number
#define mpq_EGlpNumIsLeq(a, b)   (mpq_cmp(a,b) <= 0)
 test if the first number is bigger to the second number
#define mpq_EGlpNumIsLess(a, b)   (mpq_cmp(a,b) < 0)
 test if the first number is bigger to the second number
#define mpq_EGlpNumIsLessDbl(a, b)   (mpq_get_d(a) < b)
 test if the first number is bigger to the second number
#define mpq_EGlpNumIsNeq(a, b, error)   (!(mpq_equal(a,b)))
#define mpq_EGlpNumIsNeqq(a, b)   (!(mpq_equal(a,b)))
#define mpq_EGlpNumIsNeqqZero(a)   (!(mpq_equal(a,mpq_zeroLpNum)))
#define mpq_EGlpNumIsNeqZero(a, error)   (!(mpq_equal(a,mpq_zeroLpNum)))
#define mpq_EGlpNumIsSumLess(a, b, c)
 test if the sum of the first two numbers is less thatn the third number.
#define mpq_EGlpNumMultTo(a, b)   mpq_mul(a,a,b)
 Multiply a given number by the value of the second number.
#define mpq_EGlpNumMultUiTo(a, b)   ({mpz_mul_ui(mpq_numref(a),mpq_numref(a),b);mpq_canonicalize(a);0;})
 Multiply a given number by the value of the second number.
#define mpq_EGlpNumOne(a)   mpq_set_ui(a,1U,1U)
 Reset the value of the pointed number to one.
#define mpq_EGlpNumReadStr(a, str)   mpq_EGlpNumReadStrXc(a,str)
 Read from a string a number and store it in the given mpq_t, return the number of chars readed from the input string.
#define mpq_EGlpNumReallocArray(lptr, lsize)
 Reallocate and initialize (if needed) 'size' elements of type mpq_t and return it, if no more memory, exit(1).
#define mpq_EGlpNumSetToMaxAbs(dest, orig)
 change the fist number to the maximum between itself and the absolute value of the second.
#define mpq_EGlpNumSetToMinAbs(dest, orig)
#define mpq_EGlpNumSign(a)   mpq_neg(a,a)
 Change the sign of the number.
#define mpq_EGlpNumSubInnProdTo(a, b, c)
 Sub to a given number the product of two numbers.
#define mpq_EGlpNumSubTo(a, b)   mpq_sub(a,a,b)
 Substract to a given number the value of the second number.
#define mpq_EGlpNumSubUiTo(a, b)   mpz_submul_ui(mpq_numref(a),mpq_denref(a),b)
 Substract to a given number the value of the second number.
#define mpq_EGlpNumToLf(a)   mpq_get_d(a)
 return the closest double value of the given pointer number.
#define mpq_EGlpNumZero(a)   mpq_set_ui(a,0U,1U)
 Reset the value of the pointed number to zero.
#define mpq_epsLpNum   __zeroLpNum_mpq__
#define mpq_oneLpNum   __oneLpNum_mpq__
#define mpq_zeroLpNum   __zeroLpNum_mpq__
#define mpz_EGlpNumAddInnProdTo(a, b, c)
 Add to a given number the product of two numbers.
#define mpz_EGlpNumAddTo(a, b)   mpz_add(a,a,b)
 Add to a given number the value of the second number.
#define mpz_EGlpNumAddUiTo(a, b)   (mpz_addmul_ui(mpz_numref(a),mpz_denref(a),b),mpz_canonicalize(a))
 Add to a given number the value of the second number.
#define mpz_EGlpNumAllocArray(size)
 Allocate and initialize (if needed) 'size' elements of type mpz_t and return it, if no more memory, exit(1).
#define mpz_EGlpNumCeil(a, b)
 Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
#define mpz_EGlpNumClearVar(a)   mpz_clear(a)
 free the internal memory of a given variable
#define mpz_EGlpNumCopy(dest, orig)   mpz_set(dest,orig)
 copy the value of the second number to the first.
#define mpz_EGlpNumCopyAbs(dest, orig)   mpz_abs(dest,orig)
 copy the value of the absolute value of the second parameter to the first parameter.
#define mpz_EGlpNumCopyArray(dest, orig, size)
 copy the first 'size' values in the second array to the first array.
#define mpz_EGlpNumCopyDiff(dest, a, b)   mpz_sub(dest,a,b)
 copy the value of the second number to the first.
#define mpz_EGlpNumCopyDiffRatio(a, b, c, d)
 copy the value of the second number to the first.
#define mpz_EGlpNumCopyFrac(dest, op1, op2)   mpz_div(dest,op1,op2)
 Set des = op1/op2.
#define mpz_EGlpNumCopyNeg(dest, orig)   mpz_neg(dest,orig)
 copy minus the value of the second parameter to the first parameter.
#define mpz_EGlpNumCopySqrOver(dest, orig, den)
 copy the square of the second argument, divided by the third argument into the first argument.
#define mpz_EGlpNumCopySum(dest, a, b)   mpz_add(dest,a,b)
 copy the value of the sum of the second and third parameter
#define mpz_EGlpNumDivTo(a, b)   mpz_div(a,a,b)
 Divide a given number by the value of the second number.
#define mpz_EGlpNumDivUiTo(a, b)   (mpz_mul_ui(mpz_denref(a),mpz_denref(a),b),mpz_canonicalize(a))
 Divide a given number by the value of the second number.
#define mpz_EGlpNumFloor(a, b)
 Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
#define mpz_EGlpNumFreeArray(ea)
 given an array of type mpz_t, free it, if the pointer is NULL nothing happen.
#define mpz_EGlpNumGetStr(a)
 given a mpz_t, write it to a string (to be allocated internally), and return it.
#define mpz_EGlpNumInitVar(a)   mpz_init(a)
 initialize the internal memory of a given variable
#define mpz_EGlpNumInv(a)   mpz_inv(a,a)
 store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
#define mpz_EGlpNumIsDiffLess(a, b, c)
 test if the diference of the first two numbers is less thatn the third number.
#define mpz_EGlpNumIsEqqual(a, b)   (mpz_equal(a,b))
 Compare if two numbers are equal within a maximum error.
#define mpz_EGlpNumIsEqual(a, b, error)   (mpz_equal(a,b))
 Compare if two numbers are equal within a maximum error.
#define mpz_EGlpNumIsGreaDbl(a, b)   (mpz_get_d(a) > b)
 test if the first number is bigger to the second number
#define mpz_EGlpNumIsLeq(a, b)   (mpz_cmp(a,b) <= 0)
 test if the first number is bigger to the second number
#define mpz_EGlpNumIsLess(a, b)   (mpz_cmp(a,b) < 0)
 test if the first number is bigger to the second number
#define mpz_EGlpNumIsLessDbl(a, b)   (mpz_get_d(a) < b)
 test if the first number is bigger to the second number
#define mpz_EGlpNumIsNeq(a, b, error)   (!(mpz_equal(a,b)))
#define mpz_EGlpNumIsNeqq(a, b)   (!(mpz_equal(a,b)))
#define mpz_EGlpNumIsNeqqZero(a)   (!(mpz_equal(a,mpz_zeroLpNum)))
#define mpz_EGlpNumIsNeqZero(a, error)   (!(mpz_equal(a,mpz_zeroLpNum)))
#define mpz_EGlpNumIsSumLess(a, b, c)
 test if the sum of the first two numbers is less thatn the third number.
#define mpz_EGlpNumMultTo(a, b)   mpz_mul(a,a,b)
 Multiply a given number by the value of the second number.
#define mpz_EGlpNumMultUiTo(a, b)   (mpz_mul_ui(mpz_numref(a),mpz_numref(a),b),mpz_canonicalize(a))
 Multiply a given number by the value of the second number.
#define mpz_EGlpNumOne(a)   mpz_set_ui(a,1U,1U)
 Reset the value of the pointed number to one.
#define mpz_EGlpNumReallocArray(lptr, lsize)
 Reallocate and initialize (if needed) 'size' elements of type mpz_t and return it, if no more memory, exit(1).
#define mpz_EGlpNumSet   (var, dbl) mpz_set_d(var,dbl)
 set the given number pointer, set its value to the given double.
#define mpz_EGlpNumSetToMaxAbs(dest, orig)
 change the fist number to the maximum between itself and the absolute value of the second.
#define mpz_EGlpNumSetToMinAbs(dest, orig)
#define mpz_EGlpNumSign(a)   mpz_neg(a,a)
 Change the sign of the number.
#define mpz_EGlpNumSubInnProdTo(a, b, c)
 Sub to a given number the product of two numbers.
#define mpz_EGlpNumSubTo(a, b)   mpz_sub(a,a,b)
 Substract to a given number the value of the second number.
#define mpz_EGlpNumSubUiTo(a, b)   (mpz_submul_ui(mpz_numref(a),mpz_denref(a),b),mpz_canonicalize(a))
 Substract to a given number the value of the second number.
#define mpz_EGlpNumToLf(a)   mpz_get_d(a)
 return the closest double value of the given pointer number.
#define mpz_EGlpNumZero(a)   mpz_set_ui(a,0U,1U)
 Reset the value of the pointed number to zero.
#define mpz_epsLpNum   __zeroLpNum_mpz__
#define mpz_oneLpNum   __oneLpNum_mpz__
#define mpz_zeroLpNum   __zeroLpNum_mpz__

Functions

void EGlpNumExit (void)
 This function must be called at the end of the program to free all internal data used in the EGlpNum_t structures, once this function is called any operation on EGlpNum_t types may fail.
void EGlpNumSetPrecision (const unsigned prec)
 Change the default precision for mpf_t numbers.
void EGlpNumStart (void)
 This function must be called once to initialize internal data needed for all supported EGlpNum_t type.
int main (int argc, char **argv)
 Tester program for EGlpNum_t structure and functions.
int mpq_EGlpNumReadStrXc (mpq_t var, char const *str)
 This function read a number in float form and store it in an mpq_t variable, returning how many chars read to create the number, the twist is that it do an 'exact' transformation, in the sense that 0.33333333 will be stored as 33333333/100000000.
void mpq_EGlpNumSet (mpq_t var, const double dbl)
 set the given number pointer, set its value to the given double.
void mpq_EGlpNumSet_mpf (mpq_t var, mpf_t flt)
 set the given rational number , to the value to the value of the given mpf_t, this conversion is done using the continuous fraction method.
int mpz_EGlpNumReadStr (mpz_t a, const char *const str)
 Read from a string a number and store it in the given mpz_t, return the number of chars readed from the input string.

Variables

float128 __lpnum_float128__
mpf_t __lpnum_mpf__
mpq_t __lpnum_mpq__
mpz_t __lpnum_mpz__
float128 __oneLpNum_float128__
mpf_t __oneLpNum_mpf__
mpq_t __oneLpNum_mpq__
mpz_t __oneLpNum_mpz__
float128 __zeroLpNum_float128__
mpf_t __zeroLpNum_mpf__
mpq_t __zeroLpNum_mpq__
mpz_t __zeroLpNum_mpz__
 type-dependant constants and helper numbers
unsigned EGLPNUM_PRECISION
 Set the default number of __BITS__ used in the precision of the float point numbers (mpf_t), a normal double use up to 56-64 bits., the default precision is set to 128.
unsigned EGLPNUM_PRECISION = 128
 Set the default number of __BITS__ used in the precision of the float point numbers (mpf_t), a normal double use up to 56-64 bits., the default precision is set to 128.
float128 float128_eps
 This is the smallest difference (with the current precision) that can be distinguished betwen 1.0 and it's clossest representable number, in some sense it is the absolute minimum epsilon for comparisons.
mpf_t mpf_eps
 This is the smallest difference (with the current precision) that can be distinguished betwen 1.0 and it's clossest representable number, in some sense it is the absolute minimum epsilon for comparisons.
mpf_t mpf_eps
 This is the smallest difference (with the current precision) that can be distinguished betwen 1.0 and it's clossest representable number, in some sense it is the absolute minimum epsilon for comparisons.


Define Documentation

#define __EGlpNumAllocArray type,
size   ) 
 

Value:

({\
  unsigned __sz = (size);\
  unsigned *__utmp = __sz ? (unsigned*) EGmalloc (sizeof(type) * __sz + sizeof(unsigned)) : 0;\
  if(__sz) __utmp[0] = __sz;\
  (type*)(__sz ? (__utmp+1):0);})
Allocate an array of a given type and store (four bytes before the actual array) the size of the allocated array.

Parameters:
type the type of the array to be returned.
size the length of the array to be returned, note that it can be zero, in wich case no memory allocation is made and NULL is returned.

Definition at line 237 of file eg_lpnum.h.

#define __EGlpNumArraySize array   ) 
 

Value:

({\
  unsigned *__utmp = (unsigned*)(array);\
  if(__utmp) __utmp--;\
  __utmp ? __utmp[0]:0;})
Given an array allocated with __EGlpNumAllocArray, return the size of the given array, if the array is null, return zero.

Parameters:
array the array from where we need the size.

Definition at line 248 of file eg_lpnum.h.

#define __EGlpNumFreeArray array   ) 
 

Value:

({\
  unsigned *__utmp = (unsigned*)(array);\
  if(__utmp) free (__utmp-1);\
  (array) = 0;})
, given an array allocated by __EGlpNumAllocArray, free the allocated memory.

Parameters:
array the array to be freed, it can be null. The given array will always pooint to NULL when this function is done.

Definition at line 260 of file eg_lpnum.h.

#define dbl_EGlpNumAddInnProdTo a,
b,
 )     ((a) += (b)*(c))
 

Add to a given number the product of two numbers.

Parameters:
a EGlpNum_t the number that we are going to add to.
b EGlpNum_t value to be multiplyed.
c EGlpNum_t value to be multiplyed.
Description:
This function implements a = a + b*c, and clearly don't change the value stored in 'b' nor in 'c'.

Definition at line 336 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumAddTo a,
 )     ((a) += (b))
 

Add to a given number the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to add to.
b EGlpNum_t value to be added to 'a'.
Description:
This function implements a = a + b, and clearly don't change the value stored in 'b'.

Definition at line 366 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumAddUiTo a,
 )     ((a) += (b))
 

Add to a given number the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to add to.
b unsigned int value to be added to 'a'.
Description:
This function implements a = a + b, and clearly don't change the value stored in 'b'.

Definition at line 356 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumAllocArray size   )     __EGlpNumAllocArray(double,size)
 

Allocate and initialize (if needed) 'size' elements of type double and return it, if no more memory, exit(1).

Definition at line 78 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCeil a,
 )     ((a) = ceil(b))
 

Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).

Definition at line 97 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumClearVar  ) 
 

free the internal memory of a given variable

Definition at line 462 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCopy dest,
orig   )     ((dest) = (orig))
 

copy the value of the second number to the first.

Parameters:
orig EGlpNum_t source number (it won't change value).
dest EGlpNum_t where to store the value stored in 'orig'.
Description:
Given two numbers copy the values in 'orig', into 'dest'.

Definition at line 240 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCopyAbs dest,
orig   )     ((dest) = fabs(orig))
 

copy the value of the absolute value of the second parameter to the first parameter.

Parameters:
orig EGlpNum_t source number (it won't change value).
dest EGlpNum_t where to store the absolute value stored in 'orig'.
Description:
Given a number 'orig', copy its absolute value to 'dest'. i.e. dest = |orig|

Definition at line 276 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCopyArray dest,
orig,
size   )     memcpy(dest,orig,sizeof(double)*(size))
 

copy the first 'size' values in the second array to the first array.

Parameters:
orig EGlpNum_t* pointer to the array from where we will copy the values (it won't change value).
dest EGlpNum_t* pointer to where to store the first 'size' values stored in 'orig'.
size unsigned int specifying how many values of 'orig' will be copied onto 'dest'
Description:
This function is provided to (possible) make fast copies of arrays of numbers, the arrays should be of length at least 'size', and the resulting copy is absolutely independent froom the original, any change in one vale of one array won't change values on the other array.

Definition at line 314 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCopyDiff dest,
a,
 )     ((dest) = (a) - (b))
 

copy the value of the second number to the first.

Parameters:
a EGlpNum_t source number (it won't change value).
b EGlpNum_t source number (it won't change value).
dest EGlpNum_t where to store the value stored in 'orig'.
Description:
Set dest = a - b

Definition at line 222 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCopyDiffRatio dest,
a,
b,
den   )     ((dest) = ((a) - (b)) / (den))
 

copy the value of the second number to the first.

Parameters:
a EGlpNum_t source number (it won't change value).
b EGlpNum_t source number (it won't change value).
den EGlpNum_t denominator of the difference (it won't change value).
dest EGlpNum_t where to store the value .
Description:
Set dest = (a - b) / den

Definition at line 213 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCopyFrac dest,
op1,
op2   )     ((dest) = (op1)/(op2))
 

Set des = op1/op2.

Parameters:
dest EGlpNum_t where we will store the result.
op1 EGlpNum_t numerator of the fraction (possibly non an integer)
op2 EGlpNum_t denominator of the fraction (possibly non an integer)
Description:
Set des = op1/op2

Definition at line 298 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCopyNeg dest,
orig   )     ((dest) = -(orig))
 

copy minus the value of the second parameter to the first parameter.

Parameters:
orig EGlpNum_t the source number (it won't change value).
dest EGlpNum_t where to store minus the value stored in 'orig'.
Description:
Given a number 'orig', copy minus the value to 'dest'. i.e. dest = -orig

Definition at line 288 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCopySqrOver dest,
orig,
den   )     ((dest) = (orig)*(orig)/(den))
 

copy the square of the second argument, divided by the third argument into the first argument.

Parameters:
dest EGlpNum_t where to store the result
orig EGlpNum_t second parameter
den EGlpNum_t third parameter
Description:
compute dest = (orig*orig)/den

Definition at line 264 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumCopySum dest,
a,
 )     ((dest) = (a) + (b))
 

copy the value of the sum of the second and third parameter

Parameters:
a EGlpNum_t source number (it won't change value).
b EGlpNum_t source number (it won't change value).
dest EGlpNum_t where to store the sum.
Description:
Set dest = a + b

Definition at line 231 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumDivTo a,
 )     ((a) /= (b))
 

Divide a given number by the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to divide by the second number and store the result.
b EGlpNum_t value to be divide to 'a'.
Description:
This function implements a = a / b, and clearly don't change the value stored in 'b'.

Definition at line 399 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumDivUiTo a,
 )     ((a) /= (b))
 

Divide a given number by the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to divide by the second number and store the result.
b unsigned int value to be divided to 'a'.
Description:
This function implements a = a / b, and don't change the value stored in 'b'.

Definition at line 410 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumFloor a,
 )     ((a) = floor(b))
 

Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).

Definition at line 102 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumFreeArray ea   )     __EGlpNumFreeArray(ea)
 

given an array of type double, free it, if the pointer is NULL nothing happen.

Definition at line 55 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumGetStr  ) 
 

Value:

({\
  char *__str=0;\
  unsigned int __i=snprintf(__str,0,"%.7lg",a);\
  __str = EGsMalloc(char,__i+1);\
  snprintf(__str,__i+1,"%.7lg",a);\
  __str;})
given a double, write it to a string (to be allocated internally), and return it.

Definition at line 45 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumInitVar  )     dbl_EGlpNumZero(a)
 

initialize the internal memory of a given variable

Definition at line 458 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumInv  )     ((a) = 1.0/(a))
 

store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.

Parameters:
a the number to be inverted.

Definition at line 108 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsDiffLess a,
b,
 )     ((a) - (b) < (c))
 

test if the diference of the first two numbers is less thatn the third number.

Parameters:
a EGlpNum_t the first number.
b EGlpNum_t the second number
c EGlpNum_t the third number
Returns:
int one if success, zero otherwise.
Description:
Given a,b, and c, return nonzero if (a - b < c), zero toherwise.

Definition at line 170 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsEqqual a,
 )     ((a) == (b))
 

Compare if two numbers are equal within a maximum error.

Parameters:
a EGlpNum_t first number to compare.
b EGlpNum_t second number to compare.
Returns:
int one in success, zero oterwise.
Description:
Given two numbers 'a','b' return 1 if a == b, otherwise it return 0

Definition at line 118 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsEqual a,
b,
error   )     (fabs((a)-(b)) <= (error))
 

Compare if two numbers are equal within a maximum error.

Parameters:
a EGlpNum_t first number to compare.
b EGlpNum_t second number to compare.
error EGlpNum_t maximum difference allowed between both numbers.
Returns:
int one in success, zero oterwise.
Description:
Given two numbers 'a','b' and a tolerance 'error', return 1 if |a-b|<= error, otherwise it return 0.

Definition at line 131 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsGreaDbl a,
 )     ((a) > (b))
 

test if the first number is bigger to the second number

Parameters:
a EGlpNum_t the first number.
b double the second number
Returns:
int one if success, zero otherwise.
Description:
Given two numbers 'a' and 'b', return one if a > b, zero otherwise.

Definition at line 192 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsLeq a,
 )     ((a) <= (b))
 

test if the first number is bigger to the second number

Parameters:
a EGlpNum_t the first number.
b EGlpNum_t the second number
Returns:
int one if success, zero otherwise.
Description:
Given two numbers 'a' and 'b', return one if a <= b, zero otherwise.

Definition at line 203 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsLess a,
 )     (a < b)
 

test if the first number is bigger to the second number

Parameters:
a EGlpNum_t the first number.
b EGlpNum_t the second number
Returns:
int one if success, zero otherwise.
Description:
Given two numbers 'a' and 'b', return one if a < b, zero otherwise.

Definition at line 146 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsLessDbl a,
 )     ((a) < (b))
 

test if the first number is bigger to the second number

Parameters:
a EGlpNum_t the first number.
b double the second number
Returns:
int one if success, zero otherwise.
Description:
Given two numbers 'a' and 'b', return one if a < b, zero otherwise.

Definition at line 181 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsNeq a,
b,
error   )     (((a)-(b) > (error)) || ((b)-(a) > (error)))
 

Definition at line 132 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsNeqq a,
 )     ((a) != (b))
 

Definition at line 133 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsNeqqZero  )     ((a) != 0.0)
 

Definition at line 135 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsNeqZero a,
error   )     (((a) > (error)) || (-(a) > (error)))
 

Definition at line 134 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumIsSumLess a,
b,
 )     ((a) + (b) < (c))
 

test if the sum of the first two numbers is less thatn the third number.

Parameters:
a EGlpNum_t the first number.
b EGlpNum_t the second number
c EGlpNum_t the third number
Returns:
int one if success, zero otherwise.
Description:
Given a,b, and c, return nonzero if (a + b < c), zero toherwise.

Definition at line 158 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumMultTo a,
 )     ((a) *= (b))
 

Multiply a given number by the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to multiply by the second number and store the result.
b EGlpNum_t value to be multyply to 'a'.
Description:
This function implements a = a * b, and clearly don't change the value stored in 'b'.

Definition at line 388 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumMultUiTo a,
 )     ((a) *= (b))
 

Multiply a given number by the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to multiply by the second number and store the result.
b unsigned int value to be multyply to 'a'.
Description:
This function implements a = a * b, and clearly don't change the value stored in 'b'.

Definition at line 421 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumOne  )     ((a) = 1.0)
 

Reset the value of the pointed number to one.

Parameters:
a EGlpNum_t value to be set to one.
Descrpition:
Reset a to zero, i.e. implements a = 1;

Definition at line 437 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumReadStr a,
str   ) 
 

Value:

({\
  int __i =0;\
  sscanf(str,"%lf%n",&(a),&__i);\
  __i;})
Read from a string a number and store it in the given double,.

Returns:
the number of chars readed from the input string

Definition at line 37 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumReallocArray lptr,
lsize   ) 
 

Value:

({\
  unsigned __csz = (lsize), *__usp = 0;\
  unsigned __psz = __EGlpNumArraySize(*lptr);\
  double** __ptr__ = (lptr);\
  if (!__psz) *__ptr__ = dbl_EGlpNumAllocArray (__csz); \
  else if (__psz < __csz) {\
    __usp = (unsigned*)(*__ptr__);\
    __usp--;\
    __usp = EGrealloc(__usp, sizeof(double)*__csz+sizeof(unsigned));\
    __usp[0] = __csz;\
    *__ptr__ = (double*)(__usp+1);\
    memset((*__ptr__)+__psz,0,sizeof(double)*(__csz-__psz));\
  }\
  *__ptr__;})
Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1).

Definition at line 60 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumSet var,
dbl   )     ((var) = (dbl))
 

set the given number pointer, set its value to the given double.

Parameters:
var double where we will store the double value.
dbl double value to be stored in 'var'.
Description:
This function is intended to set initial values to variables; note that the double is a number and not a pointer to that value, be carefull with this detail. Also, due to implementation details this function can't deal with numbers above 1e158 or smaller than 1e-158. Note also that if the number is writen in the form $x=\bar{x}\cdot 2^e$ with $0.5<|\bar{x}|<1$ , then $\left|x-\frac{p}{q}\right|<2^{e-64}$ .

Definition at line 92 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumSetToMaxAbs dest,
orig   ) 
 

Value:

if((dest) < fabs(orig)) \
                                              (dest) = fabs(orig)
change the fist number to the maximum between itself and the absolute value of the second.

Parameters:
orig EGlpNum_t source number (it won't change value).
dest EGlpNum_t where to store the value stored in 'orig'.
Description:
implement dest = max(dest,abs(orig))

Definition at line 250 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumSetToMinAbs dest,
orig   ) 
 

Value:

if((dest) > fabs(orig)) \
                                              (dest) = fabs(orig)

Definition at line 252 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumSign  )     ((a) = -(a))
 

Change the sign of the number.

Parameters:
a EGlpNum_t number we will change sign.
Descrpition:
Change the sign of the given number, i.e. implements a = -a

Definition at line 445 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumSubInnProdTo a,
b,
 )     ((a) -= (b)*(c))
 

Sub to a given number the product of two numbers.

Parameters:
a EGlpNum_t the number that we are going to Sub to.
b EGlpNum_t value to be multiplyed.
c EGlpNum_t value to be multiplyed.
Description:
This function implements a = a - b*c, and clearly don't change the value stored in 'b' nor in 'c'.

Definition at line 325 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumSubTo a,
 )     ((a) -= (b))
 

Substract to a given number the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to substract from.
b EGlpNum_t value to be substracted to 'a'.
Description:
This function implements a = a - b, and clearly don't change the value stored in 'b'.

Definition at line 377 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumSubUiTo a,
 )     ((a) -= (b))
 

Substract to a given number the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to substract to.
b unsigned int value to be substracted to 'a'.
Description:
This function implements a = a - b, and clearly don't change the value stored in 'b'.

Definition at line 346 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumToLf  )     (a)
 

return the closest double value of the given pointer number.

Parameters:
a EGlpNum_t number that we will be transformed to double.
Returns:
double the closest double representation of the given number. par Description: return the double number closest in value to the value stored in a.

Definition at line 454 of file eg_lpnum.dbl.h.

#define dbl_EGlpNumZero  )     ((a) = 0.0)
 

Reset the value of the pointed number to zero.

Parameters:
a EGlpNum_t the value to be set to zero.
Descrpition:
Reset a to zero, i.e. implements a = 0;

Definition at line 429 of file eg_lpnum.dbl.h.

#define dbl_epsLpNum   DBL_EPSILON
 

Definition at line 32 of file eg_lpnum.dbl.h.

#define dbl_oneLpNum   1.0
 

Definition at line 31 of file eg_lpnum.dbl.h.

#define dbl_zeroLpNum   0.0
 

extern definitions of constaants for different set-ups

Definition at line 30 of file eg_lpnum.dbl.h.

#define EGabs var   ) 
 

Value:

({\
    const typeof(var) __EGav = (var);\
    (__EGav < 0) ? -__EGav : __EGav;})
a general macro to return the absolute value of the given variable

Parameters:
var variable whose absolute value we want to compute.
Returns:
value of the absolute value of the given variable, note that this macro will only work in built-in types, and will use the default comparison for those internal types.

Definition at line 200 of file eg_lpnum.h.

#define EGLPNUM_DEBUGL   100
 

Debugging verbosity messages deped on the value of DEBUG (defined in eg_configure.h) and on the value of EGLPNUM_DEBUGL macro defined here.

Definition at line 148 of file eg_lpnum.h.

#define EGLPNUM_ISFP   1
 

Definition at line 471 of file eg_lpnum.dbl.h.

#define EGLPNUM_MAXCONVORDER   2U
 

This are the definitions needed to use double numbers within our general framework

Definition at line 469 of file eg_lpnum.dbl.h.

#define EGLPNUM_MINEPS   3e-10
 

This constant define the of the acuracy required while converting doubles to rationals, a good number is 1e-5. More exactly, we stop the continued fraction method whenever the next e_i-[e_i] computed is less than EGLPNUM_MINEPS. Note that this value can't be smaller than 1/ULONG_MAX, otherwise we will have problems in the confertion step.

Definition at line 157 of file eg_lpnum.h.

#define EGlpNum_t   double
 

Examples:
eg_dmatrix.ex.c, eg_eheap.ex.c, eg_min_cut.ex.c, eg_push_relabel.ex.c, and eg_shrink_graph.ex.c.

Definition at line 475 of file eg_lpnum.dbl.h.

#define EGLPNUM_TYPE   DBL_TYPE
 

default type for EGLPNUM_TYPE

Description:
If the type of number for EGlpNum is not defined beforehand (eg. eg_config.h or through make.conf) we default to GNU_MP_Q. available options:
  • GNU_MP_Q
  • GNU_MP_F
  • DBL_TYPE
  • LDBL_TYPE

Definition at line 278 of file eg_lpnum.h.

#define EGlpNumAddInnProdTo a,
b,
 )     dbl_EGlpNumAddInnProdTo(a,b,c)
 

Definition at line 478 of file eg_lpnum.dbl.h.

#define EGlpNumAddTo a,
 )     dbl_EGlpNumAddTo(a,b)
 

Definition at line 476 of file eg_lpnum.dbl.h.

#define EGlpNumAddUiTo a,
 )     dbl_EGlpNumAddUiTo(a,b)
 

Definition at line 477 of file eg_lpnum.dbl.h.

#define EGlpNumAllocArray size   )     dbl_EGlpNumAllocArray(size)
 

Definition at line 479 of file eg_lpnum.dbl.h.

#define EGlpNumCeil a,
 )     dbl_EGlpNumCeil(a,b)
 

Definition at line 480 of file eg_lpnum.dbl.h.

#define EGlpNumClearVar  )     dbl_EGlpNumClearVar(a)
 

Examples:
eg_dmatrix.ex.c, eg_eheap.ex.c, eg_min_cut.ex.c, eg_push_relabel.ex.c, and eg_shrink_graph.ex.c.

Definition at line 481 of file eg_lpnum.dbl.h.

#define EGlpNumCopy dest,
orig   )     dbl_EGlpNumCopy(dest,orig)
 

Examples:
eg_dmatrix.ex.c, eg_min_cut.ex.c, eg_push_relabel.ex.c, and eg_shrink_graph.ex.c.

Definition at line 482 of file eg_lpnum.dbl.h.

#define EGlpNumCopyAbs dest,
orig   )     dbl_EGlpNumCopyAbs(dest,orig)
 

Definition at line 488 of file eg_lpnum.dbl.h.

#define EGlpNumCopyArray dest,
orig,
size   )     dbl_EGlpNumCopyArray(dest,orig,size)
 

Definition at line 483 of file eg_lpnum.dbl.h.

#define EGlpNumCopyDiff dest,
a,
 )     dbl_EGlpNumCopyDiff(dest,a,b)
 

Definition at line 484 of file eg_lpnum.dbl.h.

#define EGlpNumCopyDiffRatio a,
b,
c,
 )     dbl_EGlpNumCopyDiffRatio(a,b,c,d)
 

Definition at line 485 of file eg_lpnum.dbl.h.

#define EGlpNumCopyFrac dest,
op1,
op2   )     dbl_EGlpNumCopyFrac(dest,op1,op2)
 

Definition at line 490 of file eg_lpnum.dbl.h.

#define EGlpNumCopyNeg dest,
orig   )     dbl_EGlpNumCopyNeg(dest,orig)
 

Definition at line 489 of file eg_lpnum.dbl.h.

#define EGlpNumCopySqrOver dest,
orig,
den   )     dbl_EGlpNumCopySqrOver(dest,orig,den)
 

Definition at line 487 of file eg_lpnum.dbl.h.

#define EGlpNumCopySum dest,
a,
 )     dbl_EGlpNumCopySum(dest,a,b)
 

Examples:
eg_min_cut.ex.c.

Definition at line 486 of file eg_lpnum.dbl.h.

#define EGlpNumDivTo a,
 )     dbl_EGlpNumDivTo(a,b)
 

Definition at line 491 of file eg_lpnum.dbl.h.

#define EGlpNumDivUiTo a,
 )     dbl_EGlpNumDivUiTo(a,b)
 

Examples:
eg_dmatrix.ex.c.

Definition at line 492 of file eg_lpnum.dbl.h.

#define EGlpNumFloor a,
 )     dbl_EGlpNumFloor(a,b)
 

Definition at line 493 of file eg_lpnum.dbl.h.

#define EGlpNumFreeArray ea   )     dbl_EGlpNumFreeArray(ea)
 

Definition at line 494 of file eg_lpnum.dbl.h.

#define EGlpNumGetStr  )     dbl_EGlpNumGetStr(a)
 

Definition at line 495 of file eg_lpnum.dbl.h.

#define EGlpNumInitVar  )     dbl_EGlpNumInitVar(a)
 

Examples:
eg_dmatrix.ex.c, eg_eheap.ex.c, eg_min_cut.ex.c, eg_push_relabel.ex.c, and eg_shrink_graph.ex.c.

Definition at line 496 of file eg_lpnum.dbl.h.

#define EGlpNumInv  )     dbl_EGlpNumInv(a)
 

Definition at line 497 of file eg_lpnum.dbl.h.

#define EGlpNumIsDiffLess a,
b,
 )     dbl_EGlpNumIsDiffLess(a,b,c)
 

Definition at line 498 of file eg_lpnum.dbl.h.

#define EGlpNumIsEqqual a,
 )     dbl_EGlpNumIsEqqual(a,b)
 

Definition at line 499 of file eg_lpnum.dbl.h.

#define EGlpNumIsEqual a,
b,
error   )     dbl_EGlpNumIsEqual(a,b,error)
 

Definition at line 500 of file eg_lpnum.dbl.h.

#define EGlpNumIsGreaDbl a,
 )     dbl_EGlpNumIsGreaDbl(a,b)
 

Definition at line 501 of file eg_lpnum.dbl.h.

#define EGlpNumIsLeq a,
 )     dbl_EGlpNumIsLeq(a,b)
 

Definition at line 504 of file eg_lpnum.dbl.h.

#define EGlpNumIsLess a,
 )     dbl_EGlpNumIsLess(a,b)
 

Definition at line 503 of file eg_lpnum.dbl.h.

#define EGlpNumIsLessDbl a,
 )     dbl_EGlpNumIsLessDbl(a,b)
 

Definition at line 502 of file eg_lpnum.dbl.h.

#define EGlpNumIsNeq a,
b,
error   )     dbl_EGlpNumIsNeq(a,b,error)
 

Definition at line 505 of file eg_lpnum.dbl.h.

#define EGlpNumIsNeqq a,
 )     dbl_EGlpNumIsNeqq(a,b)
 

Definition at line 506 of file eg_lpnum.dbl.h.

#define EGlpNumIsNeqqZero  )     dbl_EGlpNumIsNeqqZero(a)
 

Definition at line 508 of file eg_lpnum.dbl.h.

#define EGlpNumIsNeqZero a,
error   )     dbl_EGlpNumIsNeqZero(a,error)
 

Definition at line 507 of file eg_lpnum.dbl.h.

#define EGlpNumIsSumLess a,
b,
 )     dbl_EGlpNumIsSumLess(a,b,c)
 

Definition at line 509 of file eg_lpnum.dbl.h.

#define EGlpNumMultTo a,
 )     dbl_EGlpNumMultTo(a,b)
 

Definition at line 510 of file eg_lpnum.dbl.h.

#define EGlpNumMultUiTo a,
 )     dbl_EGlpNumMultUiTo(a,b)
 

Examples:
eg_dmatrix.ex.c.

Definition at line 511 of file eg_lpnum.dbl.h.

#define EGlpNumOne  )     dbl_EGlpNumOne(a)
 

Examples:
eg_dmatrix.ex.c.

Definition at line 512 of file eg_lpnum.dbl.h.

#define EGlpNumReadStr a,
str   )     dbl_EGlpNumReadStr(a,str)
 

Examples:
eg_eheap.ex.c, eg_min_cut.ex.c, eg_push_relabel.ex.c, and eg_shrink_graph.ex.c.

Definition at line 513 of file eg_lpnum.dbl.h.

#define EGlpNumReallocArray lptr,
size   )     dbl_EGlpNumReallocArray(lptr,size)
 

Definition at line 514 of file eg_lpnum.dbl.h.

#define EGlpNumSet var,
dbl   )     dbl_EGlpNumSet(var,dbl)
 

Examples:
eg_memslab.ex.c, and eg_min_cut.ex.c.

Definition at line 515 of file eg_lpnum.dbl.h.

#define EGlpNumSetToMaxAbs dest,
orig   )     dbl_EGlpNumSetToMaxAbs(dest,orig)
 

Definition at line 516 of file eg_lpnum.dbl.h.

#define EGlpNumSetToMinAbs dest,
orig   )     dbl_EGlpNumSetToMinAbs(dest,orig)
 

Definition at line 517 of file eg_lpnum.dbl.h.

#define EGlpNumSign  )     dbl_EGlpNumSign(a)
 

Definition at line 518 of file eg_lpnum.dbl.h.

#define EGlpNumSubInnProdTo a,
b,
 )     dbl_EGlpNumSubInnProdTo(a,b,c)
 

Definition at line 521 of file eg_lpnum.dbl.h.

#define EGlpNumSubTo a,
 )     dbl_EGlpNumSubTo(a,b)
 

Examples:
eg_dmatrix.ex.c.

Definition at line 519 of file eg_lpnum.dbl.h.

#define EGlpNumSubUiTo a,
 )     dbl_EGlpNumSubUiTo(a,b)
 

Definition at line 520 of file eg_lpnum.dbl.h.

#define EGlpNumToLf  )     dbl_EGlpNumToLf(a)
 

Examples:
eg_dmatrix.ex.c, eg_eheap.ex.c, eg_min_cut.ex.c, eg_push_relabel.ex.c, and eg_shrink_graph.ex.c.

Definition at line 522 of file eg_lpnum.dbl.h.

#define EGlpNumZero  )     dbl_EGlpNumZero(a)
 

Examples:
eg_eheap.ex.c.

Definition at line 523 of file eg_lpnum.dbl.h.

#define EGmax a,
 ) 
 

Value:

({\
  const typeof(a) __EGma = (a);\
  const typeof(b) __EGmb = (b);\
  (__EGma > __EGmb ? __EGma : __EGmb);})
given two variables (of the same type, and of some predefined type) return the maximum value among the two of them.

Definition at line 181 of file eg_lpnum.h.

#define EGmin a,
 ) 
 

Value:

({\
  const typeof(a) __EGma = (a);\
  const typeof(b) __EGmb = (b);\
  (__EGma < __EGmb ? __EGma : __EGmb);})
given two variables (of the same type, and of some predefined type) return the minimum value among the two of them.

Examples:
eg_dmatrix.ex.c.

Definition at line 189 of file eg_lpnum.h.

#define EGswap N1,
N2,
Ntmp   ) 
 

Value:

do{\
  Ntmp = N1;\
  N1 = N2;\
  N2 = Ntmp;} while(0)
Given tree numbers N1, N2 and Ntmp, swap values of N1 and N2 using Ntmp as a temporal number. The variables should be of some primitive type of C for this macro to work.

Parameters:
N1 first number.
N2 second number.
Ntmp temporal variable.

Definition at line 173 of file eg_lpnum.h.

#define epsLpNum   dbl_epsLpNum
 

Examples:
eg_dmatrix.ex.c, eg_min_cut.ex.c, and eg_push_relabel.ex.c.

Definition at line 472 of file eg_lpnum.dbl.h.

#define float128_EGlpNumAddInnProdTo a,
b,
 ) 
 

Value:

({\
  __lpnum_float128__ = float128_mul ( b, c);\
  (a) = float128_add (a, __lpnum_float128__);\
})
Add to a given number the product of two numbers.

Parameters:
a float128 the number that we are going to add to.
b float128 value to be multiplyed.
c float128 value to be multiplyed.
Description:
This function implements a = a + b*c, and clearly don't change the value stored in 'b' nor in 'c'.

Definition at line 450 of file eg_lpnum.float128.h.

#define float128_EGlpNumAddTo a,
 )     ((a) = float128_add(a,b))
 

Add to a given number the value of the second number.

Parameters:
a float128 the number that we are going to add to.
b float128 value to be added to 'a'.
Description:
This function implements a = a + b, and clearly don't change the value stored in 'b'.

Definition at line 487 of file eg_lpnum.float128.h.

#define float128_EGlpNumAddUiTo a,
 ) 
 

Value:

({\
  __lpnum_float128__ = int64_to_float128((long long)(b));\
  (a) = float128_add(a,__lpnum_float128__);})
Add to a given number the value of the second number.

Parameters:
a float128 the number that we are going to add to.
b unsigned int value to be added to 'a'.
Description:
This function implements a = a + b, and clearly don't change the value stored in 'b'.

Definition at line 475 of file eg_lpnum.float128.h.

#define float128_EGlpNumAllocArray size   ) 
 

Value:

({\
  register unsigned __i__ = (size);\
  float128 *__res = __EGlpNumAllocArray(float128,__i__);\
  while(__i__--) __res[__i__] = (float128){0,0};\
  __res;})
Allocate and initialize (if needed) 'size' elements of type float128 and return it, if no more memory, exit(1).

Definition at line 138 of file eg_lpnum.float128.h.

#define float128_EGlpNumCeil a,
 ) 
 

Value:

do{\
  (a) = float128_round_to_int(b);\
  if(float128_lt(a,b)) (a) = float128_add((a),float128_oneLpNum);} while(0)
Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).

Definition at line 163 of file eg_lpnum.float128.h.

#define float128_EGlpNumClearVar  ) 
 

free the internal memory of a given variable

Definition at line 589 of file eg_lpnum.float128.h.

#define float128_EGlpNumCopy dest,
orig   )     (dest=orig)
 

copy the value of the second number to the first.

Parameters:
orig float128 source number (it won't change value).
dest float128 where to store the value stored in 'orig'.
Description:
Given two numbers copy the values in 'orig', into 'dest'.

Definition at line 339 of file eg_lpnum.float128.h.

#define float128_EGlpNumCopyAbs dest,
orig   ) 
 

Value:

({\
  (dest) = (orig);\
  (dest).high &= 0x7fffffffffffffffLL;})
copy the value of the absolute value of the second parameter to the first parameter.

Parameters:
orig float128 source number (it won't change value).
dest float128 where to store the absolute value stored in 'orig'.
Description:
Given a number 'orig', copy its absolute value to 'dest'. i.e. dest = |orig|

Definition at line 383 of file eg_lpnum.float128.h.

#define float128_EGlpNumCopyArray dest,
orig,
size   )     memcpy(dest,orig,sizeof(float128)*(size))
 

copy the first 'size' values in the second array to the first array.

Parameters:
orig float128* pointer to the array from where we will copy the values (it won't change value).
dest float128* pointer to where to store the first 'size' values stored in 'orig'.
size unsigned int specifying how many values of 'orig' will be copied onto 'dest'
Description:
This function is provided to (possible) make fast copies of arrays of numbers, the arrays should be of length at least 'size', and the resulting copy is absolutely independent froom the original, any change in one vale of one array won't change values on the other array.

Definition at line 425 of file eg_lpnum.float128.h.

#define float128_EGlpNumCopyDiff dest,
a,
 )     (dest = float128_sub(a,b))
 

copy the value of the second number to the first.

Parameters:
a float128 source number (it won't change value).
b float128 source number (it won't change value).
dest float128 where to store the value stored in 'orig'.
Description:
Set dest = a - b

Definition at line 321 of file eg_lpnum.float128.h.

#define float128_EGlpNumCopyDiffRatio a,
b,
c,
 ) 
 

Value:

({\
  __lpnum_float128__ = float128_sub (b, c);\
  a = float128_div (__lpnum_float128__, d);\
})
copy the value of the second number to the first.

Parameters:
a float128 source number (it won't change value).
b float128 source number (it won't change value).
c float128 denominator of the difference (it won't change value).
d float128 where to store the value .
Description:
Set $a = \frac{b - c}{d} $

Definition at line 309 of file eg_lpnum.float128.h.

#define float128_EGlpNumCopyFrac dest,
op1,
op2   )     ((dest) = float128_div(op1,op2))
 

Set des = op1/op2.

Parameters:
dest float128 where we will store the result.
op1 float128 numerator of the fraction (possibly non an integer)
op2 float128 denominator of the fraction (possibly non an integer)
Description:
Set des = op1/op2

Definition at line 409 of file eg_lpnum.float128.h.

#define float128_EGlpNumCopyNeg dest,
orig   ) 
 

Value:

({\
  (dest) = (orig);\
  (dest).high ^= 0x8000000000000000LL;})
copy minus the value of the second parameter to the first parameter.

Parameters:
orig float128 the source number (it won't change value).
dest float128 where to store minus the value stored in 'orig'.
Description:
Given a number 'orig', copy minus the value to 'dest'. i.e. dest = -orig

Definition at line 397 of file eg_lpnum.float128.h.

#define float128_EGlpNumCopySqrOver dest,
orig,
den   ) 
 

Value:

({\
  __lpnum_float128__ = float128_mul (orig, orig);\
  (dest) = float128_div ( __lpnum_float128__, den);\
})
copy the square of the second argument, divided by the third argument into the first argument.

Parameters:
dest float128 where to store the result
orig float128 second parameter
den float128 third parameter
Description:
compute dest = (orig*orig)/den

Definition at line 368 of file eg_lpnum.float128.h.

#define float128_EGlpNumCopySum dest,
a,
 )     (dest = float128_add(a,b))
 

copy the value of the sum of the second and third parameter

Parameters:
a float128 source number (it won't change value).
b float128 source number (it won't change value).
dest float128 where to store the sum.
Description:
Set dest = a + b

Definition at line 330 of file eg_lpnum.float128.h.

#define float128_EGlpNumDivTo a,
 )     ((a) = float128_div(a,b))
 

Divide a given number by the value of the second number.

Parameters:
a float128 the number that we are going to divide by the second number and store the result.
b float128 value to be divide to 'a'.
Description:
This function implements a = a / b, and clearly don't change the value stored in 'b'.

Definition at line 520 of file eg_lpnum.float128.h.

#define float128_EGlpNumDivUiTo a,
 ) 
 

Value:

({\
  __lpnum_float128__ = int64_to_float128((long long)(b));\
  (a) = float128_div(a,__lpnum_float128__);})
Divide a given number by the value of the second number.

Parameters:
a float128 the number that we are going to divide by the second number and store the result.
b unsigned int value to be divided to 'a'.
Description:
This function implements a = a / b, and don't change the value stored in 'b'.

Definition at line 531 of file eg_lpnum.float128.h.

#define float128_EGlpNumEpow num,
exp   ) 
 

Value:

({\
  unsigned int __i = 0;\
  const f64dbl_t __exp = {.dbl = (exp)};\
  int __lsgn = __exp.dbl <0 ? 1:0;\
  float128 __ntmp,__res,__lexp,__err,__fint;\
  __lext = float64_to_float128(__exp.fl);\
  __lexp.high &= 0x7fffffffffffffffLL;\
  __ntmp = int32_to_float128(1);\
  __res = int32_to_float128(1);\
  __err = float128_div(__ntmp,__res);\
  while(float128_lt(float128_eps,__err))\
  {\
    __ntmp = float128_mul(__ntmp,__lexp);\
    __fint = int32_to_float128(++__i);\
    __ntmp = float128_div(__ntmp,__fint);\
    __res = float128_add(__res,__ntmp);\
    __err = float128_div(__ntmp,__res);\
  }\
  if(__lsgn) num = float128_div(float128_oneLpNum,__res);\
  else num = __res;})
Given a double exp, compute $ e^{exp} $ and store it in the given float128 number.

Parameters:
exp double exponent to be used.
num float128 number where to store the result.

Definition at line 59 of file eg_lpnum.float128.h.

#define float128_EGlpNumFloor a,
 ) 
 

Value:

do{\
  (a) = float128_round_to_int(b);\
  if(float128_lt(b,a)) (a) = float128_sub((a),float128_oneLpNum);} while(0)
Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).

Definition at line 170 of file eg_lpnum.float128.h.

#define float128_EGlpNumFreeArray ea   )     __EGlpNumFreeArray(ea)
 

given an array of type float128, free it, if the pointer is NULL nothing happen.

Definition at line 104 of file eg_lpnum.float128.h.

#define float128_EGlpNumGetStr  ) 
 

Value:

({\
  const f64dbl_t __tmp = {.fl = float128_to_float64(a)};\
  char *__str=0;\
  unsigned int __i = snprintf(__str,0,"%.7lg",__tmp.dbl);\
  __str = EGsMalloc(char,__i+1);\
  snprintf(__str,__i+1,"%.7lg",__tmp.dbl);\
  __str;})
given a float128, write it to a string (to be allocated internally), and return it.

Definition at line 93 of file eg_lpnum.float128.h.

#define float128_EGlpNumInitVar  )     (a = (float128){0,0})
 

initialize the internal memory of a given variable

Definition at line 585 of file eg_lpnum.float128.h.

#define float128_EGlpNumInv  )     ((a) = float128_div(float128_oneLpNum,a))
 

store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.

Parameters:
a the number to be inverted.

Definition at line 178 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsDiffLess a,
b,
 ) 
 

Value:

({\
  __lpnum_float128__ = float128_sub (a, b);\
  float128_lt(__lpnum_float128__, c);\
})
test if the diference of the first two numbers is less thatn the third number.

Parameters:
a float128 the first number.
b float128 the second number
c float128 the third number
Returns:
int one if success, zero otherwise.
Description:
Given a,b, and c, return nonzero if (a - b < c), zero toherwise.

Definition at line 257 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsEqqual a,
 )     (float128_eq(a,b))
 

Compare if two numbers are equal within a maximum error.

Parameters:
a float128 first number to compare.
b float128 second number to compare.
Returns:
int one in success, zero oterwise.
Description:
Given two numbers 'a','b' return 1 if a == b, otherwise it return 0

Definition at line 188 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsEqual a,
b,
error   ) 
 

Value:

({\
  __lpnum_float128__ = float128_sub (a, b);\
  __lpnum_float128__.high &= 0x7fffffffffffffffLL;\
  float128_le(__lpnum_float128__, error);\
})
Compare if two numbers are equal within a maximum error.

Parameters:
a float128 first number to compare.
b float128 second number to compare.
error float128 maximum difference allowed between both numbers.
Returns:
int one in success, zero oterwise.
Description:
Given two numbers 'a','b' and a tolerance 'error', return 1 if |a-b|<= error, otherwise it return 0.

Definition at line 201 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsGreaDbl a,
 ) 
 

Value:

({\
  f64dbl_t __tmp = {.dbl = (b)};\
  __lpnum_float128__ = float64_to_float128(__tmp.fl);\
  float128_lt(__lpnum_float128__,a);})
test if the first number is bigger to the second number

Parameters:
a float128 the first number.
b double the second number
Returns:
int one if success, zero otherwise.
Description:
Given two numbers 'a' and 'b', return one if a > b, zero otherwise.

Definition at line 285 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsLeq a,
 )     float128_le(a,b)
 

test if the first number is bigger to the second number

Parameters:
a float128 the first number.
b float128 the second number
Returns:
int one if success, zero otherwise.
Description:
Given two numbers 'a' and 'b', return one if a <= b, zero otherwise.

Definition at line 299 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsLess a,
 )     (float128_lt(a,b))
 

test if the first number is bigger to the second number

Parameters:
a float128 the first number.
b float128 the second number
Returns:
int one if success, zero otherwise.
Description:
Given two numbers 'a' and 'b', return one if a < b, zero otherwise.

Definition at line 230 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsLessDbl a,
 ) 
 

Value:

({\
  f64dbl_t __tmp = {.dbl = (b)};\
  __lpnum_float128__ = float64_to_float128(__tmp.fl);\
  float128_lt(a,__lpnum_float128__);})
test if the first number is bigger to the second number

Parameters:
a float128 the first number.
b double the second number
Returns:
int one if success, zero otherwise.
Description:
Given two numbers 'a' and 'b', return one if a < b, zero otherwise.

Definition at line 271 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsNeq a,
b,
error   ) 
 

Value:

({\
  __lpnum_float128__ = float128_sub(a, b);\
  __lpnum_float128__.high &= 0x7fffffffffffffffLL;\
  float128_lt(error,__lpnum_float128__);})

Definition at line 207 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsNeqq a,
 )     (!float128_eq(a,b))
 

Definition at line 219 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsNeqqZero  )     (!float128_eq(a,float128_zeroLpNum))
 

Definition at line 218 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsNeqZero a,
error   ) 
 

Value:

({\
  __lpnum_float128__= (a);\
  __lpnum_float128__.high &= 0x7fffffffffffffffLL;\
  float128_lt(error,__lpnum_float128__);\
})

Definition at line 212 of file eg_lpnum.float128.h.

#define float128_EGlpNumIsSumLess a,
b,
 ) 
 

Value:

({\
  __lpnum_float128__ = float128_add( a, b);\
  float128_lt(__lpnum_float128__, c);\
})
test if the sum of the first two numbers is less thatn the third number.

Parameters:
a float128 the first number.
b float128 the second number
c float128 the third number
Returns:
int one if success, zero otherwise.
Description:
Given a,b, and c, return nonzero if (a + b < c), zero toherwise.

Definition at line 242 of file eg_lpnum.float128.h.

#define float128_EGlpNumMultTo a,
 )     ((a) = float128_mul(a,b))
 

Multiply a given number by the value of the second number.

Parameters:
a float128 the number that we are going to multiply by the second number and store the result.
b float128 value to be multyply to 'a'.
Description:
This function implements a = a * b, and clearly don't change the value stored in 'b'.

Definition at line 509 of file eg_lpnum.float128.h.

#define float128_EGlpNumMultUiTo a,
 ) 
 

Value:

({\
  __lpnum_float128__ = int64_to_float128((long long)(b));\
  (a) = float128_mul(a,__lpnum_float128__);})
Multiply a given number by the value of the second number.

Parameters:
a float128 the number that we are going to multiply by the second number and store the result.
b unsigned int value to be multyply to 'a'.
Description:
This function implements a = a * b, and clearly don't change the value stored in 'b'.

Definition at line 544 of file eg_lpnum.float128.h.

#define float128_EGlpNumOne  )     ((a) = (float128){.high = 0x3fff000000000000LL, .low = 0})
 

Reset the value of the pointed number to one.

Parameters:
a float128 value to be set to one.
Descrpition:
Reset a to zero, i.e. implements a = 1;

Definition at line 562 of file eg_lpnum.float128.h.

#define float128_EGlpNumReadStr a,
str   ) 
 

Value:

({\
  int __i =0;\
  f64dbl_t __tmp;\
  sscanf(str,"%lf%n",&(__tmp.dbl),&__i);\
  (a) = float64_to_float128(__tmp.fl);\
  __i;})
Read from a string a number and store it in the given float128,.

Returns:
the number of chars readed from the input string

Definition at line 83 of file eg_lpnum.float128.h.

#define float128_EGlpNumReallocArray lptr,
lsize   ) 
 

Value:

({ \
  float128** __ptr__ = (lptr); \
  unsigned __sz__ = (lsize); \
  unsigned *__ntmp__ = (unsigned *) *__ptr__; \
  register unsigned __psz__; \
  /* if no memory allocated before we just call the regular allocator */ \
  if (!*__ptr__) *__ptr__ = float128_EGlpNumAllocArray (__sz__); \
  else \
  { \
    /* first check that the previous size is not larger than the current */ \
    __ntmp__--; \
    __psz__ = __ntmp__[0]; \
    if (__psz__ < __sz__) \
    { \
      /* now we have to do the reallocation */ \
      *__ptr__ = (float128 *) __ntmp__; \
      *__ptr__ = EGrealloc(*__ptr__, sizeof(float128) * __sz__ +sizeof(unsigned));\
      __ntmp__ = (unsigned *) *__ptr__; \
      __ntmp__[0] = __sz__; \
      __ntmp__++; \
      *__ptr__ = (float128 *) __ntmp__; \
      for (; __psz__ < __sz__; __psz__++) (*__ptr__)[__psz__] = (float128){0,0}; \
    } \
  } \
})
Reallocate and initialize (if needed) 'size' elements of type float128 and return it, if no more memory, exit(1).

Definition at line 109 of file eg_lpnum.float128.h.

#define float128_EGlpNumSet var,
edbl   ) 
 

Value:

({\
  f64dbl_t __tmp = {.dbl = (edbl)};\
  var = float64_to_float128(__tmp.fl);})
set the given number pointer, set its value to the given double.

Parameters:
var float128 where we will store the double value.
edbl double value to be stored in 'var'.
Description:
This function is intended to set initial values to variables; note that the double is a number and not a pointer to that value, be carefull with this detail. Also, due to implementation details this function can't deal with numbers above 1e158 or smaller than 1e-158. Note also that if the number is writen in the form $x=\bar{x}\cdot 2^e$ with $0.5<|\bar{x}|<1$ , then $\left|x-\frac{p}{q}\right|<2^{e-64}$ .

Definition at line 156 of file eg_lpnum.float128.h.

#define float128_EGlpNumSetToMaxAbs dest,
orig   ) 
 

Value:

({\
  __lpnum_float128__= (orig);\
  __lpnum_float128__.high &= 0x7fffffffffffffffLL;\
  if (float128_lt(dest, __lpnum_float128__)) (dest) = __lpnum_float128__;})
change the fist number to the maximum between itself and the absolute value of the second.

Parameters:
orig float128 source number (it won't change value).
dest float128 where to store the value stored in 'orig'.
Description:
implement dest = max(dest,abs(orig))

Definition at line 349 of file eg_lpnum.float128.h.

#define float128_EGlpNumSetToMinAbs dest,
orig   ) 
 

Value:

({\
  __lpnum_float128__= (orig);\
  __lpnum_float128__.high &= 0x7fffffffffffffffLL;\
  if (float128_lt( __lpnum_float128__, dest)) (dest) = __lpnum_float128__;})

Definition at line 354 of file eg_lpnum.float128.h.

#define float128_EGlpNumSign  )     ((a).high ^= 0x8000000000000000LL)
 

Change the sign of the number.

Parameters:
a float128 number we will change sign.
Descrpition:
Change the sign of the given number, i.e. implements a = -a

Definition at line 570 of file eg_lpnum.float128.h.

#define float128_EGlpNumSubInnProdTo a,
b,
 ) 
 

Value:

({\
  __lpnum_float128__ = float128_mul(b, c);\
  (a) = float128_sub(a, __lpnum_float128__);\
})
Sub to a given number the product of two numbers.

Parameters:
a float128 the number that we are going to Sub to.
b float128 value to be multiplyed.
c float128 value to be multiplyed.
Description:
This function implements a = a - b*c, and clearly don't change the value stored in 'b' nor in 'c'.

Definition at line 436 of file eg_lpnum.float128.h.

#define float128_EGlpNumSubTo a,
 )     ((a) = float128_sub(a,b))
 

Substract to a given number the value of the second number.

Parameters:
a float128 the number that we are going to substract from.
b float128 value to be substracted to 'a'.
Description:
This function implements a = a - b, and clearly don't change the value stored in 'b'.

Definition at line 498 of file eg_lpnum.float128.h.

#define float128_EGlpNumSubUiTo a,
 ) 
 

Value:

({\
  __lpnum_float128__ = int64_to_float128((long long)(b));\
  (a) = float128_sub(a,__lpnum_float128__);})
Substract to a given number the value of the second number.

Parameters:
a float128 the number that we are going to substract to.
b unsigned int value to be substracted to 'a'.
Description:
This function implements a = a - b, and clearly don't change the value stored in 'b'.

Definition at line 463 of file eg_lpnum.float128.h.

#define float128_EGlpNumToLf  ) 
 

Value:

({\
  const f64dbl_t __tmp = {.fl = float128_to_float64(a)};\
  __tmp.dbl;})
return the closest double value of the given pointer number.

Parameters:
a float128 number that we will be transformed to double.
Returns:
double the closest double representation of the given number. par Description: return the double number closest in value to the value stored in a.

Definition at line 579 of file eg_lpnum.float128.h.

#define float128_EGlpNumZero  )     ((a) = (float128){0,0})
 

Reset the value of the pointed number to zero.

Parameters:
a float128 the value to be set to zero.
Descrpition:
Reset a to zero, i.e. implements a = 0;

Definition at line 554 of file eg_lpnum.float128.h.

#define float128_epsLpNum   float128_eps
 

Definition at line 51 of file eg_lpnum.float128.h.

#define float128_oneLpNum   __oneLpNum_float128__
 

Definition at line 50 of file eg_lpnum.float128.h.

#define float128_zeroLpNum   __zeroLpNum_float128__
 

Definition at line 49 of file eg_lpnum.float128.h.

#define fp20_EGlpNumAddInnProdTo a,
b,
 )     ((a) += ((EGfp20_t)((((long long)(b))*(c))/fp20_oneLpNum)))
 

Add to a given number the product of two numbers.

Parameters:
a EGlpNum_t the number that we are going to add to.
b EGlpNum_t value to be multiplyed.
c EGlpNum_t value to be multiplyed.
Description:
This function implements a = a + b*c, and clearly don't change the value stored in 'b' nor in 'c'.

Definition at line 352 of file eg_lpnum.fp20.h.

#define fp20_EGlpNumAddTo a,
 )     ((a) += (b))
 

Add to a given number the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to add to.
b EGlpNum_t value to be added to 'a'.
Description:
This function implements a = a + b, and clearly don't change the value stored in 'b'.

Definition at line 383 of file eg_lpnum.fp20.h.

#define fp20_EGlpNumAddUiTo a,
 )     ((a) += (b)*fp20_oneLpNum)
 

Add to a given number the value of the second number.

Parameters:
a EGlpNum_t the number that we are going to add to.
b unsigned int value to be added to 'a'.
Description:
This function implements a = a + b, and clearly don't change the value stored in 'b'.

Definition at line 373 of file eg_lpnum.fp20.h.

#define fp20_EGlpNumAllocArray size   )     __EGlpNumAllocArray(EGfp20_t,size)
 

Allocate and initialize (if needed) 'size' elements of type int and return it, if no more memory, exit(1).

Definition at line 84 of file eg_lpnum.fp20.h.

#define fp20_EGlpNumCeil a,
 ) 
 

Value:

({\
  fp20_EGlpNumFloor(a,b);\
  if((a) < (b)) (a) += fp20_oneLpNum;\
  (a);})
Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).

Definition at line 103 of file eg_lpnum.fp20.h.

#define fp20_EGlpNumClearVar  ) 
 

free the internal memory of a given variable

Definition at line 481 of file eg_lpnum.fp20.h.

#define fp20_EGlpNumCopy dest,
orig   )     ((dest) = (orig))
 

copy the value of the second number to the first.

Parameters:
orig EGlpNum_t source number (it won't change value).
dest EGlpNum_t where to store the value stored in 'orig'.
Description:
Given two numbers copy the values in 'orig', into 'dest'.

Definition at line 252 of file eg_lpnum.fp20.h.

#define fp20_EGlpNumCopyAbs