|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--scale.score.dependence.AffineExpr
A class to represent affine expressions to be used by the data dependence tester.
$Id: AffineExpr.java,v 1.6 2002/01/14 21:22:20 burrill Exp $
Copyright 2002 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
An expression is an affine function of variables, v1, v2, ..., vN if it can be expressed as the sum of a known constant times each of the variables plus a constant. That is,
c0 + c1*v1 + c2*v2 + ... + cN*vN, for known integers, c0..cN.The omega test wants an AffineExpr object associated with each subscript, loop bound, or conditional (we don't do anything for conditionals yet).
AffineTerm| Constructor Summary | |
AffineExpr()
Create a new affine expression object. |
|
AffineExpr(int n)
Create a new affine expression object with room for n terms. |
|
| Method Summary | |
void |
add(AffineExpr ae)
Add the argument affine expression to this one. |
void |
addConst(int c)
Add constant to affine expression. |
void |
addMaxTerm(Expr indexVar)
Add an index variable to the affine expression. |
void |
addMinTerm(Expr indexVar)
Add an index variable to the affine expression. |
void |
addTerm(AffineTerm at)
Add a term to the affine expression. |
void |
addTerm(Expr indexVar)
Add a index variable to the affine expression. |
int |
constValue()
|
AffineExpr |
copy()
Create a deep copy of the AffineExpr. |
boolean |
differenceWithin(AffineExpr ae,
int offset)
check if the difference of two affine expressions are within in a range |
boolean |
equivalent(AffineExpr ae)
Check if this affine expression is equivalent. |
void |
gcd(AffineExpr e)
|
AffineTerm |
getConstantTerm()
Get the constant term from the affine expression. |
AffineTerm |
getMaxTerm()
Get the MAX term; should be the first term (index 0). |
AffineTerm |
getMinTerm()
Get the MIN term; should be the first term (index 0). |
AffineTerm |
getTerm(int i)
Get the ith term from the affine expression. |
Vector |
getVarTerms()
Return the variable (non-constant) terms of the affine expression. |
boolean |
greater(AffineExpr ae)
check if this affine expression is definitely greater than ae |
boolean |
greaterEqual(AffineExpr ae)
check if this affine expression is definitely greater than or equal to ae |
boolean |
hasLoopIndex()
Return true if one of the terms is a loop index variable |
boolean |
hasMaxTerm()
Return true if the expression has a MAX term. |
boolean |
hasMinTerm()
Return true if the expression has a MIN term. |
AffineTerm |
hasTerm(Expr term)
Return true if the affine expression contains the parameter term. |
boolean |
isConst()
|
boolean |
lessEqual(AffineExpr ae)
check if this affine expression is definitely less than or equal to ae |
void |
lower(AffineExpr e)
|
void |
merge(AffineExpr ae)
Merge two affine expressions. |
void |
multConst(int c)
Multiply affine expression by constant int. |
int |
numTerms()
Return the number of terms in the affine expression. |
boolean |
possiblyGreater(AffineExpr ae)
Check if this affine expression is possibly greater than ae |
boolean |
possiblyLess(AffineExpr ae)
check if this affine expression is possibly less than ae |
void |
setMaxFlag()
Set the hasMax flag |
void |
setMinFlag()
Set the hasMin flag |
void |
simplify()
|
void |
simplifyConstTerms()
|
void |
substract(AffineExpr ae)
Substract the argument affine expression from this one. |
java.lang.String |
toString()
Redefine toString to print out exactly the way Petit prints so that we can compare using diff. |
java.lang.String |
toString2()
Redefine toString to print out meaningful results. |
java.lang.String |
toString3()
Redefine toString to print out exactly the way Petit prints so that we can compare using diff. |
java.lang.String |
toStringSpecial()
Redefine toString to print out meaningful results. |
void |
upper(AffineExpr e)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AffineExpr(int n)
public AffineExpr()
| Method Detail |
public void addTerm(Expr indexVar)
indexVar - the index variablepublic void addTerm(AffineTerm at)
at - the affine term.public void addMinTerm(Expr indexVar)
indexVar - the index variablepublic void addMaxTerm(Expr indexVar)
indexVar - the index variablepublic void setMinFlag()
public void setMaxFlag()
public boolean hasMinTerm()
public boolean hasMaxTerm()
public Vector getVarTerms()
public AffineTerm getTerm(int i)
public AffineTerm hasTerm(Expr term)
public AffineTerm getMinTerm()
public AffineTerm getMaxTerm()
public AffineTerm getConstantTerm()
public boolean hasLoopIndex()
public int numTerms()
public void addConst(int c)
public void multConst(int c)
public void add(AffineExpr ae)
public void substract(AffineExpr ae)
public void merge(AffineExpr ae)
public void simplify()
public void simplifyConstTerms()
public boolean equivalent(AffineExpr ae)
ae - affine expression to comparepublic boolean possiblyGreater(AffineExpr ae)
ae - affine expression to comparepublic boolean greaterEqual(AffineExpr ae)
ae - affine expression to comparepublic boolean greater(AffineExpr ae)
ae - affine expression to comparepublic boolean possiblyLess(AffineExpr ae)
ae - affine expression to comparepublic boolean lessEqual(AffineExpr ae)
ae - affine expression to compare
public boolean differenceWithin(AffineExpr ae,
int offset)
ae - affine expression to comparepublic boolean isConst()
public int constValue()
public void lower(AffineExpr e)
public void upper(AffineExpr e)
public void gcd(AffineExpr e)
public AffineExpr copy()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString3()
public java.lang.String toString2()
public java.lang.String toStringSpecial()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||