Mentions légales du service

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

Add matfaust.Faust.uminus and pyfaust.Faust.uplus overloads.

Issue #282.
parent c69f8ef8
Branches
Tags
No related merge requests found
......@@ -365,10 +365,23 @@ classdef Faust
%>
%> <p>@b See @b also Faust.plus</p>
%======================================================
function G = uplus(F)
function G = uplus(F)
G = F;
end
%======================================================
%> @brief Returns - F.
%>
%>===
%>
%> This function overloads a Matlab built-in function.
%>
%> <p>@b See @b also Faust.sum, Faust.mtimes</p>
%======================================================
function G = uminus(F)
G = -1 * F;
end
%======================================================================
%> @brief Plus
%>
......
......@@ -663,6 +663,17 @@ class Faust(numpy.lib.mixins.NDArrayOperatorsMixin):
"""
return F
def __neg__(F):
"""
Returns - F (unary operator).
NOTE: This method overloads the Python unary operator -.
<b>See also</b> Faust.__sub__, Faust.__mul__
"""
return -1 * F
def __add__(F, *args, **kwargs):
"""
Sums F to one or a sequence of variables (Faust objects, arrays or scalars).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment