Changeset 1765
- Timestamp:
- Sep 9, 2004, 1:39:36 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 3 edited
-
dataManip/psFunctions.c (modified) (5 diffs)
-
math/psPolynomial.c (modified) (5 diffs)
-
math/psSpline.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psFunctions.c
r1763 r1765 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-09 2 2:20:31$9 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-09 23:39:36 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1580 1580 NOTE: "n" specifies the number of spline polynomials. Therefore, there 1581 1581 must exist n+1 points in "domains". 1582 1583 XXX: Ensure that domain[i+1] != domain[i] 1582 1584 *****************************************************************************/ 1583 1585 psSpline1D *psSpline1DAlloc(int numSplines, … … 1611 1613 } 1612 1614 1615 /***************************************************************************** 1616 XXX: Ensure that domain[i+1] != domain[i] 1617 *****************************************************************************/ 1613 1618 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, 1614 1619 int order) … … 1720 1725 { 1721 1726 int i; 1727 float slope; 1728 1722 1729 if (data->n != (1 + spline->n)) { 1723 1730 psLogMsg(__func__, PS_LOG_WARN, … … 1726 1733 return(NULL); 1727 1734 } 1735 // XXX: verify your math 1728 1736 if (1 == (spline->spline[0])->n) { 1737 for (i=0;i<spline->n;i++) { 1738 slope = (data->data.F32[i+1] - data->data.F32[i]) / 1739 (spline->domains[i+1] - spline->domains[i]); 1740 (spline->spline[0])->coeff[0] = data->data.F32[i] - 1741 (slope * spline->domains[i]); 1742 (spline->spline[0])->coeff[1] = slope; 1743 } 1744 1729 1745 psLogMsg(__func__, PS_LOG_WARN, 1730 1746 "Linear splines have not been implemented."); 1731 1747 return(NULL); 1732 for (i=0;i<spline->n;i++) {} 1733 1734 } 1735 else if (3 == (spline->spline[0])->n) { 1748 } else if (3 == (spline->spline[0])->n) { 1736 1749 psLogMsg(__func__, PS_LOG_WARN, 1737 1750 "Cubic splines have not been implemented."); -
trunk/psLib/src/math/psPolynomial.c
r1763 r1765 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-09 2 2:20:31$9 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-09 23:39:36 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1580 1580 NOTE: "n" specifies the number of spline polynomials. Therefore, there 1581 1581 must exist n+1 points in "domains". 1582 1583 XXX: Ensure that domain[i+1] != domain[i] 1582 1584 *****************************************************************************/ 1583 1585 psSpline1D *psSpline1DAlloc(int numSplines, … … 1611 1613 } 1612 1614 1615 /***************************************************************************** 1616 XXX: Ensure that domain[i+1] != domain[i] 1617 *****************************************************************************/ 1613 1618 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, 1614 1619 int order) … … 1720 1725 { 1721 1726 int i; 1727 float slope; 1728 1722 1729 if (data->n != (1 + spline->n)) { 1723 1730 psLogMsg(__func__, PS_LOG_WARN, … … 1726 1733 return(NULL); 1727 1734 } 1735 // XXX: verify your math 1728 1736 if (1 == (spline->spline[0])->n) { 1737 for (i=0;i<spline->n;i++) { 1738 slope = (data->data.F32[i+1] - data->data.F32[i]) / 1739 (spline->domains[i+1] - spline->domains[i]); 1740 (spline->spline[0])->coeff[0] = data->data.F32[i] - 1741 (slope * spline->domains[i]); 1742 (spline->spline[0])->coeff[1] = slope; 1743 } 1744 1729 1745 psLogMsg(__func__, PS_LOG_WARN, 1730 1746 "Linear splines have not been implemented."); 1731 1747 return(NULL); 1732 for (i=0;i<spline->n;i++) {} 1733 1734 } 1735 else if (3 == (spline->spline[0])->n) { 1748 } else if (3 == (spline->spline[0])->n) { 1736 1749 psLogMsg(__func__, PS_LOG_WARN, 1737 1750 "Cubic splines have not been implemented."); -
trunk/psLib/src/math/psSpline.c
r1763 r1765 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-09 2 2:20:31$9 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-09 23:39:36 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1580 1580 NOTE: "n" specifies the number of spline polynomials. Therefore, there 1581 1581 must exist n+1 points in "domains". 1582 1583 XXX: Ensure that domain[i+1] != domain[i] 1582 1584 *****************************************************************************/ 1583 1585 psSpline1D *psSpline1DAlloc(int numSplines, … … 1611 1613 } 1612 1614 1615 /***************************************************************************** 1616 XXX: Ensure that domain[i+1] != domain[i] 1617 *****************************************************************************/ 1613 1618 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, 1614 1619 int order) … … 1720 1725 { 1721 1726 int i; 1727 float slope; 1728 1722 1729 if (data->n != (1 + spline->n)) { 1723 1730 psLogMsg(__func__, PS_LOG_WARN, … … 1726 1733 return(NULL); 1727 1734 } 1735 // XXX: verify your math 1728 1736 if (1 == (spline->spline[0])->n) { 1737 for (i=0;i<spline->n;i++) { 1738 slope = (data->data.F32[i+1] - data->data.F32[i]) / 1739 (spline->domains[i+1] - spline->domains[i]); 1740 (spline->spline[0])->coeff[0] = data->data.F32[i] - 1741 (slope * spline->domains[i]); 1742 (spline->spline[0])->coeff[1] = slope; 1743 } 1744 1729 1745 psLogMsg(__func__, PS_LOG_WARN, 1730 1746 "Linear splines have not been implemented."); 1731 1747 return(NULL); 1732 for (i=0;i<spline->n;i++) {} 1733 1734 } 1735 else if (3 == (spline->spline[0])->n) { 1748 } else if (3 == (spline->spline[0])->n) { 1736 1749 psLogMsg(__func__, PS_LOG_WARN, 1737 1750 "Cubic splines have not been implemented.");
Note:
See TracChangeset
for help on using the changeset viewer.
