scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturns
_maybe_real(A, B, tol=None)

The motivation is that B has been computed as a complicated function of A, and B may be perturbed by negligible imaginary components. If A is real and B is complex with small imaginary components, then return a real copy of B. The assumption in that case would be that the imaginary components of B are numerical artifacts.

Parameters

A : ndarray

Input array whose type is to be checked as real vs. complex.

B : ndarray

Array to be returned, possibly without its imaginary part.

tol : float

Absolute tolerance.

Returns

out : real or complex array

Either the input array B or only the real part of the input array B.

Return either B or the real part of B, depending on properties of A and B.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/linalg/_matfuncs.py#57
type: <class 'function'>
Commit: