Changeset 6768 for trunk/psLib/src/math/psSpline.c
- Timestamp:
- Apr 4, 2006, 10:47:25 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psSpline.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psSpline.c
r6484 r6768 1 1 /** @file psSpline.c 2 2 * 3 * @brief Contains basic spline allocation, deallocation, fitting, 3 * @brief Contains basic spline allocation, deallocation, fitting, 4 4 * and evaluation routines. 5 5 * 6 6 * This file contains the routines that allocate, free, and evaluate splines. 7 7 * 8 * @version $Revision: 1.13 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 2-24 23:43:15 $8 * @version $Revision: 1.138 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-04 20:47:25 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 239 239 for (psS32 i = 0 ; i < x->n ; i++) { 240 240 spline->knots->data.F32[i] = x->data.F32[i]; 241 spline->knots->n++;242 241 } 243 242 } else if (x->type.type == PS_TYPE_F64) { 244 243 for (psS32 i = 0 ; i < x->n ; i++) { 245 244 spline->knots->data.F32[i] = (psF32) x->data.F64[i]; 246 spline->knots->n++;247 245 } 248 246 } … … 250 248 for (psS32 i = 0 ; i < y->n ; i++) { 251 249 spline->knots->data.F32[i] = (psF32) i; 252 spline->knots->n++;253 250 } 254 251 } … … 369 366 370 367 psS32 n = spline->n; 371 if ((x < spline->knots->data.F32[0]) || (x > spline->knots->data.F32[ n-1])) {368 if ((x < spline->knots->data.F32[0]) || (x > spline->knots->data.F32[spline->knots->n-1])) { 372 369 // If x is outside the range of spline->knots, generate a warning 373 370 // message, then return the left, or right, endpoint. … … 415 412 for (psS32 i=0;i<x->n;i++) { 416 413 tmpVector->data.F32[i] = psSpline1DEval(spline, x->data.F32[i]); 417 tmpVector->n++;418 414 } 419 415 } else if (x->type.type == PS_TYPE_F64) { 420 416 for (psS32 i=0;i<x->n;i++) { 421 417 tmpVector->data.F32[i] = psSpline1DEval(spline, (psF32) x->data.F64[i]); 422 tmpVector->n++;423 418 } 424 419 }
Note:
See TracChangeset
for help on using the changeset viewer.
