net.sourceforge.interval.ia_math
Class IAMath

java.lang.Object
  |
  +--net.sourceforge.interval.ia_math.IAMath

public class IAMath
extends java.lang.Object

IAMath.java -- classes implementing interval arithmetic versions of the arithmetic and elementary functions, as part of the "ia_math library" version 0.1beta1, 10/97

Copyright (C) 2000 Timothy J. Hickey

License: zlib/png

the class IAMath contains methods for performing basic arithmetic operations on intervals. Currently the elementary functions rely on the underlying implementation which uses the netlib fdlibm library. The resulting code is therefore probably unsound for the transcendental functions.


Constructor Summary
IAMath()
           
 
Method Summary
static RealInterval acos(RealInterval x)
           
static RealInterval acos2pi(RealInterval x)
           
static RealInterval add(RealInterval x, RealInterval y)
           
static RealInterval asin(RealInterval x)
           
static RealInterval asin2pi(RealInterval x)
           
static RealInterval atan(RealInterval x)
           
static RealInterval atan2pi(RealInterval x)
           
static RealInterval cos(RealInterval x)
           
static RealInterval cos2pi(RealInterval x)
           
static RealInterval div(RealInterval x, RealInterval y)
          The Natural Extension of division in Interval Arithmetic
static RealInterval evenPower(RealInterval x, double y)
          this is the Natural Interval extension of |x|**y<\code} where x is an interval and y is a double.
static RealInterval evenRoot(RealInterval x, double y)
          this is the Natural Interval extension of xpos**(1/y)<\code} where x is an interval and xpos is the set of positive numbers contained in x and y is a non-zero double.
static RealInterval exp(RealInterval x)
           
static RealInterval integerPower(RealInterval x, RealInterval y)
          returns (x**y) assuming that y is restricted to integer values currently returns (-infty,infty) if y is not bound to an interval containing a single integer
static RealInterval integerRoot(RealInterval x, RealInterval y)
          returns (x**1/y) assuming that y is restricted to integer values currently returns (-infty,infty) if y is not bound to an interval containing a single integer
static boolean intersect_odiv(RealInterval y, RealInterval z, RealInterval x)
          this performs (y := y intersect z/x) and succeeds if y is nonempty.
static RealInterval intersect(RealInterval x, RealInterval y)
           
static boolean intersectIntegerRoot(RealInterval x, RealInterval y, RealInterval u)
          computes u := (u intersect ((x**1/y) union -(x**1/y))) and returns true if u is nonempty Also, assumes that y is a constant integer interval
static RealInterval leftendpoint(RealInterval x)
           
static RealInterval log(RealInterval x)
           
static void main(java.lang.String[] argv)
           
static RealInterval midpoint(RealInterval x)
           
static RealInterval mul(RealInterval x, RealInterval y)
           
static boolean nonempty(RealInterval x)
           
static RealInterval oddPower(RealInterval x, double y)
          this is the Natural Interval extension of sgn(x)*(|x|**y)<\code} where x is an interval and y is a double.
static RealInterval oddRoot(RealInterval x, double y)
          this is the Natural Interval extension of sgn(x)*|x|**(1/y)<\code} where x is an interval and y is a non-zero double.
static RealInterval odiv(RealInterval x, RealInterval y)
          This is identical to the standard div(x,y) method, except that if y is identically zero, then the infinite interval (-infinity, infinity) is returned.
static RealInterval power(RealInterval x, RealInterval y)
          returns (x**y) computed as exp(y*log(x))
static RealInterval rightendpoint(RealInterval x)
           
static RealInterval sin(RealInterval x)
           
static RealInterval sin2pi(RealInterval x)
           
static RealInterval sinRange(int a, int b)
           
static RealInterval sub(RealInterval x, RealInterval y)
           
static RealInterval tan(RealInterval x)
           
static RealInterval tan2pi(RealInterval x)
           
static RealInterval uminus(RealInterval x)
           
