def test_smoothstep(self): vals = np.linspace(5.0, 12.0, num=8) self.assertEqual( smoothstep(vals, edges=[0.0, 1.0]).tolist(), [1.0] * 8) self.assertEqual( smoothstep(vals, edges=[7.0, 11.0]).tolist(), [0.0, 0.0, 0.0, 0.15625, 0.5, 0.84375, 1.0, 1.0])
def smoothstep(self, vals): """ #TODO: Missing doc :param vals: :return: """ return smoothstep( vals, edges=[self.__dict__["lower"], self.__dict__["upper"]])
def inverse_smoothstep(self, vals): """Get the evaluation of the "inverse" smoothstep ratio function: f(x)=1-(3*x^2-2*x^3). The values (i.e. "x"), are scaled between the "lower" and "upper" parameters. :param vals: Values for which the ratio function has to be evaluated. :return: Result of the ratio function applied to the values. """ return smoothstep(vals, edges=[self.__dict__["lower"], self.__dict__["upper"]], inverse=True)
def inverse_smoothstep(self, vals): return smoothstep( vals, edges=[self.__dict__['lower'], self.__dict__['upper']], inverse=True)
def smoothstep(self, vals): return smoothstep( vals, edges=[self.__dict__['lower'], self.__dict__['upper']])
def smoothstep(self, vals): return smoothstep(vals, edges=[self.__dict__["lower"], self.__dict__["upper"]])
def test_smoothstep(self): vals = np.linspace(5.0, 12.0, num=8) self.assertEqual(smoothstep(vals, edges=[0.0, 1.0]).tolist(), [1.0]*8) self.assertEqual(smoothstep(vals, edges=[7.0, 11.0]).tolist(), [0.0, 0.0, 0.0, 0.15625, 0.5, 0.84375, 1.0, 1.0])
def inverse_smoothstep(self, vals): return smoothstep(vals, edges=[self.__dict__['lower'], self.__dict__['upper']], inverse=True)
def smoothstep(self, vals): return smoothstep(vals, edges=[self.__dict__['lower'], self.__dict__['upper']])