IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24082


Ignore:
Timestamp:
May 6, 2009, 2:15:39 PM (17 years ago)
Author:
eugene
Message:

report on error from gauss-jordan

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/gaussj.c

    r20936 r24082  
    4747  status = dgaussjordan (a, b, N, 1);
    4848
    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;
    5254
    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];
    5660    }
    57     vf[i] = b[i][0];
    5861  }
    5962
     
    6669
    6770  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");
    6972  }
    7073  return (status);
Note: See TracChangeset for help on using the changeset viewer.