|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.sir.linear.LinearForm
public class LinearForm
A LinearForm is the representation of a variable inside
the linear dataflow analysis. It is comprised of a vector v and a value c.
The vector corresponds to the combinations of inputs used to compute the value,
and the value corresponds to a constant that is added to compute the value.
The basic gist of the dataflow analysis is to determine for all variables
what the corresponding LinearForm is. Armed with this knowledge, we can
propage LinearForm information throughout the body of the filter and
construct a LinearFilterRepresentation from the filter.
$Id: LinearForm.java,v 1.8 2006/01/25 17:01:57 thies Exp $
Constructor Summary | |
---|---|
LinearForm(int size)
Construct a new LinearForm with vector size size with all elements zero. |
Method Summary | |
---|---|
void |
copyToColumn(FilterMatrix fm,
int col)
Add all of the weights in this linear form to the specified column in the passed FilterMatrix. |
LinearForm |
divideByConstant(ComplexNumber divideFactor)
Divide all weights and the offset of this linear form by a constant. |
boolean |
equals(Object o)
Returns true if this object is equal in value to this linear form. |
int |
getIntegerOffset()
Get the constant offset of this linear form. |
ComplexNumber |
getOffset()
Get the constant offset of this linear form. |
ComplexNumber |
getWeight(int index)
Gets a speficied weight. |
int |
getWeightsSize()
Gets the internal size of the vecotr of this linear form (i.e. |
int |
hashCode()
Preserve equals() semantics. |
boolean |
isIntegerOffset()
returns true if this linear form's offset is an integer |
boolean |
isOnlyOffset()
Returns true if this LinearForm contains only a constant offset and a vector of all zeros. |
LinearForm |
multiplyByConstant(ComplexNumber scaleFactor)
Scale a linear form by a constant. |
LinearForm |
negate()
Negate the LinearForm. |
LinearForm |
plus(LinearForm other)
Add two linear forms together. |
void |
setOffset(ComplexNumber val)
Set the offset with a ComplexNumber. |
void |
setOffset(double val)
Set the offset with a double. |
void |
setOffset(int val)
Set the offset with an integer. |
void |
setWeight(int index,
ComplexNumber weight)
Sets the weight of a particular item in the linear form. |
String |
toString()
Pretty print this linear form. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LinearForm(int size)
Method Detail |
---|
public boolean isIntegerOffset()
public int getIntegerOffset()
public ComplexNumber getOffset()
public void setOffset(int val)
public void setOffset(double val)
public void setOffset(ComplexNumber val)
public boolean isOnlyOffset()
public void setWeight(int index, ComplexNumber weight)
public ComplexNumber getWeight(int index)
public int getWeightsSize()
public LinearForm negate()
public LinearForm plus(LinearForm other)
public LinearForm multiplyByConstant(ComplexNumber scaleFactor)
public LinearForm divideByConstant(ComplexNumber divideFactor)
public void copyToColumn(FilterMatrix fm, int col)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |