Changeset 3913 for trunk/GSASIImath.py
- Timestamp:
- Apr 21, 2019 10:05:23 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r3900 r3913 99 99 return res,nzero 100 100 101 def HessianLSQ(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.e-6, maxcyc=0,lamda=-3,Print=False): 102 101 def HessianLSQ(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.e-6, maxcyc=0,lamda=-3,Print=False,refPlotUpdate=None): 103 102 """ 104 103 Minimize the sum of squares of a function (:math:`f`) evaluated on a series of … … 209 208 print (' Cycle: %d, Time: %.2fs, Chi**2: %.5g for %d obs., Lambda: %.3g, Delta: %.3g'%( 210 209 icycle,time.time()-time0,chisq1,Nobs,lamMax,deltaChi2)) 210 Histograms = args[0][0] 211 if refPlotUpdate is not None: refPlotUpdate(Histograms,icycle) # update plot 211 212 if deltaChi2 < ftol: 212 213 ifConverged = True … … 233 234 return [x0,None,{'num cyc':icycle,'fvec':M,'nfev':nfev,'lamMax':lamMax,'psing':psing,'SVD0':-1}] 234 235 235 def HessianSVD(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.e-6, maxcyc=0,lamda=-3,Print=False ):236 def HessianSVD(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.e-6, maxcyc=0,lamda=-3,Print=False,refPlotUpdate=None): 236 237 237 238 """ … … 319 320 print (' Cycle: %d, Time: %.2fs, Chi**2: %.5g, Delta: %.3g'%( 320 321 icycle,time.time()-time0,chisq1,deltaChi2)) 322 Histograms = args[0][0] 323 if refPlotUpdate is not None: refPlotUpdate(Histograms,icycle) # update plot 321 324 if deltaChi2 < ftol: 322 325 ifConverged = True
Note: See TracChangeset
for help on using the changeset viewer.