BasicOperatorFunctions1(A)

op.spad line 183 [edit on github]

This package exports functions to set some commonly used properties of operators, including properties which contain functions.

constantOpIfCan : BasicOperator -> Union(A, "failed")

constantOpIfCan(op) returns a if op is the constant nullary operator always returning a, "failed" otherwise.

constantOperator : A -> BasicOperator

constantOperator(a) returns a nullary operator op such that op() always evaluate to a.

derivative : (BasicOperator, List(Mapping(A, List(A)))) -> BasicOperator

derivative(op, [foo1, ..., foon]) attaches [foo1, ..., foon] as the "%diff" property of op. If op has an "%diff" property [f1, ..., fn] then applying a derivation D to op(a1, ..., an) returns f1(a1, ..., an) * D(a1) + ... + fn(a1, ..., an) * D(an).

derivative : (BasicOperator, Mapping(A, A)) -> BasicOperator

derivative(op, foo) attaches foo as the "%diff" property of op. If op has an "%diff" property f, then applying a derivation D to op(a) returns f(a) * D(a). Argument op must be unary.

derivative : BasicOperator -> Union(List(Mapping(A, List(A))), "failed")

derivative(op) returns the value of the "%diff" property of op if it has one, and "failed" otherwise.

evaluate : (BasicOperator, Mapping(A, A)) -> BasicOperator

evaluate(op, foo) attaches foo as the "%eval" property of op. If op has an "%eval" property f, then applying op to a returns the result of f(a). Argument op must be unary.

evaluate : (BasicOperator, Mapping(A, List(A))) -> BasicOperator

evaluate(op, foo) attaches foo as the "%eval" property of op. If op has an "%eval" property f, then applying op to (a1, ..., an) returns the result of f(a1, ..., an).

evaluate : (BasicOperator, List(A)) -> Union(A, "failed")

evaluate(op, [a1,...,an]) checks if op has an "%eval" property f. If it has, then f(a1, ..., an) is returned, and "failed" otherwise.

evaluate : BasicOperator -> Union(Mapping(A, List(A)), "failed")

evaluate(op) returns the value of the "%eval" property of op if it has one, and "failed" otherwise.