static RealInterval union(RealInterval x, RealInterval y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IAMath

public IAMath()
Method Detail

nonempty

public static final boolean nonempty(RealInterval x)

intersect

public static RealInterval intersect(RealInterval x,
                                     RealInterval y)
                              throws IAException

union

public static RealInterval union(RealInterval x,
                                 RealInterval y)
                          throws IAException

add

public static RealInterval add(RealInterval x,
                               RealInterval y)

sub

public static RealInterval sub(RealInterval x,
                               RealInterval y)

mul

public static RealInterval mul(RealInterval x,
                               RealInterval y)

div

public static RealInterval div(RealInterval x,
                               RealInterval y)
The Natural Extension of division in Interval Arithmetic
Parameters:
x - an interval
y - an interval
Throws:
IAException - is thrown with the message Division by Zero.

odiv

public static RealInterval odiv(RealInterval x,
                                RealInterval y)
This is identical to the standard div(x,y) method, except that if y is identically zero, then the infinite interval (-infinity, infinity) is returned.

intersect_odiv

public static boolean intersect_odiv(RealInterval y,
                                     RealInterval z,
                                     RealInterval x)
                              throws IAException
this performs (y := y intersect z/x) and succeeds if y is nonempty.

uminus

public static RealInterval uminus(RealInterval x)

exp

public static RealInterval exp(RealInterval x)

log

public static RealInterval log(RealInterval x)
                        throws IAException

sin

public static RealInterval sin(RealInterval x)

cos

public static RealInterval cos(RealInterval x)

tan

public static RealInterval tan(RealInterval x)

asin

public static RealInterval asin(RealInterval x)
                         throws IAException

acos

public static RealInterval acos(RealInterval x)

atan

public static RealInterval atan(RealInterval x)

sinRange

public static RealInterval sinRange(int a,
                                    int b)

sin2pi

public static RealInterval sin2pi(RealInterval x)

cos2pi

public static RealInterval cos2pi(RealInterval x)

tan2pi

public static RealInterval tan2pi(RealInterval x)

asin2pi

public static RealInterval asin2pi(RealInterval x)
                            throws IAException

acos2pi

public static RealInterval acos2pi(RealInterval x)

atan2pi

public static RealInterval atan2pi(RealInterval x)

midpoint

public static RealInterval midpoint(RealInterval x)

leftendpoint

public static RealInterval leftendpoint(RealInterval x)

rightendpoint

public static RealInterval rightendpoint(RealInterval x)

power

public static RealInterval power(RealInterval x,
                                 RealInterval y)
                          throws IAException
returns (x**y) computed as exp(y*log(x))

evenPower

public static RealInterval evenPower(RealInterval x,
                                     double y)
                              throws IAException
this is the Natural Interval extension of |x|**y<\code} where x is an interval and y is a double.

oddPower

public static RealInterval oddPower(RealInterval x,
                                    double y)
                             throws IAException
this is the Natural Interval extension of sgn(x)*(|x|**y)<\code} where x is an interval and y is a double.

evenRoot

public static RealInterval evenRoot(RealInterval x,
                                    double y)
                             throws IAException
this is the Natural Interval extension of xpos**(1/y)<\code} where x is an interval and xpos is the set of positive numbers contained in x and y is a non-zero double.

oddRoot

public static RealInterval oddRoot(RealInterval x,
                                   double y)
                            throws IAException
this is the Natural Interval extension of sgn(x)*|x|**(1/y)<\code} where x is an interval and y is a non-zero double.

integerPower

public static RealInterval integerPower(RealInterval x,
                                        RealInterval y)
                                 throws IAException
returns (x**y) assuming that y is restricted to integer values currently returns (-infty,infty) if y is not bound to an interval containing a single integer

integerRoot

public static RealInterval integerRoot(RealInterval x,
                                       RealInterval y)
                                throws IAException
returns (x**1/y) assuming that y is restricted to integer values currently returns (-infty,infty) if y is not bound to an interval containing a single integer

intersectIntegerRoot

public static boolean intersectIntegerRoot(RealInterval x,
                                           RealInterval y,
                                           RealInterval u)
                                    throws IAException
computes u := (u intersect ((x**1/y) union -(x**1/y))) and returns true if u is nonempty Also, assumes that y is a constant integer interval

main

public static void main(java.lang.String[] argv)