summaryrefslogtreecommitdiff
path: root/pyspike/function.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyspike/function.py')
-rw-r--r--pyspike/function.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pyspike/function.py b/pyspike/function.py
index b705293..3a5a01c 100644
--- a/pyspike/function.py
+++ b/pyspike/function.py
@@ -109,6 +109,13 @@ class PieceWiseConstFunc:
self.x = x_new[:index+2]
self.y = y_new[:index+1]
+ def mul_scalar(self, fac):
+ """ Multiplies the function with a scalar value
+ Params:
+ - fac: Value to multiply
+ """
+ self.y *= fac
+
##############################################################
# PieceWiseLinFunc
@@ -236,3 +243,11 @@ class PieceWiseLinFunc:
self.x = x_new[:index+2]
self.y1 = y1_new[:index+1]
self.y2 = y2_new[:index+1]
+
+ def mul_scalar(self, fac):
+ """ Multiplies the function with a scalar value
+ Params:
+ - fac: Value to multiply
+ """
+ self.y1 *= fac
+ self.y2 *= fac