# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.function.tuple

## Class PartialFunction

• java.lang.Object
• com.numericalmethod.suanshu.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 and Description
PartialFunction(double[] x, double[] y)
Construct a partial function from {(x,y)}.
• ### Method Summary

All Methods
Modifier and Type Method and Description
int size()
Get the number of points.
double[] x()
Get the abscissae.
double[] y()
Get the ordinates.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### PartialFunction

public PartialFunction(double[] x,
double[] y)
Construct a partial function from {(x,y)}.
Parameters:
x - elements in A
y - elements in A
• ### Method Detail

• #### x

public double[] x()
Description copied from interface: OrderedPairs
Get the abscissae.
Specified by:
x in interface OrderedPairs
Returns:
the abscissae
• #### y

public double[] y()
Description copied from interface: OrderedPairs
Get the ordinates.
Specified by:
y in interface OrderedPairs
Returns:
the ordinates
• #### size

public int size()
Description copied from interface: OrderedPairs
Get the number of points.
Specified by:
size in interface OrderedPairs
Returns:
the number of points