STRUCTR INDEX

STRUCTR _ _ _ _ _ _ _ _ _ _ _ _ operator

The structr operator breaks its argument expression into named subexpressions.

syntax:

structr(<expression> [,<identifier>[,<identifier> ... ]])

<expression> may be any valid REDUCE scalar expression. <identifier> may be any valid REDUCE identifier. The first identifier is the stem for subexpression names, the second is the name to be assigned to the structured expression.

examples:


structr(sqrt(x**2 + 2*x) + sin(x**2*z)); 


  ANS1 + ANS2
      where
                       2
          ANS2 := SIN(X *Z)
                             1/2
          ANS1 := ((X + 2)*X)


ans3; 

  ANS3 


on fort; 

structr((x+1)**5 + tan(x*y*z),var,aa); 


  VAR1=TAN(X*Y*Z)
  AA=VAR1+X**5+5.*X**4+10.*X**3+10.X**2+5.*X+1

The second argument to structr is optional. If it is not given, the default stem ANS is used by REDUCE to construct names for the subexpression. The names are only for display purposes: REDUCE does not store the names and their values unless the switch savestructr is on.

If a third argument is given, the structured expression as a whole is named by this argument, when fort is on. The expression is not stored under this name. You can send these structured Fortran expressions to a file with the out command.