def theta(x): # signature classique """ Scalar implemenation of the Heaviside step function. """ if x >= 0: return 1 else: return 0