Changeset 1921 for trunk/psLib/src/dataManip/psFunctions.c
- Timestamp:
- Sep 28, 2004, 1:27:37 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/dataManip/psFunctions.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psFunctions.c
r1907 r1921 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-2 7 23:41:42$9 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-28 23:27:37 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 486 486 float p_psChebPolynomial1DEval(float x, const psPolynomial1D* myPoly) 487 487 { 488 /* 488 489 psVector *d; 489 490 int n; … … 507 508 psFree(d); 508 509 return(tmp); 509 /*510 int n;511 int i;512 float tmp;513 psPolynomial1D **chebPolys = NULL;514 515 n = myPoly->n;516 chebPolys = CreateChebyshevPolys(n);517 518 tmp = 0.0;519 for (i=0;i<myPoly->n;i++) {520 tmp+= (myPoly->coeff[i] * psPolynomial1DEval(x, chebPolys[i]));521 }522 tmp-= (myPoly->coeff[0]/2.0);523 return(tmp);524 510 */ 511 512 int n; 513 int i; 514 float tmp; 515 psPolynomial1D **chebPolys = NULL; 516 517 n = myPoly->n; 518 chebPolys = CreateChebyshevPolys(n); 519 520 tmp = 0.0; 521 for (i=0;i<myPoly->n;i++) { 522 tmp+= (myPoly->coeff[i] * psPolynomial1DEval(x, chebPolys[i])); 523 // printf("HMMM: psPolynomial1DEval(%f, chebPolys[%d]) is %f\n", x, i, psPolynomial1DEval(x, chebPolys[i])); 524 } 525 tmp-= (myPoly->coeff[0]/2.0); 526 527 528 return(tmp); 525 529 } 526 530 … … 1942 1946 1943 1947 /***************************************************************************** 1944 p_ps Interpolate1D(): This routine will take as input psVectors domain and1948 p_psVectorInterpolate(): This routine will take as input psVectors domain and 1945 1949 range, and the x value, assumed to lie with the domain vector. It produces 1946 1950 as output the LaGrange interpolated value of a polynomial of the specified … … 1959 1963 "---- p_psVectorInterpolate() begin ----\n"); 1960 1964 1961 if (domain->type.type != range->type.type != x->type.type) { 1965 if ((domain->type.type != range->type.type) || 1966 (domain->type.type != x->type.type)) { 1962 1967 // XXX psError 1968 printf("domain->type.type != range->type.type != x->type.type\n"); 1969 printf("%d %d %d\n", domain->type.type, range->type.type, x->type.type); 1963 1970 } 1964 1971 if (domain->n != range->n) { 1965 1972 // XXX psError 1973 printf("domain->n != range->n\n"); 1966 1974 } 1967 1975 if (order > (domain->n - 1)) { 1968 1976 // XXX psError: not enough data points for order-order interpolation. 1977 printf("not enough data points for order-order interpolation.\n"); 1969 1978 } 1970 1979 … … 1979 1988 } else { 1980 1989 // XXX psError: type not supported 1981 } 1982 1990 printf("XXX psError: type not supported\n"); 1991 } 1992 1993 printf("return(NULL)\n"); 1983 1994 psTrace(".psLib.dataManip.psFunctions.p_psVectorInterpolate", 4, 1984 1995 "---- p_psVectorInterpolate() end ----\n");
Note:
See TracChangeset
for help on using the changeset viewer.
