Пример #1
0
 def test_smootherstep(self):
     vals = np.linspace(5.0, 12.0, num=8)
     self.assertEqual(
         smootherstep(vals, edges=[0.0, 1.0]).tolist(), [1.0] * 8)
     self.assertEqual(
         smootherstep(vals, edges=[7.0, 11.0]).tolist(),
         [0.0, 0.0, 0.0, 0.103515625, 0.5, 0.896484375, 1.0, 1.0])
Пример #2
0
 def smootherstep(self, vals):
     """
     #TODO: Missing doc
     :param vals:
     :return:
     """
     return smootherstep(
         vals, edges=[self.__dict__["lower"], self.__dict__["upper"]])
Пример #3
0
    def smootherstep(self, vals):
        """Get the evaluation of the smootherstep ratio function: f(x)=6*x^5-15*x^4+10*x^3.

        The DeltaCSM values (i.e. "x"), are scaled between the "delta_csm_min" and "delta_csm_max" parameters.

        :param vals: DeltaCSM values for which the ratio function has to be evaluated.
        :return: Result of the ratio function applied to the DeltaCSM values.
        """
        return smootherstep(vals, edges=[self.__dict__["delta_csm_min"], self.__dict__["delta_csm_max"]])
Пример #4
0
    def inverse_smootherstep(self, vals):
        """Get the evaluation of the "inverse" smootherstep ratio function: f(x)=1-(6*x^5-15*x^4+10*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 smootherstep(vals, edges=[self.__dict__["lower"], self.__dict__["upper"]], inverse=True)
Пример #5
0
 def smootherstep(self, vals):
     """
     #TODO: Missing doc
     :param vals:
     :return:
     """
     return smootherstep(vals,
                         edges=[
                             self.__dict__["delta_csm_min"],
                             self.__dict__["delta_csm_max"]
                         ])
Пример #6
0
    def smoothstep(self, vals):
        """Get the evaluation of the smoothstep ratio function: f(x)=3*x^2-2*x^3.

        The CSM values (i.e. "x"), are scaled between the "lower_csm" and "upper_csm" parameters.

        :param vals: CSM values for which the ratio function has to be evaluated.
        :return: Result of the ratio function applied to the CSM values.
        """
        return smootherstep(
            vals,
            edges=[self.__dict__["lower_csm"], self.__dict__["upper_csm"]],
            inverse=True,
        )
Пример #7
0
 def smootherstep(self, vals):
     return smootherstep(vals, edges=[self.__dict__['lower'], self.__dict__['upper']])
Пример #8
0
 def smootherstep(self, vals):
     return smootherstep(vals, edges=[self.__dict__['delta_csm_min'], self.__dict__['delta_csm_max']])
Пример #9
0
 def smoothstep(self, vals):
     return smootherstep(vals, edges=[self.__dict__['lower_csm'], self.__dict__['upper_csm']], inverse=True)
Пример #10
0
 def smootherstep(self, vals):
     return smootherstep(
         vals,
         edges=[self.__dict__['lower_csm'], self.__dict__['upper_csm']],
         inverse=True)
Пример #11
0
 def smootherstep(self, vals):
     return smootherstep(vals,
                         edges=[
                             self.__dict__['delta_csm_min'],
                             self.__dict__['delta_csm_max']
                         ])
Пример #12
0
 def smootherstep(self, vals):
     return smootherstep(
         vals, edges=[self.__dict__['lower'], self.__dict__['upper']])
Пример #13
0
 def smootherstep(self, vals):
     return smootherstep(
         vals, edges=[self.__dict__["delta_csm_min"], self.__dict__["delta_csm_max"]]
     )
Пример #14
0
 def smoothstep(self, vals):
     return smootherstep(
         vals,
         edges=[self.__dict__["lower_csm"], self.__dict__["upper_csm"]],
         inverse=True,
     )
Пример #15
0
 def smootherstep(self, vals):
     return smootherstep(
         vals, edges=[self.__dict__["lower"], self.__dict__["upper"]]
     )
Пример #16
0
 def test_smootherstep(self):
     vals = np.linspace(5.0, 12.0, num=8)
     self.assertEqual(smootherstep(vals, edges=[0.0, 1.0]).tolist(), [1.0]*8)
     self.assertEqual(smootherstep(vals, edges=[7.0, 11.0]).tolist(),
                      [0.0, 0.0, 0.0, 0.103515625, 0.5, 0.896484375, 1.0, 1.0])