IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3882


Ignore:
Timestamp:
May 11, 2005, 11:49:01 AM (21 years ago)
Author:
desonia
Message:

replaced BSD random() function with POSIX rand() funciton.

File:
1 edited

Legend:

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

    r3769 r3882  
    55*  @author GLG, MHPCC
    66*
    7 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2005-04-26 19:53:30 $
     7*  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2005-05-11 21:49:01 $
    99*
    1010* XXX: Must test
     
    2121*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    2222*/
     23
     24#include <stdlib.h>
    2325
    2426#include "psTest.h"
     
    797799    for (psS32 x = 0 ; x < TST05_X_POLY_ORDER ; x++) {
    798800        for (psS32 y = 0 ; y < TST05_Y_POLY_ORDER ; y++) {
    799             transInit->x->coeff[x][y] = ((psF32) (random() % 1000000)) / 100000.0;
    800             transInit->y->coeff[x][y] = ((psF32) (random() % 1000000)) / 100000.0;
     801            transInit->x->coeff[x][y] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
     802            transInit->y->coeff[x][y] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
    801803        }
    802804    }
     
    954956    for (psS32 n = 0 ; n < 100 ; n++) {
    955957        //
    956         // We create a random linear transformation and hope it is invertible.
     958        // We create a rand() linear transformation and hope it is invertible.
    957959        //
    958         trans->x->coeff[0][0] = ((psF32) (random() % 1000000)) / 100000.0;
    959         trans->x->coeff[0][1] = ((psF32) (random() % 1000000)) / 100000.0;
    960         trans->x->coeff[1][0] = ((psF32) (random() % 1000000)) / 100000.0;
     960        trans->x->coeff[0][0] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
     961        trans->x->coeff[0][1] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
     962        trans->x->coeff[1][0] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
    961963        trans->x->coeff[1][1] = 0.0;
    962         trans->y->coeff[0][0] = ((psF32) (random() % 1000000)) / 100000.0;
    963         trans->y->coeff[0][1] = ((psF32) (random() % 1000000)) / 100000.0;
    964         trans->y->coeff[1][0] = ((psF32) (random() % 1000000)) / 100000.0;
     964        trans->y->coeff[0][0] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
     965        trans->y->coeff[0][1] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
     966        trans->y->coeff[1][0] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
    965967        trans->y->coeff[1][1] = 0.0;
    966968
Note: See TracChangeset for help on using the changeset viewer.