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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.float
getC0
(int index) Get the values at zerofloat
getC1
(int index) Get the values at oneint
Get the number of outputs, n, returned by this functionprotected void
Read 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:
parse
in classPDFFunction
- Parameters:
obj
- aPDFObject
object.- 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:
doFunction
in classPDFFunction
- Parameters:
inputs
- an array ofinvalid reference
float
inputOffset
- 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:
getNumOutputs
in classPDFFunction
- Returns:
- the number of output values this function will return
-
getC0
public float getC0(int index) Get the values at zero- Parameters:
index
- aInteger
object.- Returns:
- a float.
-
getC1
public float getC1(int index) Get the values at one- Parameters:
index
- aInteger
object.- Returns:
- a float.
-