From: Kevin M. Rosenberg Date: Fri, 9 Feb 2001 01:55:24 +0000 (+0000) Subject: r509: no message X-Git-Tag: debian-4.5.3-3~508 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=2e09cc8b6f6ac842d06b45cae6a9205a33eece53 r509: no message --- diff --git a/libctsupport/cubicinterp.cpp b/libctsupport/cubicinterp.cpp index 8392dec..d95f905 100644 --- a/libctsupport/cubicinterp.cpp +++ b/libctsupport/cubicinterp.cpp @@ -2,7 +2,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: cubicinterp.cpp,v 1.1 2001/02/09 01:54:21 kevin Exp $ +** $Id: cubicinterp.cpp,v 1.2 2001/02/09 01:55:24 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -27,11 +27,11 @@ CubicInterpolator::CubicInterpolator (const double* const y, const int n) : m_pdY(y), m_n(n) { m_pdY2 = new double [n]; - m_pdY2[0] = 0.0; // second deriviative = 0 at beginning and end + m_pdY2[0] = 0; // second deriviative = 0 at beginning and end m_pdY2[n-1] = 0; double* temp = new double [n - 1]; - temp[0] = 0.0 + temp[0] = 0; for (int i = 1; i < n - 1; i++) { double t = 2 + (0.5 * m_pdY2[i-1]); temp[i] = y[i+1] + y[i-1] - y[i] - y[i]; @@ -64,7 +64,7 @@ CubicInterpolator::interpolate (double x) } double loFr = hi - x; - double hiFr = 1 - a; + double hiFr = 1 - loFr; double y = loFr * m_pdY[lo] + hiFr * m_pdY[hi]; y += oneSixth * ((loFr*loFr*loFr - loFr) * m_pdY2[lo] + (hiFr*hiFr*hiFr - hiFr) * m_pdY2[hi]);