IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 18, 2006, 12:20:45 PM (20 years ago)
Author:
Paul Price
Message:

Updating to use psLib rel11. Main problem was that vector and array lengths ('n' element) are no longer set to equal the number of allocated values ('nalloc' element) when allocated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/stacInvertMaps.c

    r6450 r6887  
    1414    int nMaps = maps->n;                // Number of maps
    1515    psArray *inverted = psArrayAlloc(nMaps); // Array of inverted maps for output
     16    inverted->n = nMaps;
    1617
    1718    psTrace("stac.invertMaps", 1, "Inverting maps....\n");
     
    4546        psVector *xOut = psVectorAlloc(NUM_GRID * NUM_GRID, PS_TYPE_F32);
    4647        psVector *yOut = psVectorAlloc(NUM_GRID * NUM_GRID, PS_TYPE_F32);
     48        xIn->n = NUM_GRID * NUM_GRID;
     49        yIn->n = NUM_GRID * NUM_GRID;
     50        xOut->n = NUM_GRID * NUM_GRID;
     51        yOut->n = NUM_GRID * NUM_GRID;
    4752
    4853        // Create grid of points
     
    6671        psVector *xVector = psVectorAlloc(nCoeff, PS_TYPE_F64); // Vector for solution in x
    6772        psVector *yVector = psVectorAlloc(nCoeff, PS_TYPE_F64); // Vector for solution in y
     73        xVector->n = nCoeff;
     74        yVector->n = nCoeff;
    6875        for (int i = 0; i < nCoeff; i++) {
    6976            for (int j = 0; j < nCoeff; j++) {
     
    104111        // Solution via LU Decomposition
    105112        psVector *permutation = psVectorAlloc(nCoeff, PS_TYPE_F64); // Permutation vector for LU Decomposition
     113        permutation->n = nCoeff;
    106114        psImage *luMatrix = psMatrixLUD(NULL, &permutation, matrix); // LU decomposed matrix
    107115        psVector *xSolution = psMatrixLUSolve(NULL, luMatrix, xVector, permutation); // Solution in x
Note: See TracChangeset for help on using the changeset viewer.