IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 17, 2005, 12:17:29 PM (22 years ago)
Author:
desonia
Message:

changed psMatrixLUD to create the perm parameter according to the machine
size of 'size_t', which is used by GSL.

File:
1 edited

Legend:

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

    r2697 r3026  
    2020 *  @author Ross Harman, MHPCC
    2121 *
    22  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    23  *  @date $Date: 2004-12-11 00:16:38 $
     22 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     23 *  @date $Date: 2005-01-17 22:17:29 $
    2424 *
    2525 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    175175/*****************************************************************************/
    176176
    177 psImage* psMatrixLUD(psImage* outImage, psVector* outPerm, psImage* inImage)
     177psImage* psMatrixLUD(psImage* outImage, psVector** outPerm, psImage* inImage)
    178178{
    179179    psS32 signum = 0;
     
    190190    PS_CHECK_POINTERS(inImage, outImage, outImage);
    191191    PS_CHECK_DIMEN_AND_TYPE(inImage, PS_DIMEN_IMAGE, outImage);
    192     PS_VECTOR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT);
    193     PS_CHECK_DIMEN_AND_TYPE(outPerm, PS_DIMEN_VECTOR, outImage);
     192    PS_PTR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT);
    194193    psImageRecycle(outImage, inImage->numCols, inImage->numRows, inImage->type.type);
    195     psVectorRecycle(outPerm, inImage->numRows, inImage->type.type);
    196194    PS_CHECK_SQUARE(inImage, outImage);
    197195    PS_CHECK_SQUARE(outImage, outImage);
     
    203201    // Initialize GSL data
    204202    perm.size = numCols;
    205     outPerm->n = numCols;
    206     perm.data = outPerm->data.V;
     203    if (sizeof(size_t) == 4) {
     204        *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S32);
     205    } else if (sizeof(size_t) == 8) {
     206        *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S64);
     207    } else {
     208        psError(PS_ERR_UNKNOWN, true,
     209                "Failed to allocate the permutation vector; "
     210                "could not determine the cooresponding data type.");
     211        psMatrixLUD_EXIT;
     212    }
     213
     214    (*outPerm)->n = numCols;
     215    perm.data = (*outPerm)->data.V;
    207216    lu = gsl_matrix_alloc(numRows, numCols);
    208217
     
    244253    PS_CHECK_DIMEN_AND_TYPE(inVector, PS_DIMEN_VECTOR, outVector);
    245254    PS_VECTOR_CHECK_NULL(inPerm, outVector);
    246     PS_CHECK_DIMEN_AND_TYPE(inPerm, PS_DIMEN_VECTOR, outVector);
    247255    psVectorRecycle(outVector, inImage->numRows, inImage->type.type);
    248256
Note: See TracChangeset for help on using the changeset viewer.