|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.interpolation.NumericList
public class NumericList
A linked list of vector values arranged in order with respect to a parameter t. Can be interpolated to produce a continuous vector function.
Constructor Summary | |
---|---|
NumericList(int vsize)
Creates an empty numeric list for holding vectors of a prescribed size. |
Method Summary | |
---|---|
NumericListKnot |
add(NumericListKnot knot)
Adds a knot into this numeric list. |
NumericListKnot |
add(NumericListKnot knot,
NumericListKnot last)
|
NumericListKnot |
add(Vector vals,
double t)
Creates a knot with the specified values and time and adds it into this numeric list. |
void |
clear()
Removes all knots in the numeric list. |
void |
clearAfter(NumericListKnot knot)
Removes all knots after a specific knot in this list. |
java.lang.Object |
clone()
Returns a deep copy of this numeric list. |
boolean |
equals(NumericList list)
Returns true if the contents of this numeric list equal the contents of another numeric list. |
NumericListKnot |
findKnotAtOrBefore(double t,
NumericListKnot last)
Finds the knot whose t value is closest to, and if possible less or equal to, a specified value. |
NumericListKnot |
findKnotClosest(double t)
Finds the knot whose t value is closest to a specified value. |
NumericListKnot |
findKnotClosest(double t,
NumericListKnot last)
|
NumericListKnot |
getFirst()
Returns the first knot in this list. |
Interpolation |
getInterpolation()
Returns the interpolation method for this list. |
NumericListKnot |
getLast()
Returns the last knot in this list. |
void |
getMinMaxValues(double[] minMax)
|
int |
getNumKnots()
Returns the number of knots in this list. |
double[][] |
getValues()
Returns the values of this numeric list as a two dimensional array of doubles. |
int |
getVectorSize()
Returns the size of the vectors associated with this list. |
void |
interpolate(VectorNd v,
double t)
Interpolates the value associated with a particular value of t, based on the current contents of this list. |
NumericListKnot |
interpolate(VectorNd v,
double t,
Interpolation.Order order,
boolean extendData,
NumericListKnot last)
|
NumericListKnot |
interpolate(VectorNd v,
double t,
Interpolation method,
NumericListKnot last)
|
void |
interpolateCubic(VectorNd v,
NumericListKnot prev,
double t)
|
boolean |
isEmpty()
Returns true if this list is empty. |
boolean |
isWritable()
Returns true if this component should in fact be written to
secondary storage. |
java.util.Iterator<NumericListKnot> |
iterator()
Returns an iterator over all the knots in this numeric list. |
NumericListKnot |
remove(double t)
Removes and return the knot at time t, if any. |
void |
remove(NumericListKnot knot)
Removes a knot from this numeric list. |
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer. |
void |
setInterpolation(Interpolation method)
Sets the interpolation method for this list. |
void |
setValues(double[][] vals)
Sets the values of this numeric list from a two dimensional array of doubles. |
java.lang.String |
toString()
Returns a string representation of this numeric list. |
java.lang.String |
toString(NumberFormat fmt)
Returns a String representation of this numeric list, in which each element is formatted using a C printf style as decribed by
the parameter NumberFormat . |
java.lang.String |
toString(java.lang.String fmtStr)
Returns a String representation of this numeric list, in which each element is formatted using a C printf style format string. |
java.lang.String |
toStringSuper()
|
void |
write(java.io.PrintWriter pw,
NumberFormat fmt,
java.lang.Object ref)
Writes a text description of this element to a PrintWriter. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NumericList(int vsize)
vsize
- size of the vectors that will form this listMethod Detail |
---|
public void setInterpolation(Interpolation method)
Step
with no end data extension.
method
- new interpolation method.public Interpolation getInterpolation()
setInterpolation(maspack.interpolation.Interpolation)
public int getVectorSize()
public NumericListKnot add(NumericListKnot knot)
knot
- knot to add to the list
java.lang.IllegalArgumentException
- if the knot's vector has a size not equal to the vector size for this
list.getVectorSize()
public NumericListKnot add(Vector vals, double t)
vals
- values for the knott
- time at which the knot should be added
java.lang.IllegalArgumentException
- if values
has a size less than the vector size for this
list.getVectorSize()
public NumericListKnot add(NumericListKnot knot, NumericListKnot last)
public void getMinMaxValues(double[] minMax)
public NumericListKnot remove(double t)
t
- time of the knot to remove
public void remove(NumericListKnot knot)
knot
- knot to removepublic void clearAfter(NumericListKnot knot)
knot
- all knots following this one will be removedpublic NumericListKnot findKnotAtOrBefore(double t, NumericListKnot last)
t
- specified value
public NumericListKnot findKnotClosest(double t)
t
- specified value
public NumericListKnot findKnotClosest(double t, NumericListKnot last)
public void interpolate(VectorNd v, double t)
v
- stores the interpolation resultt
- value to interpolate for
ImproperStateException
- if the list is emptypublic void interpolateCubic(VectorNd v, NumericListKnot prev, double t)
public NumericListKnot interpolate(VectorNd v, double t, Interpolation method, NumericListKnot last)
public NumericListKnot interpolate(VectorNd v, double t, Interpolation.Order order, boolean extendData, NumericListKnot last)
public NumericListKnot getFirst()
public NumericListKnot getLast()
public int getNumKnots()
public boolean isEmpty()
public void clear()
public java.util.Iterator<NumericListKnot> iterator()
iterator
in interface java.lang.Iterable<NumericListKnot>
public double[][] getValues()
public void setValues(double[][] vals)
getValues()
.
vals
- Values used to set this numeric listpublic boolean equals(NumericList list)
list
- numeric list to compare with
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String fmtStr)
printf
style format string.
For a description of the format string syntax, see NumberFormat
.
fmtStr
- numeric format specification
public java.lang.String toString(NumberFormat fmt)
printf
style as decribed by
the parameter NumberFormat
. When called numerous times,
this routine can be more efficient than toString(String)
, because the NumberFormat
does not need to be recreated each time from a specification
string.
fmt
- numeric format
public java.lang.String toStringSuper()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean isWritable()
true
if this component should in fact be written to
secondary storage. This gives subclasses control over whether or
not they are actually written out.
isWritable
in interface Scannable
true
if this component should be written to
secondary storage.public void write(java.io.PrintWriter pw, NumberFormat fmt, java.lang.Object ref) throws java.io.IOException
scan
and complete
enough to allow full reconstruction of the element.
write
in interface Scannable
pw
- stream for writing the elementfmt
- numeric formating informationref
- optional reference object which can be used for producing references to
other objects
java.io.IOException
- if an I/O error occuredpublic void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
write
.
scan
in interface Scannable
rtok
- Tokenizer from which to scan the elementref
- optional reference object which can be used for resolving references to
other objects
java.io.IOException
- if an I/O or formatting error occured
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |