projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r510: no message
[ctsim.git]
/
libctsupport
/
cubicinterp.cpp
diff --git
a/libctsupport/cubicinterp.cpp
b/libctsupport/cubicinterp.cpp
index d95f9056b15963ff80d389a7db91bfe5ab1b8dc0..fa51f7b47fd52f15ee6a5dcf6c48925922c943cf 100644
(file)
--- 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
**
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: cubicinterp.cpp,v 1.
2 2001/02/09 01:55:24
kevin Exp $
+** $Id: cubicinterp.cpp,v 1.
3 2001/02/09 14:34:16
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
**
** 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
@@
-26,6
+26,11
@@
CubicInterpolator::CubicInterpolator (const double* const y, const int n)
: m_pdY(y), m_n(n)
{
CubicInterpolator::CubicInterpolator (const double* const y, const int n)
: m_pdY(y), m_n(n)
{
+ // Precalculate 2nd derivative of y and put in m_pdY2
+ // Calculated by solving set of simultaneous cubic spline equations
+ // Only n-2 cubic spline equations, but able to make two more
+ // equations by setting second derivative to 0 at ends
+
m_pdY2 = new double [n];
m_pdY2[0] = 0; // second deriviative = 0 at beginning and end
m_pdY2[n-1] = 0;
m_pdY2 = new double [n];
m_pdY2[0] = 0; // second deriviative = 0 at beginning and end
m_pdY2[n-1] = 0;