From 9427e8dd16201b11877454a8ee7331ef89a80a70 Mon Sep 17 00:00:00 2001 From: Matt Spraggs Date: Thu, 12 Nov 2015 13:14:44 +0000 Subject: [PATCH] TabFunction: Fixed bug in quadratic interpolation --- lib/TabFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/TabFunction.cpp b/lib/TabFunction.cpp index a980f57..4ea29ad 100644 --- a/lib/TabFunction.cpp +++ b/lib/TabFunction.cpp @@ -97,7 +97,7 @@ double TabFunction::operator()(const double *arg) const if (it == value_.begin()) { it = next(it); } - else if (it == value_.end()) { + else if (it == prev(value_.end())) { it = prev(it); } xs[0] = prev(it)->first;