prefix
#
#	Copyright 1993, Center for Computer Vision and Visualization,
#	University of Florida.  All rights reserved.
#

#
# $Log: float-operations.desc,v $
# Revision 1.11.1.2  1995/01/31  16:02:40  thoth
# Need to replace the upward conversions with something...
#
# Revision 1.11.1.1  1994/12/28  18:05:25  thoth
# image operations are now friendly with FBI.
# image ops now use operations table
# new sgn() function.
#
# Revision 1.11  1994/12/19  19:58:48  ljr
# DOS-inspired name rework.
#
# Revision 1.10  1994/10/14  20:43:19  thoth
# The inline is much more useful in the header file.
#
# Revision 1.9  1994/09/16  14:59:10  thoth
# add fabs(image)
#
# Revision 1.8  1994/07/08  16:14:11  thoth
# fixed problems caused by returning floats instead of doubles.
#
# Revision 1.7  1994/05/17  12:54:56  thoth
# Improved operations generation scheme.  Lines from the op.desc file can
# be quoted into the .c file to allow inclusion of infrastructure.  Also
# the op.desc output can be redirected to several files.  The prefix
# directive allows common information (include files) to be included in
# every generated source file.
#

# Float operations for the Float Discrete Image

"C#include "FloatDI.h"
"C#include "VectorI.h"
"C#include "ConstI.h"
"C#include "ImageIter.h"
"C#include "FBI.h"
"C#include "../valueset/OpTable.h"
end

filename FIO-to_int.c
unary pointwise to_int subop=int I(int) I(float)
filename FIO-to_uchar.c
unary pointwise to_uchar subop=u_char I(u_char) I(float)


filename FIO-__pl.c
binary pointwise commutative operator+ I(float) I(float) I(float)
binary pointwise commutative operator+ I(float) I(float) float
pointwise operator+= I(float) I(float)
pointwise operator+= I(float) float

filename FIO-__mi.c
binary pointwise non-commutative operator- I(float) I(float) I(float)
binary pointwise non-commutative operator- I(float) I(float) float
binary pointwise non-commutative operator- I(float) float I(float)
unary pointwise operator- I(float) I(float)
pointwise operator-= I(float) I(float)
pointwise operator-= I(float) float

filename FIO-__ml.c
binary pointwise commutative operator* I(float) I(float) I(float)
binary pointwise commutative operator* I(float) I(float) float
pointwise operator*= I(float) I(float)
pointwise operator*= I(float) float

#filename FIO-__mlBit.c
#binary pointwise commutative operator* I(float) I(float) I(IA_Bit)
#binary pointwise commutative operator* I(float) float I(IA_Bit)
#pointwise operator*= I(float) I(IA_Bit)

filename FIO-__dv.c
binary pointwise non-commutative operator/ I(float) I(float) I(float)
binary pointwise non-commutative operator/ I(float) I(float) float
binary pointwise non-commutative operator/ I(float) float I(float)
pointwise operator/= I(float) I(float)
pointwise operator/= I(float) float

"Cinline float pseudo_div(float a, float b)
"C{
"C    return (b==0) ? 0 : (a/b);
"C}
"C
"Cinline float pseudo_inv(float b)
"C{
"C    return (b==0) ? 0 : (1/b);
"C}
binary pointwise non-commutative pseudo_div I(float) I(float) I(float)
binary pointwise non-commutative pseudo_div I(float) I(float) float
binary pointwise non-commutative pseudo_div I(float) float I(float)
unary pointwise pseudo_inv I(float) I(float)



filename FIO-__aa.c
binary pointwise commutative operator&& I(float) I(float) I(float)
binary pointwise commutative operator&& I(float) I(float) float

filename FIO-__oo.c
binary pointwise commutative operator|| I(float) I(float) I(float)
binary pointwise commutative operator|| I(float) I(float) float

filename FIO-__nt.c
unary pointwise operator! I(float) I(float)



filename FIO-__lt.c
binary strictrel non-commutative operator< int I(float) I(float)
binary strictrel non-commutative operator< int I(float) float
binary strictrel non-commutative operator< int float I(float)

filename FIO-__le.c
binary strictrel non-commutative operator<= int I(float) I(float)
binary strictrel non-commutative operator<= int I(float) float
binary strictrel non-commutative operator<= int float I(float)

