Re: Algorithm for fuzzy "OR" calculations?

Anthony Cowden (cowden@sonalysts.com)
Mon, 2 Mar 1998 16:51:55 +0100 (MET)

Fred A Watkins wrote:
>
> bryce@albatross.co.nz wrote:
>
> >Does anyone have an algorithm for calculating a fuzzy 'OR' on x number of
> >values, given the formula X OR Y = x+y-xy (as opposed to the more standard
> >fuzzy definition of X OR Y = max(x,y).
> >
> >As an example, a OR b OR c can be calculated given the idea that <a OR b OR
> >c> is like <<a OR b> OR c>, ie:
> >
> > "(a + b -ab) + c -(a + b -ab)c"
> >or
> > "a + b + c -ab -bc -ac +abc"
> >
> >The tricky part is that I need this to work for any number of values, not
> >just two or three. I am actually planning to use this in a Delphi
> >application, but examples in C would be fine.
> >
>
> What's tricky about this:
>
> /*
> | SumProductOR - calculate OR as difference of sum and product
> |
> | Returns value or -1.0 on error.
> */
>
> double SumProductOR(unsigned int count, double *values) {
>
> unsigned int n;
> double acc, ftmp;
>
> if (count == 0 || values == (double *)0) return (-1.0); /* error cases */
>
> acc = values[0];
> for (n = 1; n < count; ++n) {
> ftmp = acc;
> acc += values[n];
> acc -= ftmp * values[n];
> }
>
> return (acc);
> }
>
> Shouldn't have missed that, laddie!
>
> Fred A Watkins, Ph.D.
> HyperLogic Corporation
> PO Box 300010
> Escondido, CA 92030-0010 USA
> voice: +1 760 746 2765 x 9117
> fax: +1 760 746 4089
> email: fwatkins@hyperlogic.com

Fred:

Thar's what I was thinking, but I didn't understand why Bryce didn't use
it alreasdy...

Tony

-- 
***************** http://www.sonalysts.com/fuzzy.htm ******************
Anthony Cowden, Fuzzy Systems Solutions     tel (800) 526-8091 ext.419
Sonalysts, Inc.                             fax (860) 447-8883
215 Parkway North, P.O. Box 280             e-mail cowden@sonalysts.com
Waterford, CT 06385	
*************** "Leadership is about being out front..." **************