IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 5, 2005, 12:15:16 PM (21 years ago)
Author:
gusciora
Message:

Minor coding standard mods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psMinimize.c

    r3852 r3853  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.111 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-05-05 22:10:12 $
     11 *  @version $Revision: 1.112 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-05-05 22:15:16 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    808808}
    809809
    810 # define SWAP(X,Y) {double tmp=(X); (X) = (Y); (Y) = tmp;}
     810// XXX" put this in constants.h
     811# define PS_SWAP(X,Y) {double tmp=(X); (X) = (Y); (Y) = tmp;}
    811812
    812813// XXX EAM : temporary gauss-jordan solver based on gene's
     
    829830    indxr = psAlloc (Nx*sizeof(int));
    830831    ipiv  = psAlloc (Nx*sizeof(int));
    831     for (j = 0; j < Nx; j++)
     832    for (j = 0; j < Nx; j++) {
    832833        ipiv[j] = 0;
     834    }
    833835
    834836    irow = icol = 0;
     
    864866        if (irow != icol) {
    865867            for (l = 0; l < Nx; l++) {
    866                 SWAP (matrix[irow][l], matrix[icol][l]);
    867             }
    868             SWAP (vector[irow], vector[icol]);
     868                PS_SWAP (matrix[irow][l], matrix[icol][l]);
     869            }
     870            PS_SWAP (vector[irow], vector[icol]);
    869871        }
    870872        indxr[i] = irow;
     
    886888                dum = matrix[ll][icol];
    887889                matrix[ll][icol] = 0.0;
    888                 for (l = 0; l < Nx; l++)
     890                for (l = 0; l < Nx; l++) {
    889891                    matrix[ll][l] -= matrix[icol][l]*dum;
     892                }
    890893                vector[ll] -= vector[icol]*dum;
    891894            }
     
    894897
    895898    for (l = Nx - 1; l >= 0; l--) {
    896         if (indxr[l] != indxc[l])
    897             for (k = 0; k < Nx; k++)
    898                 SWAP (matrix[k][indxr[l]], matrix[k][indxc[l]]);
     899        if (indxr[l] != indxc[l]) {
     900            for (k = 0; k < Nx; k++) {
     901                PS_SWAP (matrix[k][indxr[l]], matrix[k][indxc[l]]);
     902            }
     903        }
    899904    }
    900905    psFree (ipiv);
Note: See TracChangeset for help on using the changeset viewer.