Package dev.nm.analysis.function.tuple
Class PartialFunction
- java.lang.Object
-
- dev.nm.analysis.function.tuple.PartialFunction
-
- All Implemented Interfaces:
OrderedPairs
public class PartialFunction extends Object implements OrderedPairs
A partial function from X to Y is a function f: X' → Y, where X' is a subset of X. It generalizes the concept of a function by not forcing f to map every element of X to an element of Y (only some subset X' of X). A partial function is a special type of binary relation, which does not allow duplicated abscissae in its collection of ordered pairs. This class is immutable.
-
-
Constructor Summary
Constructors Constructor Description PartialFunction(double[] x, double[] y)
Construct a partial function from {(x,y)}.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
size()
Get the number of points.double[]
x()
Get the abscissae.double[]
y()
Get the ordinates.
-
-
-
Method Detail
-
x
public double[] x()
Description copied from interface:OrderedPairs
Get the abscissae.- Specified by:
x
in interfaceOrderedPairs
- Returns:
- the abscissae
-
y
public double[] y()
Description copied from interface:OrderedPairs
Get the ordinates.- Specified by:
y
in interfaceOrderedPairs
- Returns:
- the ordinates
-
size
public int size()
Description copied from interface:OrderedPairs
Get the number of points.- Specified by:
size
in interfaceOrderedPairs
- Returns:
- the number of points
-
-