We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 145afb5 commit e2f9913Copy full SHA for e2f9913
cutgeneratingfunctionology/igp/crazy_perturbation.sage
@@ -121,6 +121,15 @@ class PiecewiseCrazyFunction(ModuleElement):
121
122
_rmul_ = _lmul_
123
124
+ # Adding the following method helps the coercion system
125
+ # discover the action of multiplication with a scalar that is not the base ring.
126
+ def _acted_upon_(self, actor, self_on_left):
127
+ r"""
128
+ Multiply self by a matrix from left or right.
129
+ """
130
+ return self.__class__(self.pwl * actor, [cp * actor for cp in self.crazy_pieces],
131
+ parent=self.parent())
132
+
133
def __truediv__(self, other):
134
return self * (QQ(1) / other)
135
0 commit comments