|
From: <kin...@us...> - 2003-11-06 14:44:39
|
Update of /cvsroot/teem/teem/src/nrrd
In directory sc8-pr-cvs1:/tmp/cvs-serv23328/nrrd
Modified Files:
nrrdEnums.h enumsNrrd.c arith.c
Log Message:
added nrrdUnaryOpRand, accessible via unu 1op rand
Index: nrrdEnums.h
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/nrrdEnums.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** nrrdEnums.h 3 Oct 2003 19:20:33 -0000 1.38
--- nrrdEnums.h 6 Nov 2003 14:44:35 -0000 1.39
***************
*** 343,349 ****
nrrdUnaryOpSgn, /* 21 */
nrrdUnaryOpExists, /* 22 */
nrrdUnaryOpLast
};
! #define NRRD_UNARY_OP_MAX 22
--- 343,350 ----
nrrdUnaryOpSgn, /* 21 */
nrrdUnaryOpExists, /* 22 */
+ nrrdUnaryOpRand, /* 23 */
nrrdUnaryOpLast
};
! #define NRRD_UNARY_OP_MAX 23
Index: enumsNrrd.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/enumsNrrd.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** enumsNrrd.c 30 Sep 2003 09:26:50 -0000 1.25
--- enumsNrrd.c 6 Nov 2003 14:44:35 -0000 1.26
***************
*** 611,614 ****
--- 611,615 ----
#define nuSgn nrrdUnaryOpSgn
#define nuExs nrrdUnaryOpExists
+ #define nuRnd nrrdUnaryOpRand
char
***************
*** 636,640 ****
"abs",
"sgn",
! "exists"
};
--- 637,642 ----
"abs",
"sgn",
! "exists",
! "rand"
};
***************
*** 663,667 ****
"absolute value",
"sign of value (-1, 0, or 1)",
! "value is not infinity or NaN"
};
--- 665,670 ----
"absolute value",
"sign of value (-1, 0, or 1)",
! "value is not infinity or NaN",
! "random value between 0 and 1"
};
***************
*** 690,693 ****
--- 693,697 ----
"sgn", "sign",
"exists",
+ "rand",
""
};
***************
*** 716,720 ****
nuAbs, nuAbs,
nuSgn, nuSgn,
! nuExs
};
--- 720,725 ----
nuAbs, nuAbs,
nuSgn, nuSgn,
! nuExs,
! nuRnd
};
Index: arith.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/arith.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** arith.c 12 Sep 2003 12:10:05 -0000 1.31
--- arith.c 6 Nov 2003 14:44:35 -0000 1.32
***************
*** 142,145 ****
--- 142,146 ----
return (a < 0.0 ? -1 : (a > 0.0 ? 1 : 0));}
double _nrrdUnaryOpExists(double a) {return AIR_EXISTS(a);}
+ double _nrrdUnaryOpRand(double a) {return airRand();} /* wacky! */
double (*_nrrdUnaryOp[NRRD_UNARY_OP_MAX+1])(double) = {
***************
*** 166,170 ****
_nrrdUnaryOpAbs,
_nrrdUnaryOpSgn,
! _nrrdUnaryOpExists
};
--- 167,172 ----
_nrrdUnaryOpAbs,
_nrrdUnaryOpSgn,
! _nrrdUnaryOpExists,
! _nrrdUnaryOpRand
};
|