diff options
-rw-r--r-- | polymatrix/expression/impl.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/polymatrix/expression/impl.py b/polymatrix/expression/impl.py index 764cab8..81a624e 100644 --- a/polymatrix/expression/impl.py +++ b/polymatrix/expression/impl.py @@ -105,6 +105,9 @@ class ARangeExprImpl(ARangeExprMixin): class BlockDiagExprImpl(BlockDiagExprMixin): blocks: tuple[ExpressionBaseMixin, ...] + def __str__(self): + return f"blkdiag({self.underlying})" + @dataclassabc.dataclassabc(frozen=True) class CacheExprImpl(CacheExprMixin): @@ -153,6 +156,9 @@ class DerivativeExprImpl(DerivativeExprMixin): class DiagExprImpl(DiagExprMixin): underlying: ExpressionBaseMixin + def __str__(self): + return f"diag({self.underlying})" + @dataclassabc.dataclassabc(frozen=True) class DivergenceExprImpl(DivergenceExprMixin): @@ -174,6 +180,9 @@ class EvalExprImpl(EvalExprMixin): underlying: ExpressionBaseMixin substitutions: tuple + def __str__(self): + return f"eval({self.underlying}, {self.substitutions})" + @dataclassabc.dataclassabc(frozen=True) class EyeExprImpl(EyeExprMixin): @@ -278,6 +287,9 @@ class LinearMonomialsExprImpl(LinearMonomialsExprMixin): class LowerTriangularExprImpl(LowerTriangularExprMixin): underlying: ExpressionBaseMixin + def __str__(self): + return f"tril({self.underlying})" + @dataclassabc.dataclassabc(frozen=True) class LegendreSeriesImpl(LegendreSeriesMixin): @@ -437,6 +449,9 @@ class SliceExprImpl(SliceExprMixin): underlying: ExpressionBaseMixin slice: tuple # See SlicePolyMatrixMixin + def __str__(self): + return f"{self.underlying}[{self.slice}]" + @dataclassabc.dataclassabc(frozen=True) class SqueezeExprImpl(SqueezeExprMixin): |