IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 20, 2005, 3:40:10 PM (21 years ago)
Author:
drobbin
Message:

made minor changes in accordance with newest api-delta doc

File:
1 edited

Legend:

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

    r4540 r4589  
    2121 *  @author Robert DeSonia, MHPCC
    2222 *
    23  *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    24  *  @date $Date: 2005-07-12 19:12:01 $
     23 *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     24 *  @date $Date: 2005-07-21 01:40:10 $
    2525 *
    2626 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9595
    9696/** Static function to copy psF32 or psF64 vector data to a GSL vector */
    97 static void  psVectorToGslVector(gsl_vector *outGslVector, const psVector *inVector)
     97static void  psVectorToGslVector(gsl_vector *outGslVector,
     98                                 const psVector *inVector)
    9899{
    99100    psU32 i = 0;
     
    112113
    113114/** Static function to copy GSL vector data to a psF32 or psF64 vector */
    114 static void gslVectorToPsVector(psVector *outVector, gsl_vector *inGslVector)
     115static void gslVectorToPsVector(psVector *outVector,
     116                                gsl_vector *inGslVector)
    115117{
    116118    psU32 i = 0;
     
    129131
    130132/** Static function to copy psF32 or psF64 image data to a GSL matrix */
    131 static void  psImageToGslMatrix(gsl_matrix *outGslMatrix, const psImage *inImage)
     133static void  psImageToGslMatrix(gsl_matrix *outGslMatrix,
     134                                const psImage *inImage)
    132135{
    133136    psU32 i = 0;
     
    155158
    156159/** Static function to copy GSL matrix data to a psF32 or psF64 image */
    157 static void gslMatrixToPsImage(psImage *outImage, gsl_matrix *inGslMatrix)
     160static void gslMatrixToPsImage(psImage *outImage,
     161                               gsl_matrix *inGslMatrix)
    158162{
    159163    psU32 i = 0;
     
    185189/*****************************************************************************/
    186190
    187 psImage* psMatrixLUD(psImage* out, psVector** perm, psImage* in)
     191psImage* psMatrixLUD(psImage* out,
     192                     psVector** perm,
     193                     const psImage* in)
    188194{
    189195    psS32 signum = 0;
     
    243249}
    244250
    245 psVector* psMatrixLUSolve(psVector* out, const psImage* LU, const psVector* RHS,
     251psVector* psMatrixLUSolve(psVector* out,
     252                          const psImage* LU,
     253                          const psVector* RHS,
    246254                          const psVector* perm)
    247255{
     
    298306}
    299307
    300 psImage* psMatrixInvert(psImage* out, const psImage* in, float *determinant)
     308psImage* psMatrixInvert(psImage* out,
     309                        const psImage* in,
     310                        float *determinant)
    301311{
    302312    psS32 signum = 0;
     
    346356}
    347357
    348 float *psMatrixDeterminant(const psImage* in)
     358float psMatrixDeterminant(const psImage* in)
    349359{
    350360    psS32 signum = 0;
    351361    psS32 numRows = 0;
    352362    psS32 numCols = 0;
    353     psF32 *det = NULL;
     363    psF32 det = 0;
    354364    gsl_matrix *lu = NULL;
    355365    gsl_permutation *perm = NULL;
    356366
    357     #define DETERMINANT_EXIT { return NULL; }
     367    #define DETERMINANT_EXIT { return 0; }
    358368    // Error checks
    359369    PS_ASSERT_GENERAL_IMAGE_NON_NULL(in, DETERMINANT_EXIT);
     
    372382
    373383    // Calculate determinant
    374     det = (psF32*)psAlloc(sizeof(psF32));
     384    //    det = psAlloc(sizeof(psF32));
    375385    gsl_linalg_LU_decomp(lu, perm, &signum);
    376     *det = (psF32)gsl_linalg_LU_det(lu, signum);
     386    det = (psF32)gsl_linalg_LU_det(lu, signum);
    377387
    378388    // Free GSL structs
     
    383393}
    384394
    385 psImage* psMatrixMultiply(psImage* out, psImage* in1, psImage* in2)
     395psImage* psMatrixMultiply(psImage* out,
     396                          const psImage* in1,
     397                          const psImage* in2)
    386398{
    387399    gsl_matrix *m1 = NULL;
     
    434446}
    435447
    436 psImage* psMatrixTranspose(psImage* out, const psImage* in)
     448psImage* psMatrixTranspose(psImage* out,
     449                           const psImage* in)
    437450{
    438451    psU32 i = 0;
     
    480493}
    481494
    482 psImage* psMatrixEigenvectors(psImage* out, psImage* in)
     495psImage* psMatrixEigenvectors(psImage* out,
     496                              const psImage* in)
    483497{
    484498    psS32 numRows = 0;
     
    529543}
    530544
    531 psVector* psMatrixToVector(psVector* outVector, const psImage* inImage)
     545psVector* psMatrixToVector(psVector* outVector,
     546                           const psImage* inImage)
    532547{
    533548    psS32 size = 0;
     
    593608}
    594609
    595 psImage* psVectorToMatrix(psImage* outImage, const psVector* inVector)
     610psImage* psVectorToMatrix(psImage* outImage,
     611                          const psVector* inVector)
    596612{
    597613    psS32 size = 0;
Note: See TracChangeset for help on using the changeset viewer.