summaryrefslogtreecommitdiffstats
path: root/polymatrix/expression/mixins/determinantexprmixin.py
diff options
context:
space:
mode:
authorMichael Schneeberger <michael.schneeberger@fhnw.ch>2022-05-30 14:41:08 +0200
committerMichael Schneeberger <michael.schneeberger@fhnw.ch>2022-05-30 14:41:08 +0200
commit0d91560b796e2f086c3a6e41938637b7af521784 (patch)
tree21437d8a2e71bdfdebd65f1de2918e7a61c8caa2 /polymatrix/expression/mixins/determinantexprmixin.py
parentadd statemonad syntax (diff)
downloadpolymatrix-0d91560b796e2f086c3a6e41938637b7af521784.tar.gz
polymatrix-0d91560b796e2f086c3a6e41938637b7af521784.zip
introduce state monad and functions to go along with it
Diffstat (limited to 'polymatrix/expression/mixins/determinantexprmixin.py')
-rw-r--r--polymatrix/expression/mixins/determinantexprmixin.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/polymatrix/expression/mixins/determinantexprmixin.py b/polymatrix/expression/mixins/determinantexprmixin.py
index 5b69d3f..5436ed6 100644
--- a/polymatrix/expression/mixins/determinantexprmixin.py
+++ b/polymatrix/expression/mixins/determinantexprmixin.py
@@ -26,8 +26,8 @@ class DeterminantExprMixin(ExpressionBaseMixin):
self,
state: ExpressionState,
) -> tuple[ExpressionState, PolyMatrix]:
- if self in state.cached_polymatrix:
- return state, state.cached_polymatrix[self]
+ if self in state.cache:
+ return state, state.cache[self]
state, underlying = self.underlying.apply(state=state)
@@ -110,7 +110,7 @@ class DeterminantExprMixin(ExpressionBaseMixin):
state = dataclasses.replace(
state,
auxillary_equations=state.auxillary_equations | auxillary_equations,
- cached_polymatrix=state.cached_polymatrix | {self: poly_matrix},
+ cache=state.cache | {self: poly_matrix},
)
return state, poly_matrix