filename FIO-__eq.c
binary strictrel commutative operator== int I(float) I(float)
binary strictrel commutative operator== int I(float) float

filename FIO-strict_ne.c
binary strictrel commutative strict_ne subop=operator!= int I(float) I(float)
binary strictrel commutative strict_ne subop=operator!= int I(float) float

filename FIO-__ge.c
binary strictrel non-commutative operator>= int I(float) I(float)
binary strictrel non-commutative operator>= int I(float) float
binary strictrel non-commutative operator>= int float I(float)

filename FIO-__gt.c
binary strictrel non-commutative operator> int I(float) I(float)
binary strictrel non-commutative operator> int I(float) float
binary strictrel non-commutative operator> int float I(float)

filename FIO-X_lt.c
binary pointwise non-commutative chi_lt subop=operator< I(IA_Bit) I(float) I(float)
binary pointwise non-commutative chi_lt subop=operator< I(IA_Bit) I(float) float
binary pointwise non-commutative chi_lt subop=operator< I(IA_Bit) float I(float)

filename FIO-X_le.c
binary pointwise non-commutative chi_le subop=operator<= I(IA_Bit) I(float) I(float)
binary pointwise non-commutative chi_le subop=operator<= I(IA_Bit) I(float) float
binary pointwise non-commutative chi_le subop=operator<= I(IA_Bit) float I(float)

filename FIO-X_eq.c
binary pointwise commutative chi_eq subop=operator== I(IA_Bit) I(float) I(float)
binary pointwise commutative chi_eq subop=operator== I(IA_Bit) I(float) float

filename FIO-X_ne.c
binary pointwise commutative chi_ne subop=operator!= I(IA_Bit) I(float) I(float)
binary pointwise commutative chi_ne subop=operator!= I(IA_Bit) I(float) float

filename FIO-X_ge.c
binary pointwise non-commutative chi_ge subop=operator>= I(IA_Bit) I(float) I(float)
binary pointwise non-commutative chi_ge subop=operator>= I(IA_Bit) I(float) float
binary pointwise non-commutative chi_ge subop=operator>= I(IA_Bit) float I(float)

filename FIO-X_gt.c
binary pointwise non-commutative chi_gt subop=operator> I(IA_Bit) I(float) I(float)
binary pointwise non-commutative chi_gt subop=operator> I(IA_Bit) I(float) float
binary pointwise non-commutative chi_gt subop=operator> I(IA_Bit) float I(float)




filename FIO-libm.c
"Ctemplate <class T>
"Cinline T sqr(T v)
"C{
"C    return v*v;
"C}
unary pointwise sqrt I(float) I(float)
unary pointwise sqr I(float) I(float)
unary pointwise fabs I(float) I(float)
"Hf inline IA_Image<IA_Point<int>,float> abs(IA_Image<IA_Point<int>,float> i) {
"Hf     return fabs(i);
"Hf }

"Ctemplate <class T>
"Cinline T sgn(T v)
"C{
"C    return (v>0)?1:(v<0)?-1:0;
"C}
unary pointwise sgn I(float) I(float)

unary pointwise cos I(float) I(float)
unary pointwise sin I(float) I(float)
unary pointwise tan I(float) I(float)

unary pointwise exp I(float) I(float)
unary pointwise log I(float) I(float)

unary pointwise ceil I(float) I(float)
unary pointwise floor I(float) I(float)


filename FIO-minmax.c
"Cinline double max(double a, double b)
"C{
"C    return (a<b)?b:a;
"C}
binary pointwise commutative max I(float) I(float) I(float)
binary pointwise commutative max I(float) I(float) float
"Cinline double min(double a, double b)
"C{
"C    return (a<b)?a:b;
"C}
binary pointwise commutative min I(float) I(float) I(float)
binary pointwise commutative min I(float) I(float) float

filename FIO-reduce.c
reduction sum zero=0 subop=operator+ float I(float)
reduction product zero=1 subop=operator* float I(float)
"Cinline double max(double a, double b)
"C{
"C    return (a<b)?b:a;
"C}
reduction max zero=infinity() subop=max double I(float)
"Cinline double min(double a, double b)
"C{
"C    return (a<b)?a:b;
"C}
reduction min zero=-infinity() subop=min double I(float)
