Power
Represents the power operation as a binary function within expressions. This operation raises the first operand to the power of the second operand. It is not exact for all inputs and does not commute.
TODO check on Eager.zero as identityL.
Extends ExpressionBiFunction where the specific function is implemented using the power method from the Valuable class.
Attributes
- Graph
-
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalsclass ExpressionBiFunctionclass Objecttrait Matchableclass AnyShow all
- Self type
-
Power.type
Members list
Type members
Inherited types
The names of the product elements.
The names of the product elements.
Attributes
- Inherited from:
- Singleton
Attributes
- Inherited from:
- Singleton
The mirrored *-type.
The mirrored *-type.
Attributes
- Inherited from:
- Singleton
Attributes
- Inherited from:
- Singleton
Inherited and Abstract types
The name of the type.
The name of the type.
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Applies a binary operation to the provided Valuable elements a and b, with stricter evaluation rules, and returns an optional result. The evaluation succeeds only if the operation satisfies specific conditions (e.g., exact representations or mathematical constraints).
Applies a binary operation to the provided Valuable elements a and b, with stricter evaluation rules, and returns an optional result. The evaluation succeeds only if the operation satisfies specific conditions (e.g., exact representations or mathematical constraints).
Value parameters
- a
-
the first operand, a
Valuableinstance. - b
-
the second operand, a
Valuableinstance.
Attributes
- Returns
-
an
Option[Valuable]containing the result of the operation if it can be computed exactly, orNoneif the operation fails to meet exactness requirements.
Determines the left-hand evaluation context for a given input context. This method evaluates the provided context to compute the appropriate left evaluation context based on specific rules or conditions.
Determines the left-hand evaluation context for a given input context. This method evaluates the provided context to compute the appropriate left evaluation context based on specific rules or conditions.
Value parameters
- context
-
the input
Contextto evaluate.
Attributes
- Returns
-
None.
Determines the right-hand evaluation context for a given input context. This method ignores the provided context and determines whether the PureNumber context should be included or excluded based on the evaluation conditions.
Determines the right-hand evaluation context for a given input context. This method ignores the provided context and determines whether the PureNumber context should be included or excluded based on the evaluation conditions.
Value parameters
- context
-
the input context to evaluate.
Attributes
- Returns
-
the updated
Contextafter applying the evaluation logic. ReturnsNoneif the input context matchesSome(PureNumber), otherwise returnsSome(PureNumber).
Inherited methods
Composes two instances of Function1 in a new Function1, with this function applied first.
Composes two instances of Function1 in a new Function1, with this function applied first.
Type parameters
- A
-
the result type of function
g
Value parameters
- g
-
a function R => A
Attributes
- Returns
-
a new function
fsuch thatf(x) == g(apply(x)) - Inherited from:
- Function1
Alternative apply method which satisfies the type declaration. Applies the binary function f to the given tuple of Eager elements.
Alternative apply method which satisfies the type declaration. Applies the binary function f to the given tuple of Eager elements.
Value parameters
- ff
-
a tuple containing two
Eagerelements, representing the inputs to the binary function.
Attributes
- Returns
-
a
Eagerthat is the result of applying the binary function to the input tuple. - Inherited from:
- ExpressionBiFunction
Evaluate this function on x.
Evaluate this function on x.
Value parameters
- a
-
the first parameter to the function.
- b
-
the second parameter to the function.
Attributes
- Returns
-
the result of f(x).
- Inherited from:
- ExpressionBiFunction
Applies the function exactly to the given input of type P, returning an Option of type Valuable if the application is successful.
Applies the function exactly to the given input of type P, returning an Option of type Valuable if the application is successful.
If defined, the output is guaranteed to be exact.
Value parameters
- p
-
the input parameter of type
Pto which the function is applied
Attributes
- Returns
-
an
Optioncontaining aValuableresult if the function executes successfully, orNoneif the operation cannot produce a valid result - Inherited from:
- ExpressionBiFunction
Composes two instances of Function1 in a new Function1, with this function applied last.
Composes two instances of Function1 in a new Function1, with this function applied last.
Type parameters
- A
-
the type to which function
gcan be applied
Value parameters
- g
-
a function A => T1
Attributes
- Returns
-
a new function
fsuch thatf(x) == apply(g(x)) - Inherited from:
- Function1
Evaluates two expressions x and y in a given context and determines the resulting Valuable based on specific identity and evaluation rules. Trivial identities are recognized and evaluated appropriately.
Evaluates two expressions x and y in a given context and determines the resulting Valuable based on specific identity and evaluation rules. Trivial identities are recognized and evaluated appropriately.
Value parameters
- a
-
the first expression to be evaluated.
- b
-
the second expression to be evaluated.
- context
-
the evaluation context providing the necessary environment for resolving expressions.
Attributes
- Returns
-
an
Option[Valuable]containing the result of the evaluation if successful, orNoneif evaluation fails. - Inherited from:
- ExpressionBiFunction
Evaluates two expressions as-is (without any simplification or conversion) and applies the function f to the results if both evaluations are successful.
Evaluates two expressions as-is (without any simplification or conversion) and applies the function f to the results if both evaluations are successful.
Value parameters
- x
-
the first expression to be evaluated.
- y
-
the second expression to be evaluated.
Attributes
- Returns
-
an
Option[Valuable]containing the result of applying the binary function to the evaluated results ofxandy, orNoneif either evaluation fails. - Inherited from:
- ExpressionBiFunction
Creates a new instance of type T with elements taken from product p.
Creates a new instance of type T with elements taken from product p.
Attributes
- Inherited from:
- Singleton
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Generate helpful debugging information about this ExpressionMonoFunction.
Generate helpful debugging information about this ExpressionMonoFunction.
Attributes
- Returns
-
a String.
- Definition Classes
- Inherited from:
- ExpressionBiFunction
Inherited fields
Indicates whether the binary operation represented by this instance commutes, meaning the result remains unchanged for arbitrary swapping of inputs. This is determined based on the absence of a right-hand identity (maybeIdentityR).
Indicates whether the binary operation represented by this instance commutes, meaning the result remains unchanged for arbitrary swapping of inputs. This is determined based on the absence of a right-hand identity (maybeIdentityR).
Attributes
- Inherited from:
- ExpressionBiFunction
Attributes
- Inherited from:
- ExpressionBiFunction
Attributes
- Inherited from:
- ExpressionBiFunction
Attributes
- Inherited from:
- ExpressionBiFunction
Attributes
- Inherited from:
- ExpressionBiFunction
Returns the name of the expression function.
Returns the name of the expression function.
Attributes
- Returns
-
a string representing the name of the function
- Inherited from:
- ExpressionBiFunction