# ComputationEngine¶

class poisson_approval.ComputationEngine[source]

Computation engine.

Define how some mathematical operations are performed. Cf. ComputationEngineSymbolic and ComputationEngineNumeric for some examples.

classmethod Rational(x, y)[source]

Rational number. Should return a fraction, even in a numeric engine.

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.

classmethod exp(x)[source]

Exponential.

classmethod factorial(x)[source]

Factorial.

inf = None

Positive infinity.

classmethod log(x)[source]

Logarithm.

classmethod look_equal(x, y, *args, **kwargs)[source]

Test if two numbers can reasonably be considered as equal.

Parameters: y (x,) – *args – Cf. math.isclose(). **kwargs – Cf. math.isclose(). 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. bool
classmethod multiply_with_absorbing_zero(x, y)[source]

Multiplication with absorbing zero.

Parameters: y (x,) – If x or y is 0, then 0 (even if the other input is nan). Otherwise, the product of x and y. Number
nan = None

Not a Number.

classmethod ones(*args, **kwargs)[source]

Array of ones.

pi = None

Pi.

classmethod simplify(x)[source]

Simplify the number if necessary.

Return a number that has the same value as x. Cf. function simplify of the package sympy.

classmethod simplify_vector(x)[source]

Simplify the coefficients if necessary.

classmethod sqrt(x)[source]

Square root.

classmethod zeros(*args, **kwargs)[source]

Array of zeros.