Changeset 37690
- Timestamp:
- Nov 28, 2014, 4:02:50 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/libohana
- Files:
-
- 3 edited
-
include/ohana.h (modified) (1 diff)
-
src/gaussj.c (modified) (4 diffs)
-
src/vstats.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/libohana/include/ohana.h
r37546 r37690 341 341 char *ohana_version PROTO((void)); 342 342 343 int dgaussjordan_pivot PROTO((double **A, double **B, int N, int M, double minPivot)); 343 344 int dgaussjordan PROTO((double **A, double **B, int N, int M)); 344 345 int fgaussjordan PROTO((float **A, float **B, int n, int m)); -
branches/eam_branches/ipp-20140904/Ohana/src/libohana/src/gaussj.c
r37689 r37690 3 3 # define VERY_VERBOSE 0 4 4 # define MAX_RANGE 1.0e16 5 # define MIN_PIVOT 1.0e-76 5 7 6 // Gauss-Jordan elimination using full pivots based on Press et al's description. Substantially … … 10 9 // than their implementation. (largely based on version by William Kahan) 11 10 11 int dgaussjordan (double **A, double **B, int N, int M) { 12 13 # define myMIN_PIVOT 1.0e-7 14 int status = dgaussjordan_pivot (A, B, N, M, myMIN_PIVOT); 15 return status; 16 } 17 12 18 // MAX_RANGE is used to test for ill-conditioned input matrices. For an ill-conditioned 13 19 // matrix, one or more of the pivots trends towards zero. Rather than allow this to go to the 14 20 // numerical precision, I am raising an error if |growth| > 1e8 15 int dgaussjordan (double **A, double **B, int N, int M) {21 int dgaussjordan_pivot (double **A, double **B, int N, int M, double MIN_PIVOT) { 16 22 17 23 int *colIndex; … … 106 112 double tmpval = 1.0 / A[maxcol][maxcol]; 107 113 114 # if (0) 108 115 if (fabs(A[maxcol][maxcol]) < MIN_PIVOT) { 109 116 // we are ill-conditioned. set this row & col to 0.0, 1.0 on pivot … … 115 122 continue; 116 123 } 117 124 # endif 118 125 119 126 // XXX why is this here (don't I double count this element?) A[maxcol][maxcol] = 1.0; -
branches/eam_branches/ipp-20140904/Ohana/src/libohana/src/vstats.c
r37444 r37690 189 189 for (i = ks; i < ke; i++) { 190 190 M = SQ (value[i] - Mo); 191 dM = SQ (dvalue[i]);191 dM = dvalue ? SQ (dvalue[i]) : 1.0; 192 192 X2 += M / dM; 193 193 dS += M; 194 194 } 195 X2 = X2 / (Nm - 1);195 X2 = dvalue ? X2 / (Nm - 1) : NAN; 196 196 dS = sqrt (dS / (Nm - 1)); 197 197
Note:
See TracChangeset
for help on using the changeset viewer.
