Skip to content
Snippets Groups Projects

Resolve "Operation Replacement in a SFG"

Closed Kevin Scott requested to merge 17-operation-replacement-in-a-sfg into develop
5 unresolved threads
Files
5
+ 15
0
@@ -229,3 +229,18 @@ class Butterfly(AbstractOperation):
@@ -229,3 +229,18 @@ class Butterfly(AbstractOperation):
def evaluate(self, a, b):
def evaluate(self, a, b):
return a + b, a - b
return a + b, a - b
 
 
class MAD(AbstractOperation):
 
"""Multiply-and-add operation.
 
TODO: More info.
 
"""
 
 
def __init__(self, src0: Optional[SignalSourceProvider] = None, src1: Optional[SignalSourceProvider] = None, src2: Optional[SignalSourceProvider] = None, name: Name = ""):
 
super().__init__(input_count = 3, output_count = 1, name = name, input_sources = [src0, src1, src2])
 
 
@property
 
def type_name(self) -> TypeName:
 
return "mad"
 
 
def evaluate(self, a, b, c):
 
return a * b + c
Loading