-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Algorithm implementation and refactor (#73)
Co-authored-by: AndPotap <[email protected]>
- Loading branch information
Showing
88 changed files
with
3,773 additions
and
4,481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from plum import parametric | ||
from cola.ops import LinearOperator | ||
from cola.utils import export | ||
from types import SimpleNamespace | ||
# import pytreeclass as tc | ||
|
||
|
||
@export | ||
class Algorithm: | ||
pass | ||
|
||
|
||
@parametric | ||
class IterativeOperatorWInfo(LinearOperator): | ||
def __init__(self, A: LinearOperator, alg: Algorithm): | ||
super().__init__(A.dtype, A.shape) | ||
self.A = A | ||
self.alg = alg | ||
self.info = {} | ||
|
||
def _matmat(self, X): | ||
Y, self.info = self.alg(self.A, X) | ||
return Y | ||
|
||
def __str__(self): | ||
return f"{self.alg}({str(self.A)})" | ||
|
||
|
||
@export | ||
class Auto(SimpleNamespace, Algorithm): | ||
pass |
1 change: 0 additions & 1 deletion
1
cola/algorithms/__init__.py → cola/linalg/decompositions/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.