diff options
author | Nao Pross <np@0hm.ch> | 2024-03-04 23:40:35 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-03-04 23:40:35 +0100 |
commit | c750c266ab5796903660c5d696a87e937f3b1e21 (patch) | |
tree | c9147a3360ba9113cd5bfd6ff0557b36965b5075 | |
parent | Remove children() and __iter__ from Leaf because it messes with typecheck (diff) | |
download | mdpoly-c750c266ab5796903660c5d696a87e937f3b1e21.tar.gz mdpoly-c750c266ab5796903660c5d696a87e937f3b1e21.zip |
Remove useless unimplemented methods in representations
Clutters the file and will be rewritten anyways in the future
Diffstat (limited to '')
-rw-r--r-- | mdpoly/representations.py | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/mdpoly/representations.py b/mdpoly/representations.py index 6aa3088..b7943ad 100644 --- a/mdpoly/representations.py +++ b/mdpoly/representations.py @@ -2,7 +2,7 @@ from .abc import Repr from .types import Number, Shape, MatrixIndex, PolyIndex from .state import State -from typing import Protocol, Sequence, Iterable +from typing import Protocol, Iterable from abc import abstractmethod import numpy as np @@ -70,24 +70,6 @@ class SparseMatrixRepr(Repr): matrix :math:`Q` and such that the quadratic form :math:`x^T Q x` gives the polynomial. """ - - def at(self, entry: MatrixIndex, term: PolyIndex) -> Number: - """ Access polynomial entry """ - raise NotImplementedError - - def set(self, entry: MatrixIndex, term: PolyIndex, value: Number) -> None: - """ Set value of polynomial entry """ - raise NotImplementedError - - def entries(self) -> Sequence[MatrixIndex]: - """ Return indices to non-zero entries of the matrix """ - raise NotImplementedError - - def terms(self, entry: MatrixIndex) -> Sequence[PolyIndex]: - """ Return indices to non-zero terms in the polynomial at the given - matrix entry """ - raise NotImplementedError - def basis(self): raise NotImplementedError @@ -102,23 +84,6 @@ class DenseRepr(Repr): def __init__(self, shape: Shape, dtype:type =float): self.data = np.zeros(shape, dtype) - def at(self, entry: MatrixIndex, term: PolyIndex) -> Number: - """ Access polynomial entry """ - raise NotImplementedError - - def set(self, entry: MatrixIndex, term: PolyIndex, value: Number) -> None: - """ Set value of polynomial entry """ - raise NotImplementedError - - def entries(self) -> Iterable[MatrixIndex]: - """ Return indices to non-zero entries of the matrix """ - raise NotImplementedError - - def terms(self, entry: MatrixIndex) -> Iterable[PolyIndex]: - """ Return indices to non-zero terms in the polynomial at the given - matrix entry """ - raise NotImplementedError - class DenseMatrixRepr(Repr): """ Dense matrix representation of a polynomials """ |