Index: trunk/psModules/src/objects/pmGrowthCurve.c
===================================================================
--- trunk/psModules/src/objects/pmGrowthCurve.c	(revision 8815)
+++ trunk/psModules/src/objects/pmGrowthCurve.c	(revision 8886)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-22 21:35:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,4 +18,5 @@
 #include <pslib.h>
 #include "pmGrowthCurve.h"
+#include "psVectorBracket.h"
 
 static void pmGrowthCurveFree (pmGrowthCurve *growth)
@@ -57,79 +58,2 @@
 }
 
-// return the last entry below or first entry above key value
-int psVectorBracket (psVector *index, psF32 key, bool above)
-{
-
-    int N;
-    int Nlo = 0;
-    int Nhi = index->n;
-
-    if (above) {
-        while (Nhi - Nlo > 10) {
-            N = 0.5*(Nlo + Nhi);
-            if (index->data.F32[N] > key) {
-                Nhi = N;
-            } else {
-                Nlo = N - 1;
-            }
-        }
-        // at this point, index[Nhi] > key >= index[Nlo]
-        N = Nlo;
-        while ((index->data.F32[N] <= key) && (N < Nhi)) {
-            N++;
-        }
-        return (N);
-    }
-    while (Nhi - Nlo > 10) {
-        N = 0.5*(Nlo + Nhi);
-        if (index->data.F32[N] < key) {
-            Nlo = N;
-        } else {
-            Nhi = N + 1;
-        }
-    }
-    // at this point, index[Nhi] >= key > index[Nlo]
-    N = Nhi;
-    while ((index->data.F32[N] >= key) && (N > Nlo)) {
-        N--;
-    }
-    return (N);
-}
-
-// search for the bins bounding key in index, interpolate the corresponding values
-psF32 psVectorInterpolate (psVector *index, psVector *value, psF32 key)
-{
-
-    int n0 = 0;
-    int n1 = 0;
-
-    // extrapolate at ends
-    if (key < index->data.F32[0]) {
-        n0 = 0;
-        n1 = 1;
-    }
-
-    // extrapolate at ends
-    if (key > index->data.F32[index->n-1]) {
-        n0 = index->n-2;
-        n1 = index->n-1;
-    }
-
-    if (n1 == 0) {
-        n0 = psVectorBracket (index, key, FALSE);
-        n1 = n0 + 1;
-    }
-
-    if (n0 == index->n-1) {
-        n1 = n0;
-        n0 = n1 - 1;
-    }
-
-    float dy = value->data.F32[n1] - value->data.F32[n0];
-    float dx = index->data.F32[n1] - index->data.F32[n0];
-    float dX = key - index->data.F32[n0];
-    float dY = dX * (dy/dx);
-    float result = value->data.F32[n0] + dY;
-    return result;
-}
-
