projects
/
sawsim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0dfa069
)
inverse_wlc now handles F=HUGE_VAL.
author
W. Trevor King
<wking@drexel.edu>
Mon, 3 Aug 2009 20:16:19 +0000
(16:16 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Mon, 3 Aug 2009 20:16:19 +0000
(16:16 -0400)
src/sawsim.nw
patch
|
blob
|
history
diff --git
a/src/sawsim.nw
b/src/sawsim.nw
index cc506972b42ba0871e313e0daa70e3348d138c96..f1e7f2c18256fffc84721d5f47fa491064fc2d1b 100644
(file)
--- a/
src/sawsim.nw
+++ b/
src/sawsim.nw
@@
-3945,6
+3945,8
@@
static double inverse_wlc(double F, double T, double p, double L)
int num_roots;
assert(F >= 0);
assert(T > 0); assert(p > 0); assert(L > 0);
+ if (F == HUGE_VAL)
+ return L;
num_roots = gsl_poly_solve_cubic(-(FT+2.25),2*FT+1.5,-FT, &xL0, &xL1, &xL2);
assert(num_roots > 0); assert(xL0 >= -DOUBLE_PRECISION); assert(xL0 < 1);
if (xL0 < 0) xL0 = 0.0;