IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2005, 2:51:28 PM (21 years ago)
Author:
drobbin
Message:

made request argument changes (apidelta-report-cycle6)

File:
1 edited

Legend:

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

    r4321 r4385  
    2121 *  @author Robert DeSonia, MHPCC
    2222 *
    23  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    24  *  @date $Date: 2005-06-20 22:42:29 $
     23 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     24 *  @date $Date: 2005-06-25 00:51:28 $
    2525 *
    2626 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    298298}
    299299
    300 psImage* psMatrixInvert(psImage* outImage, const psImage* inImage, float *det)
     300psImage* psMatrixInvert(psImage* out, const psImage* in, float *determinant)
    301301{
    302302    psS32 signum = 0;
     
    307307    gsl_permutation *perm = NULL;
    308308
    309     #define INVERT_CLEANUP { psFree(outImage); return NULL; }
    310     // Error checks
    311     PS_ASSERT_GENERAL_PTR_NON_NULL(det, INVERT_CLEANUP);
    312     PS_ASSERT_GENERAL_IMAGE_NON_NULL(inImage, INVERT_CLEANUP);
    313     PS_CHECK_POINTERS(inImage, outImage, INVERT_CLEANUP);
    314     PS_CHECK_DIMEN_AND_TYPE(inImage, PS_DIMEN_IMAGE, INVERT_CLEANUP);
    315     PS_ASSERT_GENERAL_IMAGE_NON_EMPTY(inImage, INVERT_CLEANUP);
    316 
    317     outImage = psImageRecycle(outImage, inImage->numCols, inImage->numRows, inImage->type.type);
    318 
    319     PS_CHECK_SQUARE(inImage, INVERT_CLEANUP);
    320     PS_CHECK_SQUARE(outImage, INVERT_CLEANUP);
     309    #define INVERT_CLEANUP { psFree(out); return NULL; }
     310    // Error checks
     311    PS_ASSERT_GENERAL_PTR_NON_NULL(determinant, INVERT_CLEANUP);
     312    PS_ASSERT_GENERAL_IMAGE_NON_NULL(in, INVERT_CLEANUP);
     313    PS_CHECK_POINTERS(in, out, INVERT_CLEANUP);
     314    PS_CHECK_DIMEN_AND_TYPE(in, PS_DIMEN_IMAGE, INVERT_CLEANUP);
     315    PS_ASSERT_GENERAL_IMAGE_NON_EMPTY(in, INVERT_CLEANUP);
     316
     317    out = psImageRecycle(out, in->numCols, in->numRows, in->type.type);
     318
     319    PS_CHECK_SQUARE(in, INVERT_CLEANUP);
     320    PS_CHECK_SQUARE(out, INVERT_CLEANUP);
    321321
    322322    // Initialize data
    323     numRows = inImage->numRows;
    324     numCols = inImage->numCols;
     323    numRows = in->numRows;
     324    numCols = in->numCols;
    325325
    326326    // Initialize GSL data
     
    328328    lu = gsl_matrix_alloc(numRows, numCols);
    329329    inv = gsl_matrix_alloc(numRows, numCols);
    330     psImageToGslMatrix(lu, inImage);
     330    psImageToGslMatrix(lu, in);
    331331
    332332    // Invert data and calculate determinant
    333333    gsl_linalg_LU_decomp(lu, perm, &signum);
    334334    gsl_linalg_LU_invert(lu, perm, inv);
    335     *det = (float)gsl_linalg_LU_det(lu, signum);
     335    *determinant = (float)gsl_linalg_LU_det(lu, signum);
    336336
    337337    // Copy GSL matrix data to psImage data
    338     gslMatrixToPsImage(outImage, inv);
     338    gslMatrixToPsImage(out, inv);
    339339
    340340    // Free GSL structs
     
    343343    gsl_matrix_free(inv);
    344344
    345     return outImage;
     345    return out;
    346346}
    347347
Note: See TracChangeset for help on using the changeset viewer.