IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3716


Ignore:
Timestamp:
Apr 18, 2005, 9:00:20 PM (21 years ago)
Author:
gusciora
Message:

Slightly nicer way of allocating memory for the coords.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astronomy/tst_psAstrometry01.c

    r3715 r3716  
    55*  @author GLG, MHPCC
    66*
    7 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2005-04-19 05:46:24 $
     7*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2005-04-19 07:00:20 $
    99*
    1010* XXX: Must test
     
    693693
    694694/******************************************************************************
    695 test04(): We test psPlaneTransformCombine() with a wariety of input
     695test04(): We test psPlaneTransformCombine() with a variety of input
    696696transforms, as well as input coordinates, as well as erroneous input
    697697parameters.
     
    780780/******************************************************************************
    781781XXX: This is only a rudimentary test of the psPlaneTransformFit() function.
    782 It tests a few NULL input parameter conditions.
    783  
    784 XXX: We call it with acceptable data, but we do not verify the output.
     782It tests a few NULL input parameter conditions, and some simple linear
     783transformations.
    785784 *****************************************************************************/
    786785psS32 test5( void )
     
    793792    bool rc;
    794793
    795 
    796794    //
    797795    // We set an arbitrary non-linear transformation.
    798796    //
    799 
    800797    for (psS32 x = 0 ; x < TST05_X_POLY_ORDER ; x++) {
    801798        for (psS32 y = 0 ; y < TST05_Y_POLY_ORDER ; y++) {
     
    824821    //
    825822    // We generate a grid of input data points in the x1,y1 plane, calculate the
    826     // corresponding valuesin the x2,y2 in the transformed plane, and set these to
     823    // corresponding values in the transformed plane, and set these to
    827824    // the src and dst psVectors.
    828825    //
    829     psPlane *inData = psPlaneAlloc();
    830     psPlane *outData = NULL;
    831826    psS32 i = 0;
    832     for (inData->x = TST05_X_MIN ; inData->x < TST05_X_MAX ; inData->x+= (TST05_X_MAX-TST05_X_MIN)/TST05_NUM_X) {
    833         for (inData->y = TST05_Y_MIN ; inData->y < TST05_Y_MAX ; inData->y+= (TST05_Y_MAX-TST05_Y_MIN)/TST05_NUM_Y) {
     827    for (psF32 x = TST05_X_MIN ; x < TST05_X_MAX ; x+= (TST05_X_MAX-TST05_X_MIN)/TST05_NUM_X) {
     828        for (psF32 y = TST05_Y_MIN ; y < TST05_Y_MAX ; y+= (TST05_Y_MAX-TST05_Y_MIN)/TST05_NUM_Y) {
    834829            src->data[i] = (psPtr *) psPlaneAlloc();
    835             dst->data[i] = (psPtr *) psPlaneAlloc();
    836 
    837             ((psPlane *) src->data[i])->x = inData->x;
    838             ((psPlane *) src->data[i])->y = inData->y;
    839 
    840             outData = psPlaneTransformApply(NULL, transInit, inData);
    841 
    842             ((psPlane *) dst->data[i])->x = outData->x;
    843             ((psPlane *) dst->data[i])->y = outData->y;
    844             psFree(outData);
    845 
     830            ((psPlane *) src->data[i])->x = x;
     831            ((psPlane *) src->data[i])->y = y;
     832
     833            dst->data[i] = psPlaneTransformApply(NULL, transInit, ((psPlane *) src->data[i]));
    846834            i++;
    847835        }
    848836    }
    849     psFree(inData);
    850837
    851838    printf("----------------------------------------------------------------------------------\n");
     
    909896    psFree(src);
    910897    psFree(dst);
     898
    911899    return(!testStatus);
    912900}
Note: See TracChangeset for help on using the changeset viewer.