pyinterp.core.fill.gauss_seidel_float32

pyinterp.core.fill.gauss_seidel_float32(grid: numpy.ndarray[numpy.float32[m, n], flags.writeable], first_guess: pyinterp.core.fill.FirstGuess = <FirstGuess.ZonalAverage: 1>, is_circle: bool = True, max_iterations: int = 2000, epsilon: float = 0.0001, relaxation: float = 1.0, num_thread: int = 0) Tuple[int, float]

Replaces all undefined values (NaN) in a grid using the Gauss-Seidel method by relaxation.

Parameters
  • grid (numpy.ndarray) – Grid function on a uniform 2-dimensional grid to be filled.

  • is_circle (bool, optional) – True if the X axis of the grid defines a circle. Defaults to True.

  • max_iterations (int, optional) – Maximum number of iterations to be used by relaxation. Defaults to 2000.

  • epsilon (float, optional) – Tolerance for ending relaxation before the maximum number of iterations limit. Defaults to 1e-4.

  • relaxation (float, opional) – Relaxation constant. Defaults to 1.

  • num_threads (int, optional) – The number of threads to use for the computation. If 0 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. Defaults to 0.

Returns

the number of iterations performed and the maximum residual value.

Return type

tuple