Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e4a6b08a authored by hhakim's avatar hhakim
Browse files

Fix a bug in pyfaust.Faust.__rmatmul__ (lhs*Faust) and __rmul__ (Faust*rhs).

The complex case was not handled because the operations where relying on __matmul__ (Faust@rhs) and __mul__ (Faust*rhs) by transposing the operands although with complex ones it's needed to use the transconjugate.
parent f8e8a5c1
Branches
Tags
No related merge requests found
......@@ -689,7 +689,10 @@ class Faust:
<b/>See also Faust.__mul__
"""
if(isinstance(lhs_op,np.ndarray)):
return (F.T*lhs_op.T).T
if(F.dtype == np.complex or lhs_op.dtype == np.complex):
return (F.T.conj()*lhs_op.T.conj()).T.conj()
else: # real Faust
return (F.T*lhs_op.T).T
else:
# a scalar or something not Faust-mul-compatible
return F*lhs_op
......@@ -712,7 +715,10 @@ class Faust:
"""
return (F.T*lhs_op.T).T
if(F.dtype == np.complex or lhs_op.dtype == np.complex):
return (F.T.conj()*lhs_op.T.conj()).T.conj()
else: # real Faust and real lhs_op
return (F.T*lhs_op.T).T
#def concatenate(F, *args, axis=0): # py. 2 doesn't handle this signature
def concatenate(F, *args, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment