ComputationEngine

class poisson_approval.ComputationEngine[source]

Computation engine.

Define how some mathematical operations are performed. Cf. ComputationEngineSymbolic and ComputationEngineNumeric 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.

abstract classmethod exp(x)[source]

Exponential.

abstract classmethod factorial(x)[source]

Factorial.

inf = None

Positive infinity.

abstract classmethod log(x)[source]

Logarithm.

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.

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

Array of ones.

pi = None

Pi.

abstract 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.

abstract classmethod sqrt(x)[source]

Square root.

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

Array of zeros.