egttools.plotting.helpers.find_roots_of_lattice_gradient¶
- find_roots_of_lattice_gradient(lattice, atol=1e-10)[source]¶
Zeros of the piecewise-linear gradient built by
lattice_gradient_interpolator().Inside each lattice triangle the interpolated gradient is affine, so its zero is the solution of a 2x2 linear system and is found exactly; no initial guesses are needed. Population states where the gradient itself is zero (e.g. monomorphic states without mutation) are included. Triangles where the gradient vanishes identically (neutral drift) contribute only their vertices.
- Parameters:
lattice (
NDArray[double]) – Lattice gradients of shape(Z + 1, Z + 1, 3)as returned bylattice_gradient_interpolator().atol (
float) – Tolerance below which a gradient (or a determinant) counts as zero.
- Returns:
Roots in barycentric coordinates (fractions summing to 1), without duplicates.
- Return type: