Changeset 4330 for trunk/psLib/src/math
- Timestamp:
- Jun 20, 2005, 5:01:37 PM (21 years ago)
- Location:
- trunk/psLib/src/math
- Files:
-
- 7 edited
-
psMinimize.h (modified) (4 diffs)
-
psPolynomial.c (modified) (4 diffs)
-
psPolynomial.h (modified) (5 diffs)
-
psRandom.c (modified) (6 diffs)
-
psRandom.h (modified) (6 diffs)
-
psSpline.c (modified) (4 diffs)
-
psSpline.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimize.h
r4321 r4330 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06-2 0 22:42:30$10 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-21 03:01:37 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 109 109 /** Minimizes a specified function based on the Levenberg-Marquardt method. 110 110 * 111 * @return psBool: True if successful.111 * @return bool: True if successful. 112 112 */ 113 113 bool psMinimizeLMChi2( … … 165 165 /** Minimizes a specified function based on the Powell method. 166 166 * 167 * @return psBool: True if successful.167 * @return bool: True if successful. 168 168 */ 169 169 bool psMinimizePowell( … … 209 209 /** Minimizes a specified function based on the Powell chi-squared method. 210 210 * 211 * @return psBool: True is successful.211 * @return bool: True is successful. 212 212 */ 213 213 bool psMinimizeChi2Powell( -
trunk/psLib/src/math/psPolynomial.c
r4315 r4330 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.1 09$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-06- 18 02:30:49$9 * @version $Revision: 1.110 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-21 03:01:37 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1822 1822 XXX: What should be the defualty type for knots be? psF32 is assumed. 1823 1823 *****************************************************************************/ 1824 psSpline1D *psSpline1DAlloc( psS32numSplines,1825 psS32order,1826 psF32min,1827 psF32max)1824 psSpline1D *psSpline1DAlloc(int numSplines, 1825 int order, 1826 float min, 1827 float max) 1828 1828 { 1829 1829 PS_ASSERT_INT_NONNEGATIVE(numSplines, NULL); … … 1867 1867 *****************************************************************************/ 1868 1868 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, 1869 psS32order)1869 int order) 1870 1870 { 1871 1871 PS_ASSERT_VECTOR_NON_NULL(bounds, NULL); … … 2125 2125 psF64. 2126 2126 *****************************************************************************/ 2127 psF32psSpline1DEval(2127 float psSpline1DEval( 2128 2128 const psSpline1D *spline, 2129 psF32x2129 float x 2130 2130 ) 2131 2131 { -
trunk/psLib/src/math/psPolynomial.h
r4315 r4330 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-06- 18 02:30:49$14 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-21 03:01:37 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 39 39 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 40 40 * 41 * @return psF32value on the gaussian curve given the input parameters41 * @return float value on the gaussian curve given the input parameters 42 42 */ 43 43 float psGaussian( … … 218 218 */ 219 219 psVector *psPolynomial2DEvalVector( 220 const psPolynomial2D * myPoly,///< Coefficients for the polynomial220 const psPolynomial2D *poly, ///< Coefficients for the polynomial 221 221 const psVector *x, ///< x locations at which to evaluate 222 222 const psVector *y ///< y locations at which to evaluate … … 444 444 * @return psSpline1D* new 1-D spline struct 445 445 */ 446 psSpline1D *psSpline1DAlloc( psS32 n,///< Number of spline polynomials447 psS32 order,///< Order of spline polynomials448 psF32min, ///< Lower boundary value of spline polynomials449 psF32max); ///< Upper boundary value of spline polynomials446 psSpline1D *psSpline1DAlloc(int n, ///< Number of spline polynomials 447 int order, ///< Order of spline polynomials 448 float min, ///< Lower boundary value of spline polynomials 449 float max); ///< Upper boundary value of spline polynomials 450 450 451 451 /** Allocates a psSpline1D structure … … 456 456 */ 457 457 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, ///< Bounds for spline polynomials 458 psS32 order);///< Order of spline polynomials458 int order); ///< Order of spline polynomials 459 459 460 460 /** Evaluates 1-D spline polynomials at a specific coordinate. 461 461 * 462 * @return psF32result of spline polynomials evaluated at given location463 */ 464 psF32psSpline1DEval(462 * @return float result of spline polynomials evaluated at given location 463 */ 464 float psSpline1DEval( 465 465 const psSpline1D *spline, ///< Coefficients for spline polynomials 466 psF32x ///< location at which to evaluate466 float x ///< location at which to evaluate 467 467 ); 468 468 -
trunk/psLib/src/math/psRandom.c
r4083 r4330 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-06- 01 23:51:25$12 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-06-21 03:01:37 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 57 57 58 58 psRandom *psRandomAlloc(psRandomType type, 59 psU64seed)59 unsigned long seed) 60 60 { 61 61 gsl_rng *r = NULL; … … 86 86 87 87 void psRandomReset(psRandom *rand, 88 psU64seed)88 unsigned long seed) 89 89 { 90 90 // Check null psRandom … … 103 103 } 104 104 105 psF64psRandomUniform(const psRandom *r)105 double psRandomUniform(const psRandom *r) 106 106 { 107 107 // Check null psRandom variable … … 116 116 } 117 117 118 psF64psRandomGaussian(const psRandom *r)118 double psRandomGaussian(const psRandom *r) 119 119 { 120 120 // Check null psRandom variable … … 130 130 } 131 131 132 psF64 psRandomPoisson(const psRandom *r, psF64mean)132 double psRandomPoisson(const psRandom *r, double mean) 133 133 { 134 134 // Check null psRandom variable -
trunk/psLib/src/math/psRandom.h
r4293 r4330 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-06- 17 00:11:05$12 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-06-21 03:01:37 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 54 54 psRandom *psRandomAlloc( 55 55 psRandomType type, ///< The type of RNG 56 psU64 seed///< Known value with which to seed the RNG56 unsigned long seed ///< Known value with which to seed the RNG 57 57 ); 58 58 … … 63 63 void psRandomReset( 64 64 psRandom *rand, ///< Existing psRandom struct to reset 65 psU64 seed///< Known value with which to seed the RNG65 unsigned long seed ///< Known value with which to seed the RNG 66 66 ); 67 67 … … 69 69 * Uses gsl_rng_uniform. 70 70 * 71 * @return psF64: Random number.71 * @return double: Random number. 72 72 */ 73 psF64psRandomUniform(73 double psRandomUniform( 74 74 const psRandom *r ///< psRandom struct for RNG 75 75 ); … … 78 78 * Uses gsl_ran_gaussian. 79 79 * 80 * @return psF64: Random number.80 * @return double: Random number. 81 81 */ 82 psF64psRandomGaussian(82 double psRandomGaussian( 83 83 const psRandom *r ///< psRandom struct for RNG 84 84 ); … … 87 87 * Uses gsl_ran_poisson. 88 88 * 89 * @return psF64: Random number.89 * @return double: Random number. 90 90 */ 91 psF64psRandomPoisson(91 double psRandomPoisson( 92 92 const psRandom *r, ///< psRandom struct for RNG 93 psF64mean ///< Mean value93 double mean ///< Mean value 94 94 ); 95 95 -
trunk/psLib/src/math/psSpline.c
r4315 r4330 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.1 09$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-06- 18 02:30:49$9 * @version $Revision: 1.110 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-21 03:01:37 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1822 1822 XXX: What should be the defualty type for knots be? psF32 is assumed. 1823 1823 *****************************************************************************/ 1824 psSpline1D *psSpline1DAlloc( psS32numSplines,1825 psS32order,1826 psF32min,1827 psF32max)1824 psSpline1D *psSpline1DAlloc(int numSplines, 1825 int order, 1826 float min, 1827 float max) 1828 1828 { 1829 1829 PS_ASSERT_INT_NONNEGATIVE(numSplines, NULL); … … 1867 1867 *****************************************************************************/ 1868 1868 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, 1869 psS32order)1869 int order) 1870 1870 { 1871 1871 PS_ASSERT_VECTOR_NON_NULL(bounds, NULL); … … 2125 2125 psF64. 2126 2126 *****************************************************************************/ 2127 psF32psSpline1DEval(2127 float psSpline1DEval( 2128 2128 const psSpline1D *spline, 2129 psF32x2129 float x 2130 2130 ) 2131 2131 { -
trunk/psLib/src/math/psSpline.h
r4315 r4330 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-06- 18 02:30:49$14 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-21 03:01:37 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 39 39 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 40 40 * 41 * @return psF32value on the gaussian curve given the input parameters41 * @return float value on the gaussian curve given the input parameters 42 42 */ 43 43 float psGaussian( … … 218 218 */ 219 219 psVector *psPolynomial2DEvalVector( 220 const psPolynomial2D * myPoly,///< Coefficients for the polynomial220 const psPolynomial2D *poly, ///< Coefficients for the polynomial 221 221 const psVector *x, ///< x locations at which to evaluate 222 222 const psVector *y ///< y locations at which to evaluate … … 444 444 * @return psSpline1D* new 1-D spline struct 445 445 */ 446 psSpline1D *psSpline1DAlloc( psS32 n,///< Number of spline polynomials447 psS32 order,///< Order of spline polynomials448 psF32min, ///< Lower boundary value of spline polynomials449 psF32max); ///< Upper boundary value of spline polynomials446 psSpline1D *psSpline1DAlloc(int n, ///< Number of spline polynomials 447 int order, ///< Order of spline polynomials 448 float min, ///< Lower boundary value of spline polynomials 449 float max); ///< Upper boundary value of spline polynomials 450 450 451 451 /** Allocates a psSpline1D structure … … 456 456 */ 457 457 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, ///< Bounds for spline polynomials 458 psS32 order);///< Order of spline polynomials458 int order); ///< Order of spline polynomials 459 459 460 460 /** Evaluates 1-D spline polynomials at a specific coordinate. 461 461 * 462 * @return psF32result of spline polynomials evaluated at given location463 */ 464 psF32psSpline1DEval(462 * @return float result of spline polynomials evaluated at given location 463 */ 464 float psSpline1DEval( 465 465 const psSpline1D *spline, ///< Coefficients for spline polynomials 466 psF32x ///< location at which to evaluate466 float x ///< location at which to evaluate 467 467 ); 468 468
Note:
See TracChangeset
for help on using the changeset viewer.
