| Server IP : 217.160.0.135 / Your IP : 216.73.217.37 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/scipy/optimize/_trustregion_constr/ |
Upload File : |
"""Progress report printers."""
from __future__ import annotations
from typing import List
class ReportBase:
COLUMN_NAMES: List[str] = NotImplemented
COLUMN_WIDTHS: List[int] = NotImplemented
ITERATION_FORMATS: List[str] = NotImplemented
@classmethod
def print_header(cls):
fmt = ("|"
+ "|".join(["{{:^{}}}".format(x) for x in cls.COLUMN_WIDTHS])
+ "|")
separators = ['-' * x for x in cls.COLUMN_WIDTHS]
print(fmt.format(*cls.COLUMN_NAMES))
print(fmt.format(*separators))
@classmethod
def print_iteration(cls, *args):
iteration_format = ["{{:{}}}".format(x) for x in cls.ITERATION_FORMATS]
fmt = "|" + "|".join(iteration_format) + "|"
print(fmt.format(*args))
@classmethod
def print_footer(cls):
print()
class BasicReport(ReportBase):
COLUMN_NAMES = ["niter", "f evals", "CG iter", "obj func", "tr radius",
"opt", "c viol"]
COLUMN_WIDTHS = [7, 7, 7, 13, 10, 10, 10]
ITERATION_FORMATS = ["^7", "^7", "^7", "^+13.4e",
"^10.2e", "^10.2e", "^10.2e"]
class SQPReport(ReportBase):
COLUMN_NAMES = ["niter", "f evals", "CG iter", "obj func", "tr radius",
"opt", "c viol", "penalty", "CG stop"]
COLUMN_WIDTHS = [7, 7, 7, 13, 10, 10, 10, 10, 7]
ITERATION_FORMATS = ["^7", "^7", "^7", "^+13.4e", "^10.2e", "^10.2e",
"^10.2e", "^10.2e", "^7"]
class IPReport(ReportBase):
COLUMN_NAMES = ["niter", "f evals", "CG iter", "obj func", "tr radius",
"opt", "c viol", "penalty", "barrier param", "CG stop"]
COLUMN_WIDTHS = [7, 7, 7, 13, 10, 10, 10, 10, 13, 7]
ITERATION_FORMATS = ["^7", "^7", "^7", "^+13.4e", "^10.2e", "^10.2e",
"^10.2e", "^10.2e", "^13.2e", "^7"]