Changeset 38489
- Timestamp:
- Jun 18, 2015, 3:32:08 PM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150616/Ohana/src/addstar
- Files:
-
- 2 edited
-
include/loadgalphot.h (modified) (1 diff)
-
src/loadgalphot_fit2d.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150616/Ohana/src/addstar/include/loadgalphot.h
r38486 r38489 4 4 double **b; 5 5 double **c; 6 double **C; 7 double *B; 6 8 double *Cii; 7 9 int order; -
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/loadgalphot_fit2d.c
r38488 r38489 1 1 # include "addstar.h" 2 2 # include "loadgalphot.h" 3 # define VERY_VERBOSE 1 3 4 4 5 Fit2D *fit2d_init (int order) { … … 18 19 ALLOCATE (fit->s, double *, fit->mterm); 19 20 ALLOCATE (fit->b, double *, fit->wterm); 21 ALLOCATE (fit->B, double, fit->wterm); 20 22 ALLOCATE (fit->c, double *, fit->wterm); 23 ALLOCATE (fit->C, double *, fit->wterm); 21 24 for (i = 0; i < fit->wterm; i++) { 22 25 ALLOCATE_ZERO (fit->c[i], double, fit->wterm); 26 ALLOCATE_ZERO (fit->C[i], double, fit->wterm); 23 27 ALLOCATE_ZERO (fit->b[i], double, 1); 24 28 } … … 58 62 59 63 for (i = 0; i < fit->wterm; i++) { 64 free (fit->C[i]); 60 65 free (fit->c[i]); 61 66 free (fit->b[i]); 62 67 } 63 68 free (fit->b); 69 free (fit->B); 64 70 free (fit->c); 71 free (fit->C); 65 72 66 73 for (i = 0; i < fit->mterm; i++) { … … 137 144 } 138 145 146 # if (VERY_VERBOSE) 147 for (i = 0; i < fit->wterm; i++) { 148 for (j = 0; j < fit->wterm; j++) { 149 fit->C[i][j] = fit->c[i][j]; 150 } 151 fit->B[i] = fit->b[i][0]; 152 } 153 # endif 154 139 155 // invert the c,b matrix equation 140 156 status = dgaussjordan (fit->c, fit->b, fit->wterm, 1); 141 if (!status) return FALSE; 157 if (!status) { 158 # if (VERY_VERBOSE) 159 for (i = 0; i < fit->wterm; i++) { 160 for (j = 0; j < fit->wterm; j++) { 161 fprintf (stderr, "%10.3e ", fit->C[i][j]); 162 } 163 fprintf (stderr, " : %10.3e\n", fit->B[i]); 164 } 165 # endif 166 return FALSE; 167 } 142 168 143 169 /* the b[][0] terms are in the following order:
Note:
See TracChangeset
for help on using the changeset viewer.
