# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401, F403, F405

import collections.abc
from raygeo.mesh import types
__all__ = [
    "solve_laplace",
    "solve_laplace_with_history",
]

def solve_laplace(mesh: types.TriangleMesh, max_iter: int = 1000, tolerance: float = 0.00000001) -> collections.abc.Sequence[float]:
    r"""
    Solve the Laplace equation Δu=0 on a triangle mesh.
    
    Returns a scalar field with one value per vertex. Outer boundary
    vertices are fixed to u=1.0 and inner boundary vertices to u=0.0.
    
    :param mesh: TriangleMesh with boundary tags.
    :param max_iter: Maximum conjugate gradient iterations.
    :param tolerance: Convergence tolerance for CG residual.
    :returns: List of scalar u values, one per vertex.
    :complexity: O(i * n) where i = CG iterations, n = mesh vertices
    """

def solve_laplace_with_history(mesh: types.TriangleMesh, max_iter: int = 1000, tolerance: float = 0.00000001) -> tuple[collections.abc.Sequence[float], collections.abc.Sequence[float]]:
    r"""
    Solve the Laplace equation and return convergence history.
    
    Identical to solve_laplace() but also returns the residual norm after
    each conjugate gradient iteration for convergence analysis.
    
    :param mesh: TriangleMesh with boundary tags.
    :param max_iter: Maximum conjugate gradient iterations.
    :param tolerance: Convergence tolerance for CG residual.
    :returns: Tuple of (solution, residuals).
    :complexity: O(i * n) where i = CG iterations, n = mesh vertices
    """

