[pre-commit.ci] pre-commit autoupdate (#11322)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.2...v0.3.2)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
pre-commit-ci[bot]
2024-03-13 07:52:41 +01:00
committed by GitHub
parent 5f95d6f805
commit bc8df6de31
297 changed files with 488 additions and 285 deletions

View File

@ -3,6 +3,7 @@ Resources:
- https://en.wikipedia.org/wiki/Conjugate_gradient_method
- https://en.wikipedia.org/wiki/Definite_symmetric_matrix
"""
from typing import Any
import numpy as np

View File

@ -18,6 +18,7 @@ Overview:
- function square_zero_matrix(N)
- function random_matrix(W, H, a, b)
"""
from __future__ import annotations
import math
@ -96,12 +97,10 @@ class Vector:
raise Exception("must have the same size")
@overload
def __mul__(self, other: float) -> Vector:
...
def __mul__(self, other: float) -> Vector: ...
@overload
def __mul__(self, other: Vector) -> float:
...
def __mul__(self, other: Vector) -> float: ...
def __mul__(self, other: float | Vector) -> float | Vector:
"""
@ -309,12 +308,10 @@ class Matrix:
raise Exception("matrices must have the same dimension!")
@overload
def __mul__(self, other: float) -> Matrix:
...
def __mul__(self, other: float) -> Matrix: ...
@overload
def __mul__(self, other: Vector) -> Vector:
...
def __mul__(self, other: Vector) -> Vector: ...
def __mul__(self, other: float | Vector) -> Vector | Matrix:
"""

View File

@ -1,6 +1,7 @@
"""
https://en.wikipedia.org/wiki/Rayleigh_quotient
"""
from typing import Any
import numpy as np

View File

@ -6,6 +6,7 @@ Created on Mon Feb 26 15:40:07 2018
This file contains the test-suite for the linear algebra library.
"""
import unittest
import pytest

View File

@ -11,6 +11,7 @@ projection(45) = [[0.27596319193541496, 0.446998331800279],
reflection(45) = [[0.05064397763545947, 0.893996663600558],
[0.893996663600558, 0.7018070490682369]]
"""
from math import cos, sin