Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 4, 2023
1 parent 9ffb94d commit 130c5d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/taichi/linalg/matrixfree_cg.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def matvec(self, x, Ax):

def MatrixFreeCG(A, b, x, tol=1e-6, maxiter=5000, quiet=True):
"""Matrix-free conjugate-gradient solver.
Use conjugate-gradient method to solve the linear system Ax = b, where A is implicitly
represented as a LinearOperator.
Expand All @@ -30,7 +30,7 @@ def MatrixFreeCG(A, b, x, tol=1e-6, maxiter=5000, quiet=True):
atol: Tolerance(absolute) for convergence.
quiet (bool): Switch to turn on/off iteration log.
"""

if b.dtype != x.dtype:
raise TaichiTypeError(f"Dtype mismatch b.dtype({b.dtype}) != x.dtype({x.dtype}).")
if str(b.dtype) == "f32":
Expand Down
4 changes: 2 additions & 2 deletions python/taichi/linalg/sparse_cg.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class SparseCG:
"""Conjugate-gradient solver built for SparseMatrix.
Use conjugate-gradient method to solve the linear system Ax = b, where A is SparseMatrix.
Args:
Expand All @@ -18,7 +18,7 @@ class SparseCG:
max_iter (int): Maximum number of iterations.
atol: Tolerance(absolute) for convergence.
"""

def __init__(self, A, b, x0=None, max_iter=50, atol=1e-6):
self.dtype = A.dtype
self.ti_arch = get_runtime().prog.config().arch
Expand Down

0 comments on commit 130c5d1

Please sign in to comment.