diff options
author | joye <joye> | 2015-06-25 15:46:42 (GMT) |
---|---|---|
committer | joye <joye> | 2015-06-25 15:46:42 (GMT) |
commit | 945c8cd8efad48786d7fb8c5fcb88ca00c230977 (patch) | |
tree | 4fcbf73146aa081351cb7e64f446d0edd7417808 /src/bltVecMath.C | |
parent | 0a2c6340848a423fd27745507f467c13d73eba98 (diff) | |
download | blt-945c8cd8efad48786d7fb8c5fcb88ca00c230977.zip blt-945c8cd8efad48786d7fb8c5fcb88ca00c230977.tar.gz blt-945c8cd8efad48786d7fb8c5fcb88ca00c230977.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src/bltVecMath.C')
-rw-r--r-- | src/bltVecMath.C | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/bltVecMath.C b/src/bltVecMath.C index 06881d4..1e79a7b 100644 --- a/src/bltVecMath.C +++ b/src/bltVecMath.C @@ -1471,16 +1471,6 @@ static int VectorFunc(ClientData clientData, Tcl_Interp* interp, Vector *vPtr) return (*procPtr) (vPtr); } -#ifdef _WIN32 -static int Rand(Blt_Vector *vectorPtr) -{ - Vector *vPtr = (Vector *)vectorPtr; - for(double *vp=vPtr->valueArr+vPtr->first, *vend=vPtr->valueArr+vPtr->last; - vp <= vend; vp++) - *vp = double(rand())/RAND_MAX; - return TCL_OK; -} -#endif static MathFunction mathFunctions[] = { @@ -1507,11 +1497,7 @@ static MathFunction mathFunctions[] = {"q1", (void*)ScalarFunc, (ClientData)Q1}, {"q3", (void*)ScalarFunc, (ClientData)Q3}, {"prod", (void*)ScalarFunc, (ClientData)Product}, -#ifdef _WIN32 - {"random", (void*)VectorFunc, (ClientData)Rand}, -#else {"random", (void*)ComponentFunc, (ClientData)drand48}, -#endif {"round", (void*)ComponentFunc, (ClientData)Round}, {"sdev", (void*)ScalarFunc, (ClientData)StdDeviation}, {"sin", (void*)ComponentFunc, (ClientData)sin}, @@ -1603,3 +1589,15 @@ int Blt::ExprVector(Tcl_Interp* interp, char *string, Blt_Vector *vector) Vec_Free(value.vPtr); return TCL_OK; } + +#ifdef _WIN32 +double drand48(void) +{ + return (double)rand() / (double)RAND_MAX; +} + +void srand48(long int seed) +{ + srand(seed); +} +#endif |