|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.sra.riskmaps.func.DiscreteFunction
public class DiscreteFunction
This class represents the mathematical idea of a discrete function. Discrete functions have discrete domains and ranges. They are eseentially a pairing of x/y values. Once a function is instantiated, that instance become immutable.
-=* CHANGE LOG *=- 06/19/2008 -- EMM: Original implementation.
| Field Summary | |
|---|---|
protected double[] |
xvals
The x-values of this function |
protected double[] |
yvals
The y-values of this function |
| Constructor Summary | |
|---|---|
DiscreteFunction(double[] xvals,
double[] yvals)
Creates a discrete function with the given xvals,
yvals, and the DEFAULT_NAME. |
|
DiscreteFunction(double[] xvals,
double[] yvals,
String name)
Creates a discrete function with the given xvals,
yvals, and name. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Checks the domain and range of the two functions are the same, and the for each value i in the domain of the functions, f(i) =
g(i). |
SetAPI |
getDomain()
Gets the domain of this function. |
String |
getName()
Gets the name of this function. |
SetAPI |
getRange()
Gets the range of this function. |
double[] |
getXVals()
Gets the raw xvals array of data. |
double[] |
getYVals()
Gets the raw yvals array of data. |
String |
toString()
|
double |
valueOf(double x)
Gets the function value for the given x input. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double[] xvals
protected double[] yvals
| Constructor Detail |
|---|
public DiscreteFunction(double[] xvals,
double[] yvals)
xvals,
yvals, and the DEFAULT_NAME.
xvals - The x-values of the function.yvals - The y-values of the function.
public DiscreteFunction(double[] xvals,
double[] yvals,
String name)
xvals,
yvals, and name.
xvals - The x-values of the function.yvals - The y-values of the function.name - The name of the function.| Method Detail |
|---|
public SetAPI getDomain()
getXVals() function.
getDomain in interface FunctionAPIpublic SetAPI getRange()
getYVals() to get the raw
array of y-values.
getRange in interface FunctionAPIpublic String getName()
getName in interface FunctionAPIpublic double valueOf(double x)
x input.
valueOf in interface FunctionAPIx - The value of which to take f(x).
x.
IllegalArgumentException - If x is not in the domain of the
function.public double[] getXVals()
public double[] getYVals()
public boolean equals(Object obj)
i in the domain of the functions, f(i) =
g(i).
equals in class Objectfunc - The function to compare agaist.
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||