本文整理汇总了Python中mathkit.mfn.mfn_line.mfn_line.MFnLineArray.get_value方法的典型用法代码示例。如果您正苦于以下问题:Python MFnLineArray.get_value方法的具体用法?Python MFnLineArray.get_value怎么用?Python MFnLineArray.get_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mathkit.mfn.mfn_line.mfn_line.MFnLineArray
的用法示例。
在下文中一共展示了MFnLineArray.get_value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: montecarlo
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_value [as 别名]
def montecarlo(self,N):
ppf = MFnLineArray(xdata=self.hui_cdf, ydata=self.x)
fragment_lengths = []
for i in range(N):
fragment_length = ppf.get_value(np.random.rand(1)) + ppf.get_value(np.random.rand(1))
fragment_lengths.append(fragment_length / 2.)
return np.array(fragment_lengths)
示例2: range
# 需要导入模块: from mathkit.mfn.mfn_line.mfn_line import MFnLineArray [as 别名]
# 或者: from mathkit.mfn.mfn_line.mfn_line.MFnLineArray import get_value [as 别名]
# outer loop:
for n_steps in range(10):
# inner loop:
KMAX = 100
k = 1
while k < KMAX:
print 'inner loop: IT:', k
fitter.run_n_trial_steps( 1 )
fitter.tloop.rtrace_mngr.rtrace_bound_list[1].redraw()
# get calculated sig_app_xx based on current phi_value:
sig_app_trial = fitter.tloop.rtrace_mngr.rtrace_bound_list[1].trace.ydata[-1]
# get sig_app_xx to be fitted:
sig_app_fit = mfn_line_array_fit.get_value(eps_app_tn1[0])
fitting_ratio = sig_app_trial / sig_app_fit
if fitting_ratio > 1:
phi_value_new = phi_value_old * 0.8
elif fitting_ratio > 1:
phi_value_new = phi_value_old * 1.2
# adjusting phi_value:
x = hstack([ x[:-1], e_max_value_new ])
y = hstack([ y[:-1], phi_value_new ])
fitter.mats2D_eval.polar_fn.phi_fn.mfn.set( xdata = x, ydata = y )
fitter.mats2D_eval.polar_fn.phi_fn.mfn.data_changed = True
print 'adjusting phi_value to: ', phi_value_new
if fitting_ratio < 1.01:
fitter.run_one_step()