Class FunctionType2
java.lang.Object
org.loboevolution.pdfview.function.PDFFunction
org.loboevolution.pdfview.function.FunctionType2
A type 2 function is an exponential interpolation function, which maps
from one input value to n output values using a simple exponential
formula.
-
Field Summary
Fields inherited from class org.loboevolution.pdfview.function.PDFFunction
TYPE_0, TYPE_2, TYPE_3, TYPE_4 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset) Subclasses must implement this method to perform the actual function on the given set of data.floatgetC0(int index) Get the values at zerofloatgetC1(int index) Get the values at oneintGet the number of outputs, n, returned by this functionprotected voidRead the function information from a PDF ObjectMethods inherited from class org.loboevolution.pdfview.function.PDFFunction
calculate, calculate, getDomain, getFunction, getNumInputs, getRange, interpolate
-
Constructor Details
-
FunctionType2
public FunctionType2()Creates a new instance of FunctionType2
-
-
Method Details
-
parse
Read the function information from a PDF ObjectRead the zeros, ones and exponent
- Specified by:
parsein classPDFFunction- Parameters:
obj- aPDFObjectobject.- Throws:
IOException- if any.
-
doFunction
protected void doFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset) Subclasses must implement this method to perform the actual function on the given set of data. Note that the inputs are guaranteed to be clipped to the domain, while the outputs will be automatically clipped to the range after being returned from this function.Calculate the function value for the input. For each output (j), the function value is: C0(j) + x^N * (C1(j) - C0(j))
- Specified by:
doFunctionin classPDFFunction- Parameters:
inputs- an array ofobjects.invalid reference
floatinputOffset- the offset into the inputs array to read fromoutputs- guaranteed to be at least as big asgetNumOutputs(), but not yet clipped to domainoutputOffset- the offset into the output array to write to
-
getNumOutputs
public int getNumOutputs()Get the number of outputs, n, returned by this function- Overrides:
getNumOutputsin classPDFFunction- Returns:
- the number of output values this function will return
-
getC0
public float getC0(int index) Get the values at zero- Parameters:
index- aIntegerobject.- Returns:
- a float.
-
getC1
public float getC1(int index) Get the values at one- Parameters:
index- aIntegerobject.- Returns:
- a float.
-