changed name of get_error func, and allowed for up to 6-th order interp. also, returning the phi multiplier for test case consumption

This commit is contained in:
Stephen McQuay 2010-11-01 20:22:58 -06:00
parent 6f63173489
commit 99b7dd6997

View File

@ -103,7 +103,7 @@ def qlinear_3D(X, R):
qlin = sum([q_i * phi_i for q_i, phi_i in zip(R.q, phis)])
return phis, qlin
def get_error_sauron(phi, R, S, order = 2):
def get_error(phi, R, S, order = 2):
log.debug("len(phi): %d"% len(phi))
B = [] # baker eq 9
w = [] # baker eq 11
@ -175,8 +175,8 @@ def run_baker(X, R, S, order=2):
if order == 1:
answer['qlin'] = qlin
return answer
elif order in (2,3,4):
error_term, abc = get_error_sauron(phi, R, S, order)
elif order in (2,3,4,5,6):
error_term, abc = get_error(phi, R, S, order)
else:
raise Exception('unsupported order for baker method')
@ -185,6 +185,7 @@ def run_baker(X, R, S, order=2):
answer['qlin' ] = qlin
answer['error'] = error_term
answer['final'] = q_final
answer['abc' ] = abc
return answer