Interface Function<D,C>
- All Known Subinterfaces:
Bijection<D,C>, ContinuousFunction<D, C>, ConvergentSequence<T>, DifferentiableFunction<D, C>, DiscreteMap<T>, IntegerSequence, IntegrableFunction<D, C>, MultivariateFunction, MultivariateRealFunction, ParametricCurve, ParametricSurface, ProbabilityDistribution, RealFunction, ScalarField<V>, ScalarFunction<D>, Sequence<T>, Transform<D, C>, UnivariateFunction, VectorField<V>, VectorFunction<F>
- All Known Implementing Classes:
ArnoldCatMap, BellSequence, BetaDistribution, BezierCurve, BinomialDistribution, CatalanSequence, CauchyDistribution, ChiSquareDistribution, Circle, Cone, ContinuousDistribution, Cylinder, DiscreteDistribution, DiscreteFourierTransform, Ellipse, Ellipsoid, ExponentialDistribution, FactorialSequence, FibonacciSequence, GammaDistribution, GeometricDistribution, GingerbreadManMap, Helix, HenonMap, LogisticMap, LogNormalDistribution, NormalDistribution, Paraboloid, PoissonDistribution, PolynomialFunction, PrimePiSequence, PrimeSequence, RecursiveSequence, Sphere, SquareSequence, StandardMap, StudentTDistribution, Torus, TriangularSequence, UniformDistribution, WeibullDistribution
Represents a mathematical function from a domain D to a codomain C.
A function is a relation where for every x ∈ D, there is exactly one y ∈ C such that (x, y) is in the relation.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionComposes this function with another (from java.util.function.Function).default CJava Function interface implementation - delegates to evaluate().Returns the composition of this function with another function.default booleanChecks if the relation contains the pair (input, output).Evaluates this function at the given point.evaluate(Collection<D> inputs) Evaluates the function for a batch of input values.default ComputeBackendReturns the currently set compute backend.default booleanIndicates if this function is continuous.default booleanIndicates if this function is differentiable.default voidsetBackend(ComputeBackend backend) Sets the compute backend for this function (e.g., enable GPU).Methods inherited from interface Relation
getCodomain, getDomain
-
Method Details
-
evaluate
-
apply
-
contains
Checks if the relation contains the pair (input, output). For a function, this checks if f(input) == output. -
compose
-
andThen
Composes this function with another (from java.util.function.Function). -
setBackend
Sets the compute backend for this function (e.g., enable GPU).- Parameters:
backend- the compute backend
-
getBackend
Returns the currently set compute backend.- Returns:
- the compute backend, or null if none is explicitly set or supported.
-
evaluate
Evaluates the function for a batch of input values.- Parameters:
inputs- a collection of input values- Returns:
- a list of corresponding output values
-
isContinuous
default boolean isContinuous()Indicates if this function is continuous.- Returns:
- true if continuous, false otherwise
-
isDifferentiable
default boolean isDifferentiable()Indicates if this function is differentiable.- Returns:
- true if differentiable, false otherwise
-