com.exigen.ie.constrainer.FloatExp Maven / Gradle / Ivy
package com.exigen.ie.constrainer;
///////////////////////////////////////////////////////////////////////////////
/*
* Copyright Exigen Group 1998, 1999, 2000
* 320 Amboy Ave., Metuchen, NJ, 08840, USA, www.exigengroup.com
*
* The copyright to the computer program(s) herein
* is the property of Exigen Group, USA. All rights reserved.
* The program(s) may be used and/or copied only with
* the written permission of Exigen Group
* or in accordance with the terms and conditions
* stipulated in the agreement/contract under which
* the program(s) have been supplied.
*/
///////////////////////////////////////////////////////////////////////////////
//
//: FloatExp.java
//
/**
* An interface for the constrained floating-point expression.
* Any arithmetic operation where one of the operands
* is the floating-point variable/expression returns the floating-point expression.
*/
public interface FloatExp extends Expression
{
/**
* Returns the expression: (-this)
.
* That expression is opposite by sign to this expression.
*/
public FloatExp neg();
/**
* Returns the expression: (1/this)
.
*/
public FloatExp inv();
/**
* Returns the expression: abs(this)
.
*/
public FloatExp abs();
/**
* Returns the expression: (this + exp)
.
*/
public FloatExp add(FloatExp exp);
/**
* Returns the expression: (this + value)
.
*/
public FloatExp add(double value);
/**
* Returns the expression: (this + exp)
.
*/
public FloatExp add(IntExp exp);
/**
* Returns the expression: (this + value)
.
*/
public FloatExp add(int value);
/**
* Returns the expression: (this - exp)
.
*/
public FloatExp sub(FloatExp exp);
/**
* Returns the expression: (this - value)
.
*/
public FloatExp sub(double value);
/**
* Returns the expression: (this - exp)
.
*/
public FloatExp sub(IntExp exp);
/**
* Returns the expression: (this - value)
.
*/
public FloatExp sub(int value);
/**
* Returns true if this expression is bound.
*
* The floating-point expression is bound when
* (max-min)/max(1,|min|) LE precision
*
* The floating-point expression is bound to the mean value
* in the [min..max]
interval associated with this expresion.
*
* @return true if this expression is bound.
*/
public boolean bound();
/**
* Returns the display string for the current domain of this expression.
*/
public String domainToString();
/**
* Returns the constraint: (this == value)
.
*/
public Constraint equals(double value);
/**
* Returns the constraint: (this == exp)
.
*/
public Constraint equals(FloatExp exp);
/**
* Returns the constraint: (this == exp)
.
*/
public Constraint equals(IntExp exp);
/**
* Returns the constraint: (this == exp + value)
.
*/
public Constraint equals(FloatExp exp, double value);
/**
* Returns the constraint: (this == exp + value)
.
*/
public Constraint equals(IntExp exp, double value);
/**
* Returns the constraint: (this LE value)
.
*/
public Constraint lessOrEqual(double value);
/**
* Returns the constraint: (this LE exp)
.
*/
public Constraint lessOrEqual(FloatExp exp);
/**
* Returns the constraint: (this LE exp)
.
*/
public Constraint lessOrEqual(IntExp exp);
/**
* Returns the constraint: (this GE value)
.
*/
public Constraint moreOrEqual(double value);
/**
* Returns the constraint: (this GE exp)
.
*/
public Constraint moreOrEqual(FloatExp exp);
/**
* Returns the constraint: (this GE exp)
.
*/
public Constraint moreOrEqual(IntExp exp);
/**
* Returns the largest value of the domain of this expression.
*/
public double max();
/**
* Returns the smallest value of the domain of this expression.
*/
public double min();
/**
* Returns the expression: (this * exp)
.
*/
public FloatExp mul(FloatExp exp);
/**
* Returns the expression: (this * value)
.
*/
public FloatExp mul(double value);
/**
* Returns the expression: (this * exp)
.
*/
public FloatExp mul(IntExp exp);
/**
* Returns the expression: (this * value)
.
*/
public FloatExp mul(int value);
/**
* Returns the expression: (this / exp)
.
*/
public FloatExp div(FloatExp exp);
/**
* Returns the expression: (this / value)
.
*/
public FloatExp div(double value);
/**
* Returns the expression: (this / exp)
.
*/
public FloatExp div(IntExp exp);
/**
* Returns the expression: (this / value)
.
*/
public FloatExp div(int value);
/**
* Returns the expression: exp(this)
.
*/
public FloatExp exp();
/**
* Returns the expression: pow(value,this)
.
*/
public FloatExp exp(double value);
/**
* Returns the expression: log(this)
.
*/
public FloatExp log() throws Failure;
/**
* Returns the expression: (this * this)
.
*/
public FloatExp sqr();
/**
* Returns the expression: pow(this,value)
.
*/
public FloatExp pow(double value) throws Failure;
/**
* Returns the expression: pow(this,value)
.
*
* Throws RuntimeException if there exists invalid values for the expressions in domain.
*/
public FloatExp pow(int value) throws Failure;
/**
* Returns the expression: pow(this,exp)
.
*
* Throws RuntimeException if there exists invalid values for the expressions in domain.
*/
public FloatExp pow(FloatExp exp) throws Failure;
/**
* Returns the expression: pow(this,exp)
.
*
* Throws RuntimeException if there exists invalid values for the expressions in domain.
*/
public FloatExp pow(IntExp exp) throws Failure;
/**
* Sets the maximum value for this expression.
*
* @param max new maximum value.
* @throws Failure if domain becomes empty.
*/
public void setMax(double max) throws Failure;
/**
* Sets the minimum value for this expression.
*
* @param min new minimum value.
* @throws Failure if domain becomes empty.
*/
public void setMin(double min) throws Failure;
/**
* Bounds this expression to be equal to the value.
*
* @see #bound
*/
public void setValue(double value) throws Failure;
/**
* Remove the (min..max) range from the domain of this expression.
*
* @param min range minimum value.
* @param max range maxinum value.
* @throws Failure if domain becomes empty.
*/
public void removeRange(double min, double max) throws Failure;
/**
* Returns the size of the domain for this expression: (max - min)
.
*
* @return (max - min)
.
*/
public double size();
/**
* Returns the value this expression if it is bound.
*
* The floating-point expression is bound to the mean value
* in the [min..max]
interval associated with this expresion.
*
* @return the value of this bound expression.
*
* @throws Failure if the expression is not bound.
*/
public double value() throws Failure;
/**
* Returns the boolean expression: (this == exp)
.
*/
public IntBoolExp eq(FloatExp exp);
/**
* Returns the boolean expression: (this == value)
.
*/
public IntBoolExp eq(int value);
/**
* Returns the boolean expression: (this == value)
.
*/
public IntBoolExp eq(double value);
/**
* Returns the boolean expression: (this != exp)
.
*/
public IntBoolExp ne(FloatExp exp);
/**
* Returns the boolean expression: (this != value)
.
*/
public IntBoolExp ne(int value);
/**
* Returns the boolean expression: (this != value)
.
*/
public IntBoolExp ne(double value);
/**
* Returns the boolean expression: (this LT exp)
.
*/
public IntBoolExp lt(FloatExp exp);
/**
* Returns the boolean expression: (this LT value)
.
*/
public IntBoolExp lt(int value);
/**
* Returns the boolean expression: (this LT value)
.
*/
public IntBoolExp lt(double value);
/**
* Returns the boolean expression: (this GT exp)
.
*/
public IntBoolExp gt(FloatExp exp);
/**
* Returns the boolean expression: (this GT value)
.
*/
public IntBoolExp gt(int value);
/**
* Returns the boolean expression: (this GT value)
.
*/
public IntBoolExp gt(double value);
/**
* Returns the boolean expression: (this LE exp)
.
*/
public IntBoolExp le(FloatExp exp);
/**
* Returns the boolean expression: (this LE value)
.
*/
public IntBoolExp le(int value);
/**
* Returns the boolean expression: (this LE value)
.
*/
public IntBoolExp le(double value);
/**
* Returns the boolean expression: (this GE exp)
.
*/
public IntBoolExp ge(FloatExp exp);
/**
* Returns the boolean expression: (this GE value)
.
*/
public IntBoolExp ge(int value);
/**
* Returns the boolean expression: (this GE value)
.
*/
public IntBoolExp ge(double value);
/**
* Returns the expression: (this % value)
.
*/
public FloatExp mod(int value);
/**
* Returns the expression: (this % value)
.
*/
public FloatExp mod(double value);
} // ~FloatExp