|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.sir.statespace.LinearForm
public class LinearForm
A LinearForm is the representation of a variable inside
the linear dataflow analysis. It is comprised of vectors v and w.
The vector v corresponds to the combinations of inputs used to compute the value,
and the vector w corresponds to the combinations of state variables that are used 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.3 2006/01/25 17:02:30 thies Exp $
Modified to state space form by Sitij Agrawal 2/9/04
Constructor Summary | |
---|---|
LinearForm(int inputs,
int states)
Construct a new LinearForm with vector size size with all elements zero. |
Method Summary | |
---|---|
void |
copyInputsToRow(FilterMatrix fm,
int row)
Add all of the weights in this linear form to the specified row in the passed FilterMatrix. |
void |
copyStatesToRow(FilterMatrix fm,
int row)
|
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. |
ComplexNumber |
getInputWeight(int index)
Gets a specified input weight. |
int |
getInputWeightsSize()
Gets the internal size of the input vector of this linear form |
int |
getIntegerOffset()
Get the constant offset of this linear form. |
ComplexNumber |
getOffset()
Get the constant offset of this linear form. |
ComplexNumber |
getStateWeight(int index)
Gets a specified state weight. |
int |
getStateWeightsSize()
Gets the internal size of the state vector of this linear form |
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 This means the inputs vector is all zeros, and the states vector is all zeros except for the last weight |
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 |
setInputWeight(int index,
ComplexNumber weight)
Sets the weight of a particular item in the inputs vector. |
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 |
setStateWeight(int index,
ComplexNumber weight)
Sets the weight of a particular item in the states vector. |
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 inputs, int states)
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 setInputWeight(int index, ComplexNumber weight)
public void setStateWeight(int index, ComplexNumber weight)
public ComplexNumber getInputWeight(int index)
public ComplexNumber getStateWeight(int index)
public int getInputWeightsSize()
public int getStateWeightsSize()
public LinearForm negate()
public LinearForm plus(LinearForm other)
public LinearForm multiplyByConstant(ComplexNumber scaleFactor)
public LinearForm divideByConstant(ComplexNumber divideFactor)
public void copyInputsToRow(FilterMatrix fm, int row)
public void copyStatesToRow(FilterMatrix fm, int row)
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 |