Changeset 24082
- Timestamp:
- May 6, 2009, 2:15:39 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.data/gaussj.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.data/gaussj.c
r20936 r24082 47 47 status = dgaussjordan (a, b, N, 1); 48 48 49 // output vector needs to be float, so re-cast it 50 ResetVector (B, OPIHI_FLT, N); 51 vf = B[0].elements.Flt; 49 // if dgaussjordan succeeds, replace the input values with the results 50 if (status) { 51 // output vector needs to be float, so re-cast it 52 ResetVector (B, OPIHI_FLT, N); 53 vf = B[0].elements.Flt; 52 54 53 for (i = 0; i < N; i++) { 54 for (j = 0; j < N; j++) { 55 m[i+j*N] = a[i][j]; 55 for (i = 0; i < N; i++) { 56 for (j = 0; j < N; j++) { 57 m[i+j*N] = a[i][j]; 58 } 59 vf[i] = b[i][0]; 56 60 } 57 vf[i] = b[i][0];58 61 } 59 62 … … 66 69 67 70 if (!status && !QUIET) { 68 gprint (GP_ERR, " failure in matrix solution\n");71 gprint (GP_ERR, "gaussjordan: ill-conditioned matrix; input values are retained\n"); 69 72 } 70 73 return (status);
Note:
See TracChangeset
for help on using the changeset viewer.
