Ejemplo n.º 1
0
 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])
Ejemplo n.º 2
0
 def smoothstep(self, vals):
     """
     #TODO: Missing doc
     :param vals:
     :return:
     """
     return smoothstep(
         vals, edges=[self.__dict__["lower"], self.__dict__["upper"]])
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
 def inverse_smoothstep(self, vals):
     return smoothstep(
         vals,
         edges=[self.__dict__['lower'], self.__dict__['upper']],
         inverse=True)
Ejemplo n.º 5
0
 def smoothstep(self, vals):
     return smoothstep(
         vals, edges=[self.__dict__['lower'], self.__dict__['upper']])
Ejemplo n.º 6
0
 def smoothstep(self, vals):
     return smoothstep(vals, edges=[self.__dict__["lower"], self.__dict__["upper"]])
Ejemplo n.º 7
0
 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])
Ejemplo n.º 8
0
 def inverse_smoothstep(self, vals):
     return smoothstep(vals, edges=[self.__dict__['lower'], self.__dict__['upper']], inverse=True)
Ejemplo n.º 9
0
 def smoothstep(self, vals):
     return smoothstep(vals, edges=[self.__dict__['lower'], self.__dict__['upper']])