From c750c266ab5796903660c5d696a87e937f3b1e21 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 4 Mar 2024 23:40:35 +0100 Subject: Remove useless unimplemented methods in representations Clutters the file and will be rewritten anyways in the future --- mdpoly/representations.py | 37 +------------------------------------ 1 file changed, 1 insertion(+), 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 """ -- cgit v1.2.1