ComputationEngine
- class poisson_approval.ComputationEngine[source]
Computation engine.
Define how some mathematical operations are performed. Cf.
ComputationEngineSymbolic
andComputationEngineNumeric
for some examples.- abstract classmethod Rational(x, y)[source]
Rational number. Should return a fraction, even in a numeric engine.
- abstract classmethod S(x)[source]
Convert the number if necessary.
Return a number that has the same value as x. Cf. function
S
of the package sympy.
- classmethod barycenter(a, b, ratio_b)[source]
Barycenter.
Cf.
ComputationEngineNumeric.barycenter()
for specifications and examples.
- inf = None
Positive infinity.
- classmethod look_equal(x, y, *args, **kwargs)[source]
Test if two numbers can reasonably be considered as equal.
- Parameters
x (Number) –
y (Number) –
*args – Cf.
math.isclose
.**kwargs – Cf.
math.isclose
.
- Returns
If x or y is a float or numpy float (but not a sympy float), then return
math.isclose(x, y, *args, **kwargs)
. In all other cases, return True iff x is equal to y.- Return type
bool
- classmethod multiply_with_absorbing_zero(x, y)[source]
Multiplication with absorbing zero.
- Parameters
x (Number) –
y (Number) –
- Returns
If x or y is 0, then 0 (even if the other input is nan). Otherwise, the product of x and y.
- Return type
Number
- nan = None
Not a Number.
- pi = None
Pi.