Changeset 1859 for trunk/psLib/src/math/psSpline.c
- Timestamp:
- Sep 22, 2004, 6:56:41 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psSpline.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psSpline.c
r1846 r1859 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.3 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-2 2 01:30:21$9 * @version $Revision: 1.39 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-23 04:56:40 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 467 467 for (loop_x = 0; loop_x < myPoly->n; loop_x++) { 468 468 if (myPoly->mask[loop_x] == 0) { 469 psTrace(".psLib.dataManip.psFunctions.p_psOrdPolynomial1DEval", 10, 470 "polysum+= sum*coeff [%f+= (%f * %f)\n", polySum, xSum, myPoly->coeff[loop_x]); 469 471 polySum += xSum * myPoly->coeff[loop_x]; 470 472 xSum *= x; … … 1687 1689 1688 1690 /***************************************************************************** 1689 VectorBinDisectF32(): This is a private function which takes as input a1691 p_psVectorBinDisectF32(): This is a private function which takes as input a 1690 1692 vector of floating point data as well as a single floating point values. 1691 1693 The input vector values are assumed to be non-decreasing (v[i-1] <= v[j] for … … 1696 1698 XXX: Macro this for a few different types. 1697 1699 *****************************************************************************/ 1698 int VectorBinDisectF32(float *bins,1699 int numBins,1700 float x)1700 int p_psVectorBinDisectF32(float *bins, 1701 int numBins, 1702 float x) 1701 1703 { 1702 1704 int min; … … 1704 1706 int mid; 1705 1707 1706 psTrace(".psLib.dataManip.psFunctions. VectorBinDisectF32", 4,1707 "---- Calling VectorBinDisectF32(%f)\n", x);1708 psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectF32", 4, 1709 "---- Calling p_psVectorBinDisectF32(%f)\n", x); 1708 1710 1709 1711 if ((x < bins[0]) || 1710 1712 (x > bins[numBins-1])) { 1711 1713 psLogMsg(__func__, PS_LOG_WARN, 1712 " VectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).",1714 "p_psVectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).", 1713 1715 x, bins[0], bins[numBins-1]); 1714 1716 return(-1); … … 1720 1722 1721 1723 while (min != max) { 1722 psTrace(".psLib.dataManip.psFunctions. VectorBinDisectF32", 4,1724 psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectF32", 4, 1723 1725 "(min, mid, max) is (%d, %d, %d): (x, bins) is (%f, %f)\n", 1724 1726 min, mid, max, x, bins[mid]); 1725 1727 1726 1728 if (x == bins[mid]) { 1727 psTrace(".psLib.dataManip.psFunctions. VectorBinDisectF32", 4,1728 "---- Exiting VectorBinDisectF32(): bin %d\n", mid);1729 psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectF32", 4, 1730 "---- Exiting p_psVectorBinDisectF32(): bin %d\n", mid); 1729 1731 return(mid); 1730 1732 } else if (x < bins[mid]) { … … 1736 1738 } 1737 1739 1738 psTrace(".psLib.dataManip.psFunctions. VectorBinDisectF32", 4,1739 "---- Exiting VectorBinDisectF32(): bin %d\n", min);1740 psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectF32", 4, 1741 "---- Exiting p_psVectorBinDisectF32(): bin %d\n", min); 1740 1742 return(min); 1741 1743 } 1742 1744 1743 1745 /***************************************************************************** 1744 VectorBinDisectS32(): integer version of above.1746 p_psVectorBinDisectS32(): integer version of above. 1745 1747 *****************************************************************************/ 1746 int VectorBinDisectS32(int *bins,1747 int numBins,1748 int x)1748 int p_psVectorBinDisectS32(int *bins, 1749 int numBins, 1750 int x) 1749 1751 { 1750 1752 int min; … … 1752 1754 int mid; 1753 1755 1754 psTrace(".psLib.dataManip.psFunctions. VectorBinDisectS32", 4,1755 "---- Calling VectorBinDisectS32(%f)\n", x);1756 psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectS32", 4, 1757 "---- Calling p_psVectorBinDisectS32(%f)\n", x); 1756 1758 1757 1759 if ((x < bins[0]) || 1758 1760 (x > bins[numBins-1])) { 1759 1761 psLogMsg(__func__, PS_LOG_WARN, 1760 " VectorBinDisectS32(): ordinate %f is outside vector range (%f - %f).",1762 "p_psVectorBinDisectS32(): ordinate %f is outside vector range (%f - %f).", 1761 1763 x, bins[0], bins[numBins-1]); 1762 1764 return(-1); … … 1768 1770 1769 1771 while (min != max) { 1770 psTrace(".psLib.dataManip.psFunctions. VectorBinDisectS32", 4,1772 psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectS32", 4, 1771 1773 "(min, mid, max) is (%d, %d, %d): (x, bins) is (%f, %f)\n", 1772 1774 min, mid, max, x, bins[mid]); 1773 1775 1774 1776 if (x == bins[mid]) { 1775 psTrace(".psLib.dataManip.psFunctions. VectorBinDisectS32", 4,1776 "---- Exiting VectorBinDisectS32(): bin %d\n", min);1777 psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectS32", 4, 1778 "---- Exiting p_psVectorBinDisectS32(): bin %d\n", min); 1777 1779 return(min); 1778 1780 } else if (x < bins[mid]) { … … 1784 1786 } 1785 1787 1786 psTrace(".psLib.dataManip.psFunctions. VectorBinDisectS32", 4,1787 "---- Exiting VectorBinDisectS32(): bin %d\n", min);1788 psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectS32", 4, 1789 "---- Exiting p_psVectorBinDisectS32(): bin %d\n", min); 1788 1790 return(min); 1789 1791 } 1790 1792 1791 1793 /***************************************************************************** 1792 p_psVectorBinDisect(): A wrapper to the above VectorBinDisect().1794 p_psVectorBinDisect(): A wrapper to the above p_psVectorBinDisect(). 1793 1795 *****************************************************************************/ 1794 1796 int p_psVectorBinDisect(psVector *bins, … … 1801 1803 1802 1804 if (x->type.type == PS_TYPE_S32) { 1803 return( VectorBinDisectS32(bins->data.S32, bins->n, x->data.S32));1805 return(p_psVectorBinDisectS32(bins->data.S32, bins->n, x->data.S32)); 1804 1806 } else if (x->type.type == PS_TYPE_F32) { 1805 return( VectorBinDisectF32(bins->data.F32, bins->n, x->data.F32));1807 return(p_psVectorBinDisectF32(bins->data.F32, bins->n, x->data.F32)); 1806 1808 } else { 1807 1809 // XXX: Generate error message. … … 1879 1881 "---- p_ps1DInterpolateF32() begin ----\n"); 1880 1882 1881 binNum = VectorBinDisectF32(domain, n, x);1883 binNum = p_psVectorBinDisectF32(domain, n, x); 1882 1884 1883 1885 if (0 == numIntPoints%2) { … … 1953 1955 1954 1956 n = spline->n; 1955 binNum = VectorBinDisectF32(spline->domains, (spline->n)+1, x);1957 binNum = p_psVectorBinDisectF32(spline->domains, (spline->n)+1, x); 1956 1958 if (binNum == -1) { 1957 1959 psLogMsg(__func__, PS_LOG_WARN,
Note:
See TracChangeset
for help on using the changeset viewer.
