Changeset 7803 for trunk/projects/slimcurve/src/main/c/EcfGlobal.c
 Timestamp:
 11/08/11 10:47:14 (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/projects/slimcurve/src/main/c/EcfGlobal.c
r7781 r7803 467 467 default: 468 468 dbgprintf(1, "global_exps_instr: please update me!\n"); 469 GCI_ecf_free_matrix(covar); 470 GCI_ecf_free_matrix(alpha); 471 free(scaled_instr); 472 free(exp_conv[0]); 469 473 return 1; 470 474 } … … 599 603 ret = GCI_triple_integral_fitting_engine(xincr, summed, data_start, fit_end, 600 604 instr, ninstr, noise, sig, 601 &Z, &A, &tau, NULL, NULL, NULL, 1.5*(fit_endfit_start3));605 &Z, &A, &tau, NULL, NULL, NULL, (float)1.5*(fit_endfit_start3)); 602 606 603 607 dbgprintf(3, "In est_globals_instr, triple integral ret = %d\n", ret); … … 738 742 gparam, paramfree, nparam, restrain, fitfunc, 739 743 fitted, residuals, chisq_global, covar, alpha, 740 NULL, 1.5*(fit_endfit_startnparamfree), chisq_delta, 0);744 NULL, (float)1.5*(fit_endfit_startnparamfree), chisq_delta, 0); 741 745 742 746 dbgprintf(3, "In est_globals_instr, marquardt ret = %d\n", ret); … … 801 805 ret = GCI_triple_integral_fitting_engine(xincr, trans[i], data_start, fit_end, 802 806 instr, ninstr, noise, sig, 803 &Z, &A, &tau, NULL, NULL, NULL, 1.5*(fit_endfit_start3));807 &Z, &A, &tau, NULL, NULL, NULL, (float)1.5*(fit_endfit_start3)); 804 808 if (ret < 0) { 805 809 Z = 0; … … 1774 1778 } 1775 1779 } 1776 if (*chisq <= 0.0) *chisq = 1.0e3 08; // don't let chisq=0 through yfit being all ve1780 if (*chisq <= 0.0) *chisq = 1.0e38; // don't let chisq=0 through yfit being all ve 1777 1781 break; 1778 1782 … … 1888 1892 } 1889 1893 } 1890 if (*chisq <= 0.0) *chisq = 1.0e3 08; // don't let chisq=0 through yfit being all ve1894 if (*chisq <= 0.0) *chisq = 1.0e38; // don't let chisq=0 through yfit being all ve 1891 1895 break; 1892 1896 … … 2048 2052 k++; 2049 2053 if (k > MAXITERS) { 2054 free(ochisq_trans); 2050 2055 return 2; 2051 2056 } … … 2730 2735 for (i=0, instrsum=0; i<ninstr; i++) 2731 2736 instrsum += instr[i]; 2732 if (instrsum == 0) return 6; 2737 if (instrsum == 0) { 2738 GCI_ecf_free_matrix(covar); 2739 GCI_ecf_free_matrix(alpha); 2740 free(scaled_instr); 2741 return 6; 2742 } 2743 2733 2744 for (i=0; i<ninstr; i++) 2734 2745 scaled_instr[i] = instr[i] / instrsum; … … 2749 2760 if (ret < 0) { 2750 2761 dbgprintf(1, "Fit failed, ret = %d\n", ret); 2762 GCI_ecf_free_matrix(covar); 2763 GCI_ecf_free_matrix(alpha); 2764 free(scaled_instr); 2751 2765 return 10 + ret; 2752 2766 } … … 2768 2782 2769 2783 *df = ntrans * ((fit_end  fit_start)  mlocal)  mglobal; 2784 2785 GCI_ecf_free_matrix(covar); 2786 GCI_ecf_free_matrix(alpha); 2787 free(scaled_instr); 2770 2788 2771 2789 return ret; … … 2863 2881 k++; 2864 2882 if (k > MAXITERS) { 2883 free(ochisq_trans); 2865 2884 return 2; 2866 2885 }
Note: See TracChangeset
for help on using the changeset viewer.