TABLE OF CONTENTS
CcurveUpdate/EvalSplineAtOnePoint [ Functions ]
NAME
EvalSplineAtOnePoint --- evaluate spline at a given value of x
FUNCTION
Evaluate a spline curve at a given point, even if that point is not stored in its X component and has not been included in its basis. This differs from EvalSpline in that the latter must already have a fully computed basis stored. This one does a full curve evaluation -- in that sense it acts as a wrapper to csplineeval.
SYNOPSIS
1276 double EvalSplineAtOnePoint(curveP theCurve, double x)
INPUTS
theCurve a CCurve structure
OUTPUTS
x value at which to evaluate the spline
SOURCE
1280 { 1281 double splY=0; 1282 int c1=1; 1283 if(theCurve->hasSpline){ 1284 // compute the basis at x 1285 double * tempBasis = (double *) malloc( theCurve->nj * sizeof(double)); 1286 for(int j=0; j<theCurve->nj; j++) tempBasis[j]=csplineeval(x, j, theCurve->SplineOrd, 1287 theCurve->SplineKnots, theCurve->SplineOrd, theCurve->nj); 1288 // normalize the frailty basis 1289 if(!theCurve->isHazard) 1290 for(int j=0; j<theCurve->nj; j++) tempBasis[j] /= (theCurve->SplineBasisInt[j] * 1291 theCurve->SplineEParSum); 1292 // compute the spline value at X 1293 splY = F77_CALL(ddot)( &(theCurve->nj), tempBasis, &c1, theCurve->SplineEPar, &c1); 1294 free(tempBasis); 1295 } 1296 return splY; 1297 }