ExpressionFunction
FunctionWithCachingFunction[IoId("00000000-7cab-4a56-832a-dd827c5db3df")]
public sealed class ExpressionFunction : FunctionWithCaching
Represents an immutable expression equation. This equation specifically doesn't allow for custom variable resolvers as the results are cached.
Constructors
ExpressionFunction
#public ExpressionFunction()
ExpressionFunction
#public ExpressionFunction(Expression expression, params (string name, Function function)[] referents)
Create a new expression equation.
Parameters:
| expression (Expression) | Expression. |
| referents (params (string name, Function function)[]) | A collection of named referents required by the expression. |
Properties
Derivative
Gets a function which is the derivative of this function. The returned function may be either analytic or approximate.
Overrides: Function.Derivative
Integral
Gets a function which is the indefinite integral of this function. The returned function may be analytic or approximate. Note that numeric approximation of indefinite integrals is a slow and not particularly high quality process.
Overrides: Function.Integral
Notation
#Gets the notation for this function. Notation is aimed at humans and does not need to return a parseable string.
Overrides: FunctionWithCaching.Notation
Methods
Asymptotes
Returns an array of *all* the non-vertical asymptotes for this function. This property may return both null and empty arrays, implying no asymptotes. Due to the nature of non-vertical asymptotes, there can only be a finite amount of them.
AutoCoDomain
Compute the automatic codomain for a given domain.
DomainEstimate
Return an estimate of the interesting part of a function. Each function may choose how to answer this question individually.
EmitDerivative
Override this method to provide an analytic derivative.
EmitIntegral
Override this method to provide an analytic indefinite integral.
Holes
Returns a collection of domains for which this function is not defined. This method may return null or an empty array, implying no undefined domains. This method may also return domains outside of the specified interval.
Integrate
Evaluate the definite integral between two parameters. Unless a function specifically implements an analytic integral, this value will be approximate. Note to implementer: if you provide an analytic integral via the Function.Integral property, that function will be used to compute an analytic result. There is typically no reason to override this method.
Poles
Returns an array of all the poles (i.e. vertical asymptotes) within a domain. This method may return both null and empty arrays, implying no poles. Furthermore this method may choose to return poles which fall outside of the given domain.
Y
#Evaluate this function at a given x parameter. This method may return NaN values or even throw. The caller is responsible for handling any and all failure cases.
YYYY
Evaluate a large amount of values. Functions may choose to use multiple threads to perform this calculation. This method should not throw, instead every failed evaluation will be represented by a NaN value.
Parameters:
| x (double[]) | Value to evaluate. |
Returns: Evaluation results. Array will contain double.NaN entries for failed evaluations.