Skip to content

polykin.math.roots¤

VectorRootResult dataclass ¤

Dataclass with vector root solution results.

ATTRIBUTE DESCRIPTION
success

If True, the root was found.

TYPE: bool

message

Description of the exit status.

TYPE: str

nfeval

Number of function evaluations.

TYPE: int

niter

Number of iterations.

TYPE: int

x

Root value.

TYPE: FloatVector

f

Function (residual) value at root.

TYPE: FloatVector

Source code in src/polykin/math/roots/results.py
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
@dataclass
class VectorRootResult():
    """Dataclass with vector root solution results.

    Attributes
    ----------
    success: bool
        If `True`, the root was found.
    message: str
        Description of the exit status.
    nfeval: int
        Number of function evaluations.
    niter: int
        Number of iterations.
    x: FloatVector
        Root value.
    f: FloatVector
        Function (residual) value at root.
    """
    success: bool
    message: str
    nfeval: int
    niter: int
    x: FloatVector
    f: FloatVector

    def __repr__(self) -> str:
        return (f"success: {colored_bool(self.success)}\n"
                f"message: {self.message}\n"
                f" nfeval: {self.nfeval}\n"
                f"  niter: {self.niter}\n"
                f"      x: {self.x}\n"
                f"      f: {self.f}")