Index: /trunk/archive/pslib/Makefile
===================================================================
--- /trunk/archive/pslib/Makefile	(revision 203)
+++ /trunk/archive/pslib/Makefile	(revision 204)
@@ -1,3 +1,3 @@
-# $Id: Makefile,v 1.3 2004-03-10 03:54:14 rhl Exp $
+# $Id: Makefile,v 1.4 2004-03-10 19:30:03 eugene Exp $
 SHELL = /bin/sh
 DIRS = include
@@ -15,4 +15,7 @@
 	../Utilities/bin/check-namespace -d `find . ! -name \*#\* -name \*.[ha] -print`
 
+doxygen:
+	(cd include; doxygen)
+
 clean:
 	$(RM) *~ core* TAGS
Index: /trunk/archive/pslib/include/psMath.h
===================================================================
--- /trunk/archive/pslib/include/psMath.h	(revision 204)
+++ /trunk/archive/pslib/include/psMath.h	(revision 204)
@@ -0,0 +1,84 @@
+
+typedef enum {				// type of val is:
+    PS_DATA_FLOAT,			// float (.f)
+    PS_DATA_INT,			// int (.i)
+    PS_DATA_ARRAY,			// array (.v)
+    PS_DATA_IMAGE,			// image (.v)
+    PS_DATA_NTYPE			// Number of types; must be last
+} psDataItemType;
+
+/// basic data structure.
+typedef struct {
+    int id;
+    char *name;
+    psDataItemType type;
+    union {
+	float f;
+	int i;
+	void *v;
+    }
+} psDataItem;
+
+psDataItem *
+psDataItemBinaryOp (psDataItem *out,	///< destination value (may be NULL) 
+		    psDataItem *in1,	///< first input value 
+		    char *operator,	///< operator 
+		    psDataItem *in2	///< second input value 
+);
+
+psDataItem *
+psDataItemUnaryOp (psDataItem *out,	///< destination value (may be NULL) 
+		   psDataItem *in1,	///< input value 
+		   char *operator	///< operator 
+);
+
+/*** test: given an image "A", calculate log (a^2) ***/
+
+/*** example 1: data type abstraction */
+
+psImage A, Y;
+psDI a, b, x, y;
+
+a.v = A;
+a.type = PS_DATA_IMAGE;
+x.f = 2.0;
+x.type = PS_DATA_FLOAT;
+
+b = psDataItemBinaryOp (NULL, a, "^", x);
+y = psDataItemUnaryOp (NULL, b, "log");
+Y = y.v;
+
+/*** example 2: explicit functions ***/
+
+psImage A, B, Y;
+
+B = psImageOpScalar (NULL, A, "^", 2.0);
+Y = psImageOp (NULL, B, "log");
+
+/* in the later example, we would have the following functions */
+
+/// Perform a binary operation on two images.
+psImage *
+psImageOpImage (psImage *out,		///< destination image (may be NULL) 
+		psImage *in1,		///< first input image 
+		char *operator,		///< operator 
+		psImage *in2		///< second input image 
+);
+
+/// Perform a binary operation on two images.
+psImage *
+psImageOpScalar (psImage *out,		///< destination image (may be NULL) 
+		 psImage *in1,		///< input image 
+		 char *operator,	///< operator 
+		 float in2		///< input float 
+);
+
+/// Perform a binary operation on two images.
+psImage *
+psScalarOpImage (psImage *out,		///< destination image (may be NULL) 
+		 float in1,		///< input float 
+		 char *operator,	///< operator 
+		 psImage *in2		///< input image 
+);
+
+/** for a set of N data types, you need a collection of N^2 - 1 functions **/
