next up previous contents
Next: Header Files Up: Operators Previous: Relational Operators

Utilities

Function Name
diff()
Syntax
Slp diff(Slp slp, char* var = "",bool symbolic = false)
Description
Computes the partial derivative of the given slp w.r.t. the given variable var. If the variable symbolic is set to true the derivative computed will be `symbolic' in the sense that the derivatives of leaf nodes which represent variables are not computed - rather a special node called ``DIFF'' is added in front of them. This allows computation of the derivative just once, the particular derivative can then be obtained by specifying which variable w.r.t. which the derivative has been taken.

Function Name
evaluate()
Syntax
Field_element evaluate(Slp slp, char* var = "", non_sing = 0, char* var2 = "", Field_element fe = 0)
Description
Returns an evaluation of the Slp . The default call evaluate(slp) will simply evaluate the Slp at the random values assigned to its variable leaf nodes. Other types of evaluation can be performed depending on the arguments to evaluate() as follows :
  1. The optional argument var is to be set to the variable wrt to which the DIFF operator nodes are to be applied, if the Slp contains such nodes. That is, if one wants to evaluate the Slp representing the symbolic derivative of some Slp one specifies the actual variable w.r.t. which the derivative is to be taken. In other words, this corresponds to computing

    . Default is no variable.

  2. The optional argument non_sing is to be set to the address of an integer variable if you want the evaluation procedure to determine if the Slp evaluated to a singular value such as 0/0.
  3. The optional argument var2 is set to the variable which has to be substituted for with the next argument fe. That is when the variable represented by var2 is encountered in the Slp , its value for evaluation will be fe rather than the random value which has been assigned to it. This is useful when you want to evaluate the Slp at different values of a variable such as when you want to interpolate the Slp into a polynomial in that variable.
  4. The optional argument fe is used in conjunction with var2, as explained above. Set to the desired field element.

next up previous contents
Next: Header Files Up: Operators Previous: Relational Operators

Ashu Rege
Fri May 9 17:57:21 PDT 1997