コード例 #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])
コード例 #2
0
 def smoothstep(self, vals):
     """
     #TODO: Missing doc
     :param vals:
     :return:
     """
     return smoothstep(
         vals, edges=[self.__dict__["lower"], self.__dict__["upper"]])
コード例 #3
0
ファイル: func_utils.py プロジェクト: mturiansky/pymatgen
    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)
コード例 #4
0
ファイル: func_utils.py プロジェクト: zhuruijie16/pymatgen
 def inverse_smoothstep(self, vals):
     return smoothstep(
         vals,
         edges=[self.__dict__['lower'], self.__dict__['upper']],
         inverse=True)
コード例 #5
0
ファイル: func_utils.py プロジェクト: zhuruijie16/pymatgen
 def smoothstep(self, vals):
     return smoothstep(
         vals, edges=[self.__dict__['lower'], self.__dict__['upper']])
コード例 #6
0
 def smoothstep(self, vals):
     return smoothstep(vals, edges=[self.__dict__["lower"], self.__dict__["upper"]])
コード例 #7
0
ファイル: test_math_utils.py プロジェクト: ExpHP/pymatgen
 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])
コード例 #8
0
ファイル: func_utils.py プロジェクト: ExpHP/pymatgen
 def inverse_smoothstep(self, vals):
     return smoothstep(vals, edges=[self.__dict__['lower'], self.__dict__['upper']], inverse=True)
コード例 #9
0
ファイル: func_utils.py プロジェクト: ExpHP/pymatgen
 def smoothstep(self, vals):
     return smoothstep(vals, edges=[self.__dict__['lower'], self.__dict__['upper']])