Changeset 5655 for trunk/psLib/src/math/psMinimize.c
- Timestamp:
- Dec 1, 2005, 1:36:23 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimize.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimize.c
r5624 r5655 10 10 * @author EAM, IfA 11 11 * 12 * @version $Revision: 1.14 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-1 1-30 02:00:09$12 * @version $Revision: 1.147 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-12-01 23:36:23 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1756 1756 } 1757 1757 1758 // does the solution in place 1759 psGaussJordan (A, B); 1760 1761 // the first nTerm entries in B correspond directly to the desired 1762 // polynomial coefficients. this is only true for the 1D case 1763 for (int k = 0; k < nTerm; k++) { 1764 myPoly->coeff[k] = B->data.F64[k]; 1765 } 1758 // GaussJordan version 1759 if (0) { 1760 // does the solution in place 1761 psGaussJordan (A, B); 1762 1763 // the first nTerm entries in B correspond directly to the desired 1764 // polynomial coefficients. this is only true for the 1D case 1765 for (int k = 0; k < nTerm; k++) { 1766 myPoly->coeff[k] = B->data.F64[k]; 1767 } 1768 } else { 1769 // LUD version of the fit 1770 psImage *ALUD = NULL; 1771 psVector* outPerm = NULL; 1772 psVector* coeffs = NULL; 1773 1774 ALUD = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); 1775 ALUD = psMatrixLUD(ALUD, &outPerm, A); 1776 coeffs = psMatrixLUSolve(coeffs, ALUD, B, outPerm); 1777 for (int k = 0; k < nTerm; k++) { 1778 myPoly->coeff[k] = coeffs->data.F64[k]; 1779 } 1780 psFree(ALUD); 1781 psFree(coeffs); 1782 psFree(outPerm); 1783 } 1784 1766 1785 1767 1786 psFree(A);
Note:
See TracChangeset
for help on using the changeset viewer.
