Changeset 1798
- Timestamp:
- Sep 10, 2004, 5:03:36 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 10 edited
-
src/dataManip/psMinimize.c (modified) (14 diffs)
-
src/image/psImage.h (modified) (2 diffs)
-
src/math/psMinimize.c (modified) (14 diffs)
-
src/mathtypes/psImage.h (modified) (2 diffs)
-
src/sys/psLogMsg.c (modified) (2 diffs)
-
src/sys/psLogMsg.h (modified) (2 diffs)
-
src/sysUtils/psLogMsg.c (modified) (2 diffs)
-
src/sysUtils/psLogMsg.h (modified) (2 diffs)
-
test/dataManip/Makefile (modified) (2 diffs)
-
test/dataManip/tst_psFunc00.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psMinimize.c
r1781 r1798 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-1 0 22:25:59$11 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-11 03:03:36 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1244 1244 psTrace(".psLib.dataManip.p_psDetermineBracket", 4, 1245 1245 "---- p_psDetermineBracket() end (NULL) ----\n"); 1246 psFree(bracket); 1246 1247 return(NULL); 1247 1248 } … … 1293 1294 1294 1295 psTrace(".psLib.dataManip.p_psDetermineBracket", 6, 1295 "HMMM(%d): (%f %f %f) (%f %f %f)\n", iter, a, b, c, fa, fb, fc); 1296 "(a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", a, b, c, fa, fb, fc); 1297 1296 1298 while (iter > 0) { 1297 1299 psTrace(".psLib.dataManip.p_psDetermineBracket", 6, … … 1329 1331 1330 1332 psTrace(".psLib.dataManip.p_psDetermineBracket", 6, 1331 " HMMM(%d): (%f %f %f)(%f %f %f)\n", iter, a, b, c, fa, fb, fc);1333 "Iter(%d): (a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", iter, a, b, c, fa, fb, fc); 1332 1334 1333 1335 if (fa < fb) { … … 1370 1372 "---- p_psDetermineBracket() end (NULL) ----\n"); 1371 1373 return(NULL); 1372 }1373 1374 bool p_psDummyFunc(int dimNum,1375 psVector *params,1376 const psArray *coords,1377 psMinimizePowellFunc func)1378 {1379 return(true);1380 1374 } 1381 1375 … … 1494 1488 psTrace(".psLib.dataManip.psLineMin", 4, 1495 1489 "---- psLineMin() begin ----\n"); 1496 1497 for (i=0;i<params->n;i++) { 1498 if (paramMask->data.U8[i] == 0) { 1490 psTrace(".psLib.dataManip.psLineMin", 6, 1491 "min->maxIter is %d\n", min->maxIter); 1492 psTrace(".psLib.dataManip.psLineMin", 6, 1493 "min->tol is %f\n", min->tol); 1494 1495 if (paramMask != NULL) { 1496 for (i=0;i<params->n;i++) { 1497 if (paramMask->data.U8[i] == 0) { 1498 if (line->data.F32[i] >= FLT_EPSILON) { 1499 null = 1; 1500 psTrace(".psLib.dataManip.psLineMin", 4, 1501 "line->data.F32[%d] is %f\n", i, line->data.F32[i]); 1502 } 1503 } 1504 } 1505 } else { 1506 for (i=0;i<params->n;i++) { 1499 1507 if (line->data.F32[i] >= FLT_EPSILON) { 1500 1508 null = 1; … … 1504 1512 } 1505 1513 } 1514 1506 1515 if (null == 0) { 1507 1516 psTrace(".psLib.dataManip.psLineMin", 2, … … 1514 1523 tmpc = psVectorAlloc(params->n, PS_TYPE_F32); 1515 1524 tmpn = psVectorAlloc(params->n, PS_TYPE_F32); 1516 1517 1525 1518 1526 for (i=0;i<params->n;i++) { … … 1526 1534 bracket = p_psDetermineBracket(params, line, paramMask, coords, func); 1527 1535 if (bracket == NULL) { 1536 psFree(tmpa); 1537 psFree(tmpb); 1538 psFree(tmpc); 1539 psFree(tmpn); 1528 1540 psAbort(__func__, "(1) Could not bracket minimum."); 1529 1541 } … … 1554 1566 fc = func(tmpc, coords); 1555 1567 psTrace(".psLib.dataManip.psLineMin", 6, 1556 "Iteration %d: f(%f %f %f) is (%f %f %f)\n", min->iter, a, b, c, fa, fb, fc); 1568 "Iteration %d: f(%f %f %f) is (%f %f %f)\n", min->iter, 1569 a, b, c, fa, fb, fc); 1557 1570 1558 1571 // We determine which is the biggest segment in [a,b,c] then split … … 1608 1621 psFree(tmpn); 1609 1622 psTrace(".psLib.dataManip.psLineMin", 4, 1610 "---- psLineMin() end (%f) ----\n", mul);1623 "---- psLineMin() end.a (%f) ----\n", mul); 1611 1624 return(mul); 1612 1625 } … … 1620 1633 1621 1634 psTrace(".psLib.dataManip.psLineMin", 4, 1622 "---- psLineMin() end (0.0) ----\n");1635 "---- psLineMin() end.b (0.0) ----\n"); 1623 1636 return(0.0); 1624 1637 } … … 1663 1676 psTrace(".psLib.dataManip.psMinimizePowell", 4, 1664 1677 "---- psMinimizePowell() begin ----\n"); 1678 psTrace(".psLib.dataManip.psMinimizePowell", 6, 1679 "min->maxIter is %d\n", min->maxIter); 1680 psTrace(".psLib.dataManip.psMinimizePowell", 6, 1681 "min->tol is %f\n", min->tol); 1665 1682 1666 1683 pQP = psVectorAlloc(numDims, PS_TYPE_F32); … … 1704 1721 for (i=0;i<numDims;i++) { 1705 1722 if (paramMask->data.U8[i] == 0) { 1723 dummyMin.maxIter = 100; 1724 dummyMin.tol = 0.01; 1706 1725 mul = psLineMin(&dummyMin, Q, v[i], paramMask, coords, func); 1707 1726 if (fabs(dummyMin.value - currFuncVal) > biggestDiff) { -
trunk/psLib/src/image/psImage.h
r1634 r1798 1 2 1 /** @file psImage.h 3 2 * … … 12 11 * @author Ross Harman, MHPCC 13 12 * 14 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 8-27 19:05:40$13 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-11 03:03:36 $ 16 15 * 17 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psMinimize.c
r1781 r1798 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-1 0 22:25:59$11 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-11 03:03:36 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1244 1244 psTrace(".psLib.dataManip.p_psDetermineBracket", 4, 1245 1245 "---- p_psDetermineBracket() end (NULL) ----\n"); 1246 psFree(bracket); 1246 1247 return(NULL); 1247 1248 } … … 1293 1294 1294 1295 psTrace(".psLib.dataManip.p_psDetermineBracket", 6, 1295 "HMMM(%d): (%f %f %f) (%f %f %f)\n", iter, a, b, c, fa, fb, fc); 1296 "(a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", a, b, c, fa, fb, fc); 1297 1296 1298 while (iter > 0) { 1297 1299 psTrace(".psLib.dataManip.p_psDetermineBracket", 6, … … 1329 1331 1330 1332 psTrace(".psLib.dataManip.p_psDetermineBracket", 6, 1331 " HMMM(%d): (%f %f %f)(%f %f %f)\n", iter, a, b, c, fa, fb, fc);1333 "Iter(%d): (a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", iter, a, b, c, fa, fb, fc); 1332 1334 1333 1335 if (fa < fb) { … … 1370 1372 "---- p_psDetermineBracket() end (NULL) ----\n"); 1371 1373 return(NULL); 1372 }1373 1374 bool p_psDummyFunc(int dimNum,1375 psVector *params,1376 const psArray *coords,1377 psMinimizePowellFunc func)1378 {1379 return(true);1380 1374 } 1381 1375 … … 1494 1488 psTrace(".psLib.dataManip.psLineMin", 4, 1495 1489 "---- psLineMin() begin ----\n"); 1496 1497 for (i=0;i<params->n;i++) { 1498 if (paramMask->data.U8[i] == 0) { 1490 psTrace(".psLib.dataManip.psLineMin", 6, 1491 "min->maxIter is %d\n", min->maxIter); 1492 psTrace(".psLib.dataManip.psLineMin", 6, 1493 "min->tol is %f\n", min->tol); 1494 1495 if (paramMask != NULL) { 1496 for (i=0;i<params->n;i++) { 1497 if (paramMask->data.U8[i] == 0) { 1498 if (line->data.F32[i] >= FLT_EPSILON) { 1499 null = 1; 1500 psTrace(".psLib.dataManip.psLineMin", 4, 1501 "line->data.F32[%d] is %f\n", i, line->data.F32[i]); 1502 } 1503 } 1504 } 1505 } else { 1506 for (i=0;i<params->n;i++) { 1499 1507 if (line->data.F32[i] >= FLT_EPSILON) { 1500 1508 null = 1; … … 1504 1512 } 1505 1513 } 1514 1506 1515 if (null == 0) { 1507 1516 psTrace(".psLib.dataManip.psLineMin", 2, … … 1514 1523 tmpc = psVectorAlloc(params->n, PS_TYPE_F32); 1515 1524 tmpn = psVectorAlloc(params->n, PS_TYPE_F32); 1516 1517 1525 1518 1526 for (i=0;i<params->n;i++) { … … 1526 1534 bracket = p_psDetermineBracket(params, line, paramMask, coords, func); 1527 1535 if (bracket == NULL) { 1536 psFree(tmpa); 1537 psFree(tmpb); 1538 psFree(tmpc); 1539 psFree(tmpn); 1528 1540 psAbort(__func__, "(1) Could not bracket minimum."); 1529 1541 } … … 1554 1566 fc = func(tmpc, coords); 1555 1567 psTrace(".psLib.dataManip.psLineMin", 6, 1556 "Iteration %d: f(%f %f %f) is (%f %f %f)\n", min->iter, a, b, c, fa, fb, fc); 1568 "Iteration %d: f(%f %f %f) is (%f %f %f)\n", min->iter, 1569 a, b, c, fa, fb, fc); 1557 1570 1558 1571 // We determine which is the biggest segment in [a,b,c] then split … … 1608 1621 psFree(tmpn); 1609 1622 psTrace(".psLib.dataManip.psLineMin", 4, 1610 "---- psLineMin() end (%f) ----\n", mul);1623 "---- psLineMin() end.a (%f) ----\n", mul); 1611 1624 return(mul); 1612 1625 } … … 1620 1633 1621 1634 psTrace(".psLib.dataManip.psLineMin", 4, 1622 "---- psLineMin() end (0.0) ----\n");1635 "---- psLineMin() end.b (0.0) ----\n"); 1623 1636 return(0.0); 1624 1637 } … … 1663 1676 psTrace(".psLib.dataManip.psMinimizePowell", 4, 1664 1677 "---- psMinimizePowell() begin ----\n"); 1678 psTrace(".psLib.dataManip.psMinimizePowell", 6, 1679 "min->maxIter is %d\n", min->maxIter); 1680 psTrace(".psLib.dataManip.psMinimizePowell", 6, 1681 "min->tol is %f\n", min->tol); 1665 1682 1666 1683 pQP = psVectorAlloc(numDims, PS_TYPE_F32); … … 1704 1721 for (i=0;i<numDims;i++) { 1705 1722 if (paramMask->data.U8[i] == 0) { 1723 dummyMin.maxIter = 100; 1724 dummyMin.tol = 0.01; 1706 1725 mul = psLineMin(&dummyMin, Q, v[i], paramMask, coords, func); 1707 1726 if (fabs(dummyMin.value - currFuncVal) > biggestDiff) { -
trunk/psLib/src/mathtypes/psImage.h
r1634 r1798 1 2 1 /** @file psImage.h 3 2 * … … 12 11 * @author Ross Harman, MHPCC 13 12 * 14 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 8-27 19:05:40$13 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-11 03:03:36 $ 16 15 * 17 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psLogMsg.c
r1761 r1798 1 2 1 /** @file psLogMsg.c 3 2 * @brief Procedures for logging messages. … … 12 11 * @author George Gusciora, MHPCC 13 12 * 14 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-09- 09 21:59:03$13 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-11 03:03:36 $ 16 15 * 17 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psLogMsg.h
r1448 r1798 1 2 1 /** @file psLogMsg.h 3 2 * @brief Procedures for logging messages. … … 12 11 * @author George Gusciora, MHPCC 13 12 * 14 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 8-10 01:55:34$13 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-11 03:03:36 $ 16 15 * 17 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psLogMsg.c
r1761 r1798 1 2 1 /** @file psLogMsg.c 3 2 * @brief Procedures for logging messages. … … 12 11 * @author George Gusciora, MHPCC 13 12 * 14 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-09- 09 21:59:03$13 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-11 03:03:36 $ 16 15 * 17 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psLogMsg.h
r1448 r1798 1 2 1 /** @file psLogMsg.h 3 2 * @brief Procedures for logging messages. … … 12 11 * @author George Gusciora, MHPCC 13 12 * 14 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 8-10 01:55:34$13 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-11 03:03:36 $ 16 15 * 17 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/dataManip/Makefile
r1782 r1798 3 3 ## Makefile: test/sysUtils 4 4 ## 5 ## $Revision: 1.3 7$ $Name: not supported by cvs2svn $6 ## $Date: 2004-09-1 0 22:52:22$5 ## $Revision: 1.38 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-09-11 03:03:18 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 44 44 tst_psMinimize03 \ 45 45 tst_psMinimize04 \ 46 tst_psMinimize05 \ 46 47 tst_psStats00 \ 47 48 tst_psStats01 \ -
trunk/psLib/test/dataManip/tst_psFunc00.c
r1784 r1798 2 2 This routine must ensure that the psPolynomial structures are 3 3 allocated and deallocated by the psPolynomialXXXlloc() procedures. 4 It also calls the various psPolynomialXXXEval() procedures. 4 5 *****************************************************************************/ 5 6 #include <stdio.h>
Note:
See TracChangeset
for help on using the changeset viewer.
