File r38/lisp/csl/r38.doc/r38_0300.html artifact 26b1982661 part of check-in fe6b5d0560



<a name=r38_0300>

<title>LESSSPACE</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>LESSSPACE</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
You can turn on the switch <em>lessspace</em> if you want fewer 
blank lines in your output. 
<P>
<P>

<a name=r38_0301>

<title>LIMITEDFACTORS</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>LIMITEDFACTORS</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
To get limited factorization in cases where it is too expensive to use 
full multivariate polynomial factorization, the switch 
<em>limitedfactors</em> can be turned on. In that case, only ``inexpensive'' 
factoring operations, such as square-free factorization, will be used 
when 
<a href=r38_0150.html#r38_0151>factorize</a> is called. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
a := (y-x)^2*(y^3+2x*y+5)*(y^2-3x*y+7)$ 

factorize a; 

              2
  {- 3*X*Y + Y  + 7,1}
            3
  {2*X*Y + Y  + 5,1},
  {X - Y,2}}


on limitedfactors; 

factorize a; 

        2  2        4        3          5      3      2
  {- 6*X *Y  - 3*X*Y  + 2*X*Y  - X*Y + Y  + 7*Y  + 5*Y  + 35,1},
  {X - Y,2}}

</tt></pre><p>
<a name=r38_0302>

<title>LIST_switch</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>LIST</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
The <em>list</em> switch causes REDUCE to print each term in any sum on 
separate lines. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
x**2*(y**2 + 2*y) + x*(y**2 + z)/(2*a);
			 


            2              2
  X*(2*A*X*Y  + 4*A*X*Y + Y  +Z)
  ------------------------------ 
               2*A


on list; 

ws; 

             2
  (X*(2*A*X*Y
    + 4*A*X*Y
       2
    + Y
    + Z))/(2*A)

</tt></pre><p>
<a name=r38_0303>

<title>LISTARGS</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>LISTARGS</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
If an operator other than those specifically defined for lists is given a 
single argument that is a list, then the result of this operation will be 
a list in which that operator is applied to each element of the list. 
This process can be inhibited globally by turning on the switch 
<em>listargs</em>. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
log {a,b,c}; 

  LOG(A),LOG(B),LOG(C) 


on listargs; 

log {a,b,c}; 

  LOG(A,B,C)

</tt></pre><p>It is possible to inhibit such distribution for a specific operato
r by 
using the declaration 
<a href=r38_0200.html#r38_0203>listargp</a>. In addition, if an operator has 
more than one argument, no such distribution occurs, so <em>listargs</em> 
has no effect. 
<P>
<P>
<P>

<a name=r38_0304>

<title>MCD</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>MCD</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>mcd</em> is on, sums and differences of rational expressions are put 
on a common denominator. Default is <em>on</em>. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
a/(x+1) + b/5; 

  5*A + B*X + B
  ------------- 
    5*(X + 1)


off mcd; 

a/(x+1) + b/5; 

         -1
  (X + 1)  *A + 1/5*B 


1/6 + 1/7; 

  13/42

</tt></pre><p>Even with <em>mcd</em> off, rational expressions involving only nu
mbers are still 
put over a common denominator. 
<P>
<P>
Turning <em>mcd</em> off is useful when explicit negative powers are needed, 
or if no greatest common divisor calculations are desired, or when 
differentiating complicated rational expressions. Results when <em>mcd</em> 
is off are no longer in canonical form, and expressions equivalent to zero 
may not simplify to 0. Some operations, such as factoring cannot be done 
while <em>mcd</em> is off. This option should therefore be used with some 
caution. Turning <em>mcd</em> off is most valuable in intermediate parts of 
a complicated calculation, and should be turned back on for the last stage. 
<P>
<P>
<P>

<a name=r38_0305>

<title>MODULAR</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>MODULAR</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>modular</em> is on, polynomial coefficients are reduced by the 
modulus set by 
<a href=r38_0100.html#r38_0104>setmod</a>. If no modulus has been set, <em>modul
ar</em> 
has no effect. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
setmod 2; 

  1 


on modular; 

(x+y)**2; 

   2    2
  X  + Y  


145*x**2 + 20*x**3 + 17 + 15*x*y;
			 


   2
  X  + X*Y + 1

</tt></pre><p>Modular operations are only conducted on the coefficients, not the
 
exponents. The modulus is not restricted to being prime. When the modulus 
is prime, division by a number not relatively prime to the modulus results 
in a &lt;Zero divisor&gt; error message. When the modulus is a composite 
number, division by a power of the modulus results in an error message, but 
division by an integer which is a factor of the modulus does not. 
The representation of modular number can be influenced by 

<a href=r38_0250.html#r38_0269>balanced_mod</a>. 
<P>
<P>
<P>

<a name=r38_0306>

<title>MSG</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>MSG</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>msg</em> is off, the printing of warning messages is suppressed. Error 

messages are still printed. 
<P>
<P>
Warning messages include those about redimensioning an 
<a href=r38_0150.html#r38_0188>array</a> 
or declaring an 
<a href=r38_0200.html#r38_0211>operator</a> where one is expected. 
<P>
<P>
<P>

<a name=r38_0307>

<title>MULTIPLICITIES</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>MULTIPLICITIES</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When 
<a href=r38_0150.html#r38_0179>solve</a> is applied to a set of equations with m
ultiple roots, 
solution multiplicities are normally stored in the global variable 

<a href=r38_0001.html#r38_0017>root_multiplicities</a> rather than the solution 
list. If you want 
the multiplicities explicitly displayed, the switch <em>multiplicities</em> 
should be turned on. In this case, <em>root_multiplicities</em> has no value. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
solve(x^2=2x-1,x); 

  X=1 


root_multiplicities; 

  2 


on multiplicities; 

solve(x^2=2x-1,x); 

  X=1,X=1 


root_multiplicities; 

</tt></pre><p>
<a name=r38_0308>

<title>NAT</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>NAT</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>nat</em> is on, output is printed to the screen in natural form, with 
raised exponents. <em>nat</em> should be turned off when outputting expressions 

to a file for future input. Default is <em>on</em>. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
(x + y)**3; 

   3      2          2    3
  X  + 3*X *Y + 3*X*Y  + Y  


off nat; 

(x + y)**3; 

  X**3 + 3*X**2*Y + 3*X*Y**2 + Y**3$ 


on fort; 

(x + y)**3; 

  ANS=X**3+3.*X**2*Y+3.*X*Y**2+Y**3

</tt></pre><p>With <em>nat</em> off, a dollar sign is printed at the end of each
 expression. 
An output file written with <em>nat</em> off is ready to be read into REDUCE 
using the command 
<a href=r38_0200.html#r38_0231>in</a>. 
<P>
<P>
<P>

<a name=r38_0309>

<title>NERO</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>NERO</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>nero</em> is on, zero assignments (such as matrix elements) are not 
printed. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
matrix a;
a := mat((1,0),(0,1)); 

  A(1,1) := 1
  A(1,2) := 0
  A(2,1) := 0
  A(2,2) := 1


on nero; 

a; 

  MAT(1,1) := 1
  MAT(2,2) := 1


a(1,2); </tt></pre><p>nothing is printed.<p><pre><tt>


b := 0; </tt></pre><p>nothing is printed.<p><pre><tt>


off nero; 

b := 0; 

  B := 0

</tt></pre><p> 
<P>
<P>
<em>nero</em>is often used when dealing with large sparse matrices, to avoid 
being overloaded with zero assignments. 
<P>
<P>
<P>

<a name=r38_0310>

<title>NOARG</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>NOARG</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When 
<a href=r38_0250.html#r38_0279>dfprint</a> is on, expressions in the differentia
tion operator 

<a href=r38_0100.html#r38_0148>df</a> are printed in a more ``natural'' notation
, with the 
differentiation variables appearing as subscripts. When <em>noarg</em> 
is on (the default), the arguments of the differentiated operator are also 
suppressed. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
operator f; 

df(f x,x); 

  DF(F(X),X); 


on dfprint; 

ws; 

  F  
   X


off noarg; 

ws; 

  F(X)
      X

</tt></pre><p>
<a name=r38_0311>

<title>NOLNR</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>NOLNR</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>nolnr</em> is on, the linear properties of the integration operator 

<a href=r38_0150.html#r38_0154>int</a> are suppressed if the integral cannot be 
found in closed terms. 
<P>
<P>
REDUCE uses the linear properties of integration to attempt to break down 
an integral into manageable pieces. If an integral cannot be found in 
closed terms, these pieces are returned. When the <em>nolnr</em> switch is off, 

as many of the pieces as possible are integrated. When it is on, if any piece 
fails, the rest of them remain unevaluated. 
<P>
<P>
<P>

<a name=r38_0312>

<title>NOSPLIT</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>NOSPLIT</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
Under normal circumstances, the printing routines try to break an expression 
across lines at a natural point. This is a fairly expensive process. If 
you are not overly concerned about where the end-of-line breaks come, you 
can speed up the printing of expressions by turning off the switch 
<em>nosplit</em>. This switch is normally on. 
<P>
<P>

<a name=r38_0313>

<title>NUMVAL</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>NUMVAL</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
With 
<a href=r38_0300.html#r38_0330>rounded</a> on, elementary functions with numeric
al arguments 
will return a numerical answer where appropriate. If you wish to inhibit 
this evaluation, <em>numval</em> should be turned off. It is normally on. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
on rounded; 

cos 3.4; 

  - 0.966798192579 


off numval; 

cos 3.4; 

  COS(3.4)

</tt></pre><p>
<a name=r38_0314>

<title>OUTPUT</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>OUTPUT</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>output</em> is off, no output is printed from any REDUCE calculation. 
The calculations have their usual effects other than printing. Default is 
<em>on</em>. 
<P>
<P>
Turn output <em>off</em> if you do not wish to see output when executing 
large files, or to save the time REDUCE spends formatting large expressions 
for display. Results are still available with 
<a href=r38_0150.html#r38_0184>ws</a>, or in their 
assigned variables. 
<P>
<P>
<P>

<a name=r38_0315>

<title>OVERVIEW</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>OVERVIEW</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>overview</em> is on, the amount of detail reported by the factorizer 
switches 
<a href=r38_0300.html#r38_0335>trfac</a> and 
<a href=r38_0300.html#r38_0334>trallfac</a> is reduced. 
<P>
<P>

<a name=r38_0316>

<title>PERIOD</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>PERIOD</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>period</em> is on, periods are added after integers in 
Fortran-compatible output (when 
<a href=r38_0250.html#r38_0289>fort</a> is on). There is no effect 
when <em>fort</em> is off. Default is <em>on</em>. 
<P>
<P>

<a name=r38_0317>

<title>PRECISE</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>PRECISE</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When the <em>precise</em> switch is on, simplification of roots of even 
powers returns absolute values, a more precise answer mathematically. 
Default is <em>on</em>. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
sqrt(x**2); 

  X 


(x**2)**(1/4); 

  SQRT(X) 


on precise; 

sqrt(x**2); 

  ABS(X) 


(x**2)**(1/4); 

  SQRT(ABS(X))

</tt></pre><p>In many types of mathematical work, simplification of powers and s
urds can 
proceed by the fastest means of simplifying the exponents arithmetically. 
When it is important to you that the positive root be returned, turn 
<em>precise</em> on. One situation where this is important is when graphing 
square-root expressions such as sqrt(x^2+y^2) to 
avoid a spike caused by REDUCE simplifying 
sqrt(y^2) to y when x is 
zero. 
<P>
<P>
<P>

<a name=r38_0318>

<title>PRET</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>PRET</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>pret</em> is on, input is printed in standard REDUCE format and then 
evaluated. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
on pret; 

 (x+1)^3; 

   (x + 1)**3;
   3      2
  X  + 3*X  + 3*X + 1



procedure fac(n);
   if not (fixp(n) and n&gt;=0)
     then rederr &quot;Choose nonneg. integer only&quot;
    else for i := 0:n-1 product i+1;
 

  procedure fac n;
     if not (fixp n and n&gt;=0)
       then rederr &quot;Choose nonneg. integer only&quot;
      else for i := 0:n - 1 product i + 1;
  FAC



fac 5; 

  fac 5;
  120

</tt></pre><p>Note that all input is converted to lower case except strings (whi
ch keep 
the same case) all operators with a single argument have had the 
parentheses removed, and all infix operators have had a space added on each 
side. In addition, syntactical constructs like 
<em>if</em>...<em>then</em>...<em>else</em> are printed in a standard format. 
<P>
<P>
<P>

<a name=r38_0319>

<title>PRI</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>PRI</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>pri</em> is on, the declarations 
<a href=r38_0200.html#r38_0212>order</a> and 
<a href=r38_0250.html#r38_0287>factor</a> can 
be used, and the switches 
<a href=r38_0250.html#r38_0267>allfac</a>, 
<a href=r38_0250.html#r38_0280>div</a>, 
<a href=r38_0300.html#r38_0321>rat</a>, 
and 
<a href=r38_0300.html#r38_0326>revpri</a> take effect when they are on. Default 
is <em>on</em>. 
<P>
<P>
Printing of expressions is faster with <em>pri</em> off. The expressions are 
then returned in one standard form, without any of the display options that 
can be used to feature or display various parts of the expression. You can 
also gain insight into REDUCE's representation of expressions with 
<em>pri</em> off. 
<P>
<P>
<P>

<a name=r38_0320>

<title>RAISE</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>RAISE</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>raise</em> is on, lower case letters are automatically converted to 
upper case on input. <em>raise</em> is normally on. 
<P>
<P>
This conversion affects the internal representation of the letter, and is 
independent of the case with which a letter is printed, which is normally 
lower case. 
<P>
<P>
<P>

<a name=r38_0321>

<title>RAT</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>RAT</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When the <em>rat</em> switch is on, and kernels have been selected to display 
with the 
<a href=r38_0250.html#r38_0287>factor</a> declaration, the denominator is printe
d with each 
term rather than one common denominator at the end of an expression. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
(x+1)/x + x**2/sin y;        
 

                       3
  SIN(Y)*X + SIN(Y) + X
  ---------------------- factor x; 
         SIN(Y)*X


(x+1)/x + x**2/sin y;        
 

   3
  X  + X*SIN(Y) + SIN(Y)
  ---------------------- on rat;  
         X*SIN(Y)


(x+1)/x + x**2/sin y;       
 

     2
    X           -1
  ------ + 1 + X
  SIN(Y)

</tt></pre><p>The <em>rat</em> switch only has effect when the 
<a href=r38_0300.html#r38_0319>pri</a> switch is on. 
When <em>pri</em> is off, regardless of the setting of <em>rat</em>, the 
printing behavior is as if <em>rat</em> were off. <em>rat</em> only has 
effect upon the display of expressions, not their internal form. 
<P>
<P>
<P>

<a name=r38_0322>

<title>RATARG</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>RATARG</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>ratarg</em> is on, rational expressions can be given to operators 
such as 
<a href=r38_0100.html#r38_0141>coeff</a> and 
<a href=r38_0150.html#r38_0161>lterm</a> that normally require 
polynomials in one of their arguments. When <em>ratarg</em> is off, rational 
expressions cause an error message. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
aa := x/y**2 + 1/x + y/x**2; 
 

         3      2    3
        X  + X*Y  + Y
  AA := -------------- 
             2  2
            X *Y


coeff(aa,x); 

         3      2    3
        X  + X*Y  + Y
  ***** -------------- invalid as POLYNOMIAL
             2  2
            X *Y


on ratarg; 

coeff(aa,x);                
 

   Y  1      1
  {--,--,0,-----}
    2  2    2  2
   X  X    X *Y

</tt></pre><p>
<a name=r38_0323>

<title>RATIONAL</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>RATIONAL</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>rational</em> is on, polynomial expressions with rational coefficients 

are produced. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
x/2 + 3*y/4; 

  2*X + 3*Y
  --------- 
      4


(x**2 + 5*x + 17)/2; 

   2
  X  + 5*X + 17
  ------------- 
        2


on rational; 

x/2 + 3y/4; 

  1      3
  -*(X + -*Y) 
  2      2


(x**2 + 5*x + 17)/2; 

  1   2
  -*(X  + 5*X + 17)
  2

</tt></pre><p>By using <em>rational</em>, polynomial expressions with rational 
coefficients can be used in some commands that expect polynomials. With 
<em>rational</em> off, such a polynomial becomes a rational expression, with 
denominator the least common multiple of the denominators of the rational 
number coefficients. <P>
<P>

<P>
<P>

<a name=r38_0324>

<title>RATIONALIZE</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>RATIONALIZE</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When the <em>rationalize</em> switch is on, denominators of rational expressions
 
that contain complex numbers or root expressions are simplified by 
multiplication by their conjugates. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
qq := (1+sqrt(3))/(sqrt(3)-7); 

        SQRT(3) + 1
  QQ := ----------- 
        SQRT(3) - 7


on rationalize; 

qq; 

  - 4*SQRT(3) - 5
  --------------- 
        23


2/(4 + 6**(1/3)); 

   2/3      1/3
  6    - 4*6    + 16
  ------------------ 
          35


(i-1)/(i+3); 

  2*I - 1
  ------- 
     5


off rationalize; 

(i-1)/(i+3); 

  I - 1
  ------
  I + 3

</tt></pre><p>
<a name=r38_0325>

<title>RATPRI</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>RATPRI</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When the <em>ratpri</em> switch is on, rational expressions and fractions are 
printed as two lines separated by a fraction bar, rather than in a linear 
style. Default is <em>on</em>. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
3/17; 

  3
  -- 
  17


2/b + 3/y; 

  3*B + 2*Y
  --------- 
     B*Y


off ratpri; 

3/17; 

  3/17 


2/b + 3/y; 

  (3*B + 2*Y)/(B*Y)

</tt></pre><p>
<a name=r38_0326>

<title>REVPRI</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>REVPRI</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When the <em>revpri</em> switch is on, terms are printed in reverse order from 
the normal printing order. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
x**5 + x**2 + 18 + sqrt(y); 

             5    2
  SQRT(Y) + X  + X  + 18 


a + b + c + w; 

  A + B + C + W 


on revpri; 

x**5 + x**2 + 18 + sqrt(y); 

        2    5
  17 + X  + X  + SQRT(Y) 


a + b + c + w; 

  W + C + B + A

</tt></pre><p>Turn <em>revpri</em> on when you want to display a polynomial in a
scending 
rather than descending order. 
<P>
<P>
<P>

<a name=r38_0327>

<title>RLISP88</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>RLISP88</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
Rlisp '88 is a superset of the Rlisp that has been traditionally used for 
the support of REDUCE. It is fully documented in the book Marti, J.B., 
``RLISP '88: An Evolutionary Approach to Program Design and Reuse'', 
World Scientific, Singapore (1993). It supports different looping 
constructs from the traditional Rlisp, and treats ``-'' as a letter unless 
separated by spaces. Turning on the switch <em>rlisp88</em> converts to 
Rlisp '88 parsing conventions in symbolic mode, and enables the use of 
Rlisp '88 extensions. Turning off the switch reverts to the traditional 
Rlisp and the previous mode ( (
<a href=r38_0200.html#r38_0221>symbolic</a> or 
<a href=r38_0150.html#r38_0186>algebraic</a>) 
in force before <em>rlisp88</em> was turned on. 
<P>
<P>

<a name=r38_0328>

<title>ROUNDALL</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>ROUNDALL</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
In 
<a href=r38_0300.html#r38_0330>rounded</a> mode, rational numbers are normally c
onverted to a 
floating point representation. If <em>roundall</em> is off, this conversion 
does not occur. <em>roundall</em> is normally <em>on</em>. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
on rounded; 

1/2; 

  0.5 


off roundall; 
</tt></pre><p>
<a name=r38_0329>

<title>ROUNDBF</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>ROUNDBF</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
When 
<a href=r38_0300.html#r38_0330>rounded</a> is on, the normal defaults cause unde
rflows to be 
converted to zero. If you really want the small number that results in 
such cases, <em>roundbf</em> can be turned on. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
on rounded; 

exp(-100000.1^2); 

  0 


on roundbf; 

exp(-100000.1^2); 

  1.18441281937E-4342953505

</tt></pre><p>If a polynomial is input in 
<a href=r38_0300.html#r38_0330>rounded</a> mode at the default 
precision into any 
<a href=r38_0400.html#r38_0439>roots</a> function, and it is not possible to 
represent any of the coefficients of the polynomial precisely in the 
system floating point representation, the switch <em>roundbf</em> will be 
automatically turned on. All rounded computation will use the internal 
bigfloat representation until the user subsequently turns <em>roundbf</em> 
off. (A message is output to indicate that this condition is in effect.) 
<P>
<P>
<P>

<a name=r38_0330>

<title>ROUNDED</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>ROUNDED</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>rounded</em> is on, floating-point arithmetic is enabled, with 
precision initially at a system default value, which is usually 12 digits. 
The precise number can be found by the command 
<a href=r38_0200.html#r38_0214>precision</a>(0). 
 <P> <H3> 
examples: </H3>
<p><pre><tt>
pi; 

  PI 


35/217; 

  5
  -- 
  31


on rounded; 

pi; 

  3.14159265359 


35/217; 

  0.161 


sqrt(3); 

  1.73205080756

</tt></pre><p><P>
<P>
If more than the default number of decimal places are required, use the 

<a href=r38_0200.html#r38_0214>precision</a> command to set the required number.
 
<P>
<P>
<P>

<a name=r38_0331>

<title>SAVESTRUCTR</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>SAVESTRUCTR</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>savestructr</em> is on, results of the 
<a href=r38_0150.html#r38_0181>structr</a> command are 
returned as a list whose first element is the representation for the 
expression and the remaining elements are equations showing the 
relationships of the generated variables. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
off exp; 

structr((x+y)^3 + sin(x)^2); 

  ANS3
     where
                    3       2
        ANS3 := ANS1  + ANS2
        ANS2 := SIN(X)
        ANS1 := X + Y


ans3; 

  ANS3 


on savestructr; 

structr((x+y)^{3} + sin(x)^{2}); 

                3       2
  ANS3,ANS3=ANS1  + ANS2 ,ANS2=SIN(X),ANS1=X + Y 


ans3 where rest ws; 

         3         2
  (X + Y)  + SIN(X)

</tt></pre><p>In normal operation, 
<a href=r38_0150.html#r38_0181>structr</a> is only a display command. With 
<em>savestructr</em> on, you can access the various parts of the expression 
produced by <em>structr</em>. 
<P>
<P>
The generic system names use the stem <em>ANS</em>. You can change this to your 

own stem by the command 
<a href=r38_0200.html#r38_0225>varname</a>. REDUCE adds integers to this stem 
to make unique identifiers. 
<P>
<P>
<P>

<a name=r38_0332>

<title>SOLVESINGULAR</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>SOLVESINGULAR</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>solvesingular</em> is on, singular or underdetermined systems of 
linear equations are solved, using arbitrary real, complex or integer 
variables in the answer. Default is <em>on</em>. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
solve({2x + y,4x + 2y},{x,y}); 

         ARBCOMPLEX(1)
  {{X= - -------------,Y=ARBCOMPLEX(1)}} 
               2


solve({7x + 15y - z,x - y - z},{x,y,z}); 


      8*ARBCOMPLEX(3)
  {{X=----------------
            11
         3*ARBCOMPLEX(3)
    Y= - ----------------
               11
    Z=ARBCOMPLEX(3)}}


off solvesingular; 

solve({2x + y,4x + 2y},{x,y}); 

  ***** SOLVE given singular equations 


solve({7x + 15y - z,x - y - z},{x,y,z}); 


  ***** SOLVE given singular equations

</tt></pre><p>The integer following the identifier 
<a href=r38_0100.html#r38_0139>arbcomplex</a> above is assigned by 
the system, and serves to identify the variable uniquely. It has no other 
significance. 
<P>
<P>
<P>

<a name=r38_0333>

<title>TIME</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>TIME</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>time</em> is on, the system time used in executing each REDUCE 
statement is printed after the answer is printed. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
on time; 

  Time: 4940 ms 


df(sin(x**2 + y),y); 

            2
  COS(X  + Y )
  Time: 180 ms


solve(x**2 - 6*y,x); 

  {X= - SQRT(Y)*SQRT(6),
   X=SQRT(Y)*SQRT(6)}
  Time: 320 ms

</tt></pre><p>When <em>time</em> is first turned on, the time since the beginnin
g of the 
REDUCE session is printed. After that, the time used in computation, 
(usually in milliseconds, though this is system dependent) is printed after 
the results of each command. Idle time or time spent typing in commands is 
not counted. If <em>time</em> is turned off, the first reading after it is 
turned on again gives the time elapsed since it was turned off. The time 
printed is CPU or wall clock time, depending on the system. 
<P>
<P>
<P>

<a name=r38_0334>

<title>TRALLFAC</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>TRALLFAC</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>trallfac</em> is on, a more detailed trace of factorizer calls is 
generated. 
<P>
<P>
The <em>trallfac</em> switch takes precedence over 
<a href=r38_0300.html#r38_0335>trfac</a> if they are 
both on. <em>trfac</em> gives a factorization trace with less detail in it. 
When the 
<a href=r38_0250.html#r38_0287>factor</a> switch is on also, all input polynomia
ls are sent to 
the factorizer automatically and trace information is generated. The 

<a href=r38_0200.html#r38_0233>out</a> command saves the results of the factorin
g, but not the trace. 
<P>
<P>
<P>

<a name=r38_0335>

<title>TRFAC</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>TRFAC</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>trfac</em> is on, a narrative trace of any calls to the factorizer is 
generated. Default is <em>off</em>. 
<P>
<P>
When the switch 
<a href=r38_0250.html#r38_0287>factor</a> is on, and <em>trfac</em> is on, every
 input 
polynomial is sent to the factorizer, and a trace generated. With 
<em>factor</em> off, only polynomials that are explicitly factored with the 
command 
<a href=r38_0150.html#r38_0151>factorize</a> generate trace information. 
<P>
<P>
The 
<a href=r38_0200.html#r38_0233>out</a> command saves the results of the factorin
g, but not 
the trace. The 
<a href=r38_0300.html#r38_0334>trallfac</a> switch gives trace information to a 

greater level of detail. 
<P>
<P>
<P>

<a name=r38_0336>

<title>TRIGFORM</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>TRIGFORM</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When 
<a href=r38_0250.html#r38_0292>fullroots</a> is on, 
<a href=r38_0150.html#r38_0179>solve</a> will compute the 
roots of a cubic or quartic polynomial is closed form. When 
<em>trigform</em> is on, the roots will be expressed by trigonometric 
forms. Otherwise nested surds are used. Default is <em>on</em>. 
<P>
<P>

<a name=r38_0337>

<title>TRINT</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>TRINT</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>trint</em> is on, a narrative tracing various steps in the 
integration process is produced. 
<P>
<P>
The 
<a href=r38_0200.html#r38_0233>out</a> command saves the results of the integrat
ion, but not the 
trace. 
<P>
<P>
<P>

<a name=r38_0338>

<title>TRNONLNR</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>TRNONLNR</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>trnonlnr</em> is on, a narrative tracing various steps in 
the process for solving non-linear equations is produced. 
<P>
<P>
<em>trnonlnr</em>can only be used after the solve package has been loaded 
(e.g., by an explicit call of 
<a href=r38_0100.html#r38_0127>load_package</a>). The 
<a href=r38_0200.html#r38_0233>out</a> 
command saves the results of the equation solving, but not the trace. 
<P>
<P>
<P>

<a name=r38_0339>

<title>VAROPT</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>VAROPT</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>switch</b><P>
<P>
 
 <P>
<P>
When <em>varopt</em> is on, the sequence of variables is optimized by 

<a href=r38_0150.html#r38_0179>solve</a> with respect to execution speed. Otherw
ise, the sequence 
given in the call to 
<a href=r38_0150.html#r38_0179>solve</a> is preserved. Default is <em>on</em>. 
<P>
<P>
In combination with the switch 
<a href=r38_0250.html#r38_0268>arbvars</a>, <em>varopt</em> can be used 
to control variable elimination. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
off arbvars; 

solve({x+2z,x-3y},{x,y,z});				

           x      x
  		   {{y=-,z= - -}} 
           3      2


solve({x*y=1,z=x},{x,y,z});				

               1
  		   {{z=x,y=-}} 
               x


off varopt; 

solve({x+2z,x-3y},{x,y,z});				

                       2*z
  		   {{x= - 2*z,y= - ---}} 
                        3


solve({x*y=1,z=x},{x,y,z});				

           1
  		   {{y=-,x=z}} 
           z

</tt></pre><p>
<a name=r38_0340>

<title>General Switches</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>
<b>General Switches</b><menu>
<li><a href=r38_0250.html#r38_0264>SWITCHES introduction</a><P>
<li><a href=r38_0250.html#r38_0265>ALGINT switch</a><P>
<li><a href=r38_0250.html#r38_0266>ALLBRANCH switch</a><P>
<li><a href=r38_0250.html#r38_0267>ALLFAC switch</a><P>
<li><a href=r38_0250.html#r38_0268>ARBVARS switch</a><P>
<li><a href=r38_0250.html#r38_0269>BALANCED\_MOD switch</a><P>
<li><a href=r38_0250.html#r38_0270>BFSPACE switch</a><P>
<li><a href=r38_0250.html#r38_0271>COMBINEEXPT switch</a><P>
<li><a href=r38_0250.html#r38_0272>COMBINELOGS switch</a><P>
<li><a href=r38_0250.html#r38_0273>COMP switch</a><P>
<li><a href=r38_0250.html#r38_0274>COMPLEX switch</a><P>
<li><a href=r38_0250.html#r38_0275>CREF switch</a><P>
<li><a href=r38_0250.html#r38_0276>CRAMER switch</a><P>
<li><a href=r38_0250.html#r38_0277>DEFN switch</a><P>
<li><a href=r38_0250.html#r38_0278>DEMO switch</a><P>
<li><a href=r38_0250.html#r38_0279>DFPRINT switch</a><P>
<li><a href=r38_0250.html#r38_0280>DIV switch</a><P>
<li><a href=r38_0250.html#r38_0281>ECHO switch</a><P>
<li><a href=r38_0250.html#r38_0282>ERRCONT switch</a><P>
<li><a href=r38_0250.html#r38_0283>EVALLHSEQP switch</a><P>
<li><a href=r38_0250.html#r38_0284>EXP switch</a><P>
<li><a href=r38_0250.html#r38_0285>EXPANDLOGS switch</a><P>
<li><a href=r38_0250.html#r38_0286>EZGCD switch</a><P>
<li><a href=r38_0250.html#r38_0287>FACTOR switch</a><P>
<li><a href=r38_0250.html#r38_0288>FAILHARD switch</a><P>
<li><a href=r38_0250.html#r38_0289>FORT switch</a><P>
<li><a href=r38_0250.html#r38_0290>FORTUPPER switch</a><P>
<li><a href=r38_0250.html#r38_0291>FULLPREC switch</a><P>
<li><a href=r38_0250.html#r38_0292>FULLROOTS switch</a><P>
<li><a href=r38_0250.html#r38_0293>GC switch</a><P>
<li><a href=r38_0250.html#r38_0294>GCD switch</a><P>
<li><a href=r38_0250.html#r38_0295>HORNER switch</a><P>
<li><a href=r38_0250.html#r38_0296>IFACTOR switch</a><P>
<li><a href=r38_0250.html#r38_0297>INT switch</a><P>
<li><a href=r38_0250.html#r38_0298>INTSTR switch</a><P>
<li><a href=r38_0250.html#r38_0299>LCM switch</a><P>
<li><a href=r38_0300.html#r38_0300>LESSSPACE switch</a><P>
<li><a href=r38_0300.html#r38_0301>LIMITEDFACTORS switch</a><P>
<li><a href=r38_0300.html#r38_0302>LIST switch</a><P>
<li><a href=r38_0300.html#r38_0303>LISTARGS switch</a><P>
<li><a href=r38_0300.html#r38_0304>MCD switch</a><P>
<li><a href=r38_0300.html#r38_0305>MODULAR switch</a><P>
<li><a href=r38_0300.html#r38_0306>MSG switch</a><P>
<li><a href=r38_0300.html#r38_0307>MULTIPLICITIES switch</a><P>
<li><a href=r38_0300.html#r38_0308>NAT switch</a><P>
<li><a href=r38_0300.html#r38_0309>NERO switch</a><P>
<li><a href=r38_0300.html#r38_0310>NOARG switch</a><P>
<li><a href=r38_0300.html#r38_0311>NOLNR switch</a><P>
<li><a href=r38_0300.html#r38_0312>NOSPLIT switch</a><P>
<li><a href=r38_0300.html#r38_0313>NUMVAL switch</a><P>
<li><a href=r38_0300.html#r38_0314>OUTPUT switch</a><P>
<li><a href=r38_0300.html#r38_0315>OVERVIEW switch</a><P>
<li><a href=r38_0300.html#r38_0316>PERIOD switch</a><P>
<li><a href=r38_0300.html#r38_0317>PRECISE switch</a><P>
<li><a href=r38_0300.html#r38_0318>PRET switch</a><P>
<li><a href=r38_0300.html#r38_0319>PRI switch</a><P>
<li><a href=r38_0300.html#r38_0320>RAISE switch</a><P>
<li><a href=r38_0300.html#r38_0321>RAT switch</a><P>
<li><a href=r38_0300.html#r38_0322>RATARG switch</a><P>
<li><a href=r38_0300.html#r38_0323>RATIONAL switch</a><P>
<li><a href=r38_0300.html#r38_0324>RATIONALIZE switch</a><P>
<li><a href=r38_0300.html#r38_0325>RATPRI switch</a><P>
<li><a href=r38_0300.html#r38_0326>REVPRI switch</a><P>
<li><a href=r38_0300.html#r38_0327>RLISP88 switch</a><P>
<li><a href=r38_0300.html#r38_0328>ROUNDALL switch</a><P>
<li><a href=r38_0300.html#r38_0329>ROUNDBF switch</a><P>
<li><a href=r38_0300.html#r38_0330>ROUNDED switch</a><P>
<li><a href=r38_0300.html#r38_0331>SAVESTRUCTR switch</a><P>
<li><a href=r38_0300.html#r38_0332>SOLVESINGULAR switch</a><P>
<li><a href=r38_0300.html#r38_0333>TIME switch</a><P>
<li><a href=r38_0300.html#r38_0334>TRALLFAC switch</a><P>
<li><a href=r38_0300.html#r38_0335>TRFAC switch</a><P>
<li><a href=r38_0300.html#r38_0336>TRIGFORM switch</a><P>
<li><a href=r38_0300.html#r38_0337>TRINT switch</a><P>
<li><a href=r38_0300.html#r38_0338>TRNONLNR switch</a><P>
<li><a href=r38_0300.html#r38_0339>VAROPT switch</a><P>
</menu>
<a name=r38_0341>

<title>COFACTOR</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>COFACTOR</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>operator</b><P>
<P>
 
 <P>
<P>
The operator <em>cofactor</em> returns the cofactor of the element in row 
&lt;row&gt; and column &lt;column&gt; of a 
<a href=r38_0300.html#r38_0345>matrix</a>. Errors occur 
if &lt;row&gt; or &lt;column&gt; do not evaluate to integer expressions or if 
the matrix is not square. 
<P>
<P>
 <P> <H3> 
syntax: </H3>
<em>cofactor</em>(&lt;matrix\_expression&gt;,&lt;row&gt;,&lt;column&gt;) 
<P>
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
cofactor(mat((a,b,c),(d,e,f),(p,q,r)),2,2); 


  A*R - C*P 


cofactor(mat((a,b,c),(d,e,f)),1,1); 


  ***** non-square matrix

</tt></pre><p>
<a name=r38_0342>

<title>DET</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>DET</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>operator</b><P>
<P>
 
 <P>
<P>
The <em>det</em> operator returns the determinant of its 
(square 
<a href=r38_0300.html#r38_0345>matrix</a>) argument. 
<P>
<P>
 <P> <H3> 
syntax: </H3>
<em>det</em>(&lt;expression&gt;) or <em>det</em> &lt;expression&gt; 
<P>
<P>
<P>
&lt;expression&gt; must evaluate to a square matrix. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>

matrix m,n; 


m := mat((a,b),(c,d)); 

  M(1,1) := A
  M(1,2) := B
  M(2,1) := C
  M(2,2) := D
                                 


det m; 

  A*D - B*C 


n := mat((1,2),(1,2)); 

  N(1,1) := 1
  N(1,2) := 2
  N(2,1) := 1
  N(2,2) := 2
                                 



det(n); 

  0 



det(5); 

  5

</tt></pre><p>Given a numerical argument, <em>det</em> returns the number. Howev
er, given a 
variable name that has not been declared of type matrix, or a non-square 
matrix, <em>det</em> returns an error message. 
<P>
<P>
<P>

<a name=r38_0343>

<title>MAT</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>MAT</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>operator</b><P>
<P>
 
 <P>
<P>
The <em>mat</em> operator is used to represent a two-dimensional 

<a href=r38_0300.html#r38_0345>matrix</a>. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>mat</em>((&lt;expr&gt;{,&lt;expr&gt;}*) {(&lt;expr&gt;{<em>,</em>&lt;expr
&gt;}*)}*) 
<P>
<P>
<P>
&lt;expr&gt; may be any valid REDUCE scalar expression. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
mat((1,2),(3,4)); 

  MAT(1,1) := 1
  MAT(2,3) := 2
  MAT(2,1) := 3
  MAT(2,2) := 4


mat(2,1); 

  ***** Matrix mismatch
  Cont? (Y or N) 


matrix qt; 

qt := ws; 

  QT(1,1) := 1
  QT(1,2) := 2
  QT(2,1) := 3
  QT(2,2) := 4 


matrix a,b; 

a := mat((x),(y),(z)); 

  A(1,1) := X
  A(2,1) := Y
  A(3,1) := Z 


b := mat((sin x,cos x,1)); 

  B(1,1) := SIN(X)
  B(1,2) := COS(X)
  B(1,3) := 1

</tt></pre><p>Matrices need not have a size declared (unlike arrays). <em>mat
</em> 
redimensions a matrix variable as needed. It is necessary, of course, 
that all rows be the same length. An anonymous matrix, as shown in the 
first example, must be named before it can be referenced (note error 
message). When using <em>mat</em> to fill a 1 x n 
matrix, the row of values must be inside a second set of parentheses, to 
eliminate ambiguity. 
<P>
<P>
<P>

<a name=r38_0344>

<title>MATEIGEN</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>MATEIGEN</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>operator</b><P>
<P>
 
 <P>
<P>
The <em>mateigen</em> operator calculates the eigenvalue equation and the 
corresponding eigenvectors of a 
<a href=r38_0300.html#r38_0345>matrix</a>. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>mateigen</em>(&lt;matrix-id&gt;,&lt;tag-id&gt;) 
<P>
<P>
<P>
&lt;matrix-id&gt; must be a declared matrix of values, and &lt;tag-id&gt; must b
e 
a legal REDUCE identifier. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
aa := mat((2,5),(1,0))$ 

mateigen(aa,alpha); 

         2
  {{ALPHA  - 2*ALPHA - 5,
    1,
                5*ARBCOMPLEX(1)
    MAT(1,1) := ---------------,
                   ALPHA - 2
    MAT(2,1) := ARBCOMPLEX(1)
    }}


charpoly := first first ws; 

                   2
  CHARPOLY := ALPHA  - 2*ALPHA - 5 


bb := mat((1,0,1),(1,1,0),(0,0,1))$ 

mateigen(bb,lamb); 

  {{LAMB - 1,3,
    [      0      ]
    [ARBCOMPLEX(2)]
    [      0      ]
    }}

</tt></pre><p>The <em>mateigen</em> operator returns a list of lists of three 
elements. The first element is a square free factor of the characteristic 
polynomial; the second element is its multiplicity; and the third element 
is the corresponding eigenvector. If the characteristic polynomial can be 
completely factored, the product of the first elements of all the sublists 
will produce the minimal polynomial. You can access the various parts of 
the answer with the usual list access operators. 
<P>
<P>
If the matrix is degenerate, more than one eigenvector can be produced for 
the same eigenvalue, as shown by more than one arbitrary variable in the 
eigenvector. The identification numbers of the arbitrary complex variables 
shown in the examples above may not be the same as yours. Note that since 
<em>lambda</em> is a reserved word in REDUCE, you cannot use it as a 
tag-id for this operator. 
<P>
<P>
<P>

<a name=r38_0345>

<title>MATRIX</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>MATRIX</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>declaration</b><P>
<P>
 
Identifiers are declared to be of type <em>matrix</em>. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>matrix</em>&lt;identifier&gt;  _ _ _ option (&lt;index&gt;,&lt;index&gt;) 
<P>
<P>
{,&lt;identifier&gt;  _ _ _ option 
 (&lt;index&gt;,&lt;index&gt;)}* 
<P>
<P>
<P>
&lt;identifier&gt; must not be an already-defined operator or array or 
the name of a scalar variable. Dimensions are optional, and if used appear 
inside parentheses. &lt;index&gt; must be a positive integer. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
matrix a,b(1,4),c(4,4); 

b(1,1); 

  0 


a(1,1); 

  ***** Matrix A not set 


a := mat((x0,y0),(x1,y1)); 

  A(1,1) := X0
  A(1,2) := Y0
  A(2,1) := X0
  A(2,2) := X1


length a; 

  {2,2} 


b := a**2; 

              2
  B(1,1) := X0  + X1*Y0
  B(1,2) := Y0*(X0 + Y1)
  B(2,1) := X1*(X0 + Y1)
                      2
  B(2,2) := X1*Y0 + Y1

</tt></pre><p>When a matrix variable has not been dimensioned, matrix elements c
annot be 
referenced until the matrix is set by the 
<a href=r38_0300.html#r38_0343>mat</a> operator. When a 
matrix is dimensioned in its declaration, matrix elements are set to 0. 
Matrix elements cannot stand for themselves. When you use 
<a href=r38_0150.html#r38_0199>let</a> on 
a matrix element, there is no effect unless the element contains a 
constant, in which case an error message is returned. The same behavior 
occurs with 
<a href=r38_0150.html#r38_0189>clear</a>. Do &lt;not&gt; use 
<a href=r38_0150.html#r38_0189>clear</a> to try to 
set a matrix element to 0. 
<a href=r38_0150.html#r38_0199>let</a> statements can be applied to 
matrices as a whole, if the right-hand side of the expression is a matrix 
expression, and the left-hand side identifier has been declared to be a matrix. 

<P>
<P>
Arithmetical operators apply to matrices of the correct dimensions. The 
operators <em>+</em> and <em>-</em> can be used with matrices of the same 
dimensions. The operator <em>*</em> can be used to multiply 
m x n matrices by n x p 
matrices. Matrix multiplication is non-commutative. Scalars can also be 
multiplied with matrices, with the result that each element of the matrix 
is multiplied by the scalar. The operator <em>/</em> applied to two 
matrices computes the first matrix multiplied by the inverse of the 
second, if the inverse exists, and produces an error message otherwise. 
Matrices can be divided by scalars, which results in dividing each element 
of the matrix. Scalars can also be divided by matrices when the matrices 
are invertible, and the result is the multiplication of the scalar by the 
inverse of the matrix. Matrix inverses can by found by <em>1/A</em> or 
<em>/A</em>, where <em>A</em> is a matrix. Square matrices can be raised to 
positive integer powers, and also to negative integer powers if they are 
nonsingular. 
<P>
<P>
When a matrix variable is assigned to the results of a calculation, the 
matrix is redimensioned if necessary. 
<P>
<P>
<P>

<a name=r38_0346>

<title>NULLSPACE</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>NULLSPACE</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>operator</b><P>
<P>
 
 <P>
<P>
 <P> <H3> 
syntax: </H3>
<em>nullspace</em>(&lt;matrix\_expression&gt;) 
<P>
<P>
<P>
&lt;nullspace&gt; calculates for its 
<a href=r38_0300.html#r38_0345>matrix</a> argument, 
<em>a</em>, a list of 
linear independent vectors (a basis) whose linear combinations satisfy the 
equation a x = 0. The basis is provided in a form such that as many 
upper components as possible are isolated. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
nullspace mat((1,2,3,4),(5,6,7,8)); 


         {
           [ 1  ]
           [    ]
           [ 0  ]
           [    ]
           [ - 3]
           [    ]
           [ 2  ]
           ,
           [ 0  ]
           [    ]
           [ 1  ]
           [    ]
           [ - 2]
           [    ]
           [ 1  ]
          }

</tt></pre><p>Note that with <em>b := nullspace a</em>, the expression <em>lengt
h b</em> is 
the nullity/ of A, and that <em>second length a - length b</em> 
calculates the rank/ of A. The rank of a matrix expression can 
also be found more directly by the 
<a href=r38_0300.html#r38_0347>rank</a> operator. 
<P>
<P>
In addition to the REDUCE matrix form, <em>nullspace</em> accepts as input a 
matrix given as a 
<a href=r38_0050.html#r38_0053>list</a> of lists, that is interpreted as a row m
atrix. If 
that form of input is chosen, the vectors in the result will be 
represented by lists as well. This additional input syntax facilitates 
the use of <em>nullspace</em> in applications different from classical linear 
algebra. 
<P>
<P>
<P>

<a name=r38_0347>

<title>RANK</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>RANK</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>operator</b><P>
<P>
 
 <P>
<P>
 <P> <H3> 
syntax: </H3>
<em>rank</em>(&lt;matrix\_expression&gt;) 
<P>
<P>
<P>
<em>rank</em>calculates the rank of its matrix argument. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
rank mat((a,b,c),(d,e,f)); 

  2

</tt></pre><p>The argument to <em>rank</em> can also be a 
<a href=r38_0050.html#r38_0053>list</a> of lists, interpreted 
either as a row matrix or a set of equations. If that form of input is 
chosen, the vectors in the result will be represented by lists as well. 
This additional input syntax facilitates the use of <em>rank</em> in 
applications different from classical linear algebra. 
<P>
<P>
<P>

<a name=r38_0348>

<title>TP</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>TP</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>operator</b><P>
<P>
 
 <P>
<P>
The <em>tp</em> operator returns the transpose of its 
<a href=r38_0300.html#r38_0345>matrix</a> 
 argument. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>tp</em>&lt;identifier&gt; or <em>tp</em>(&lt;identifier&gt;) 
<P>
<P>
<P>
&lt;identifier&gt; must be a matrix, which either has had its dimensions set 
in its declaration, or has had values put into it by <em>mat</em>. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
matrix m,n; 

m := mat((1,2,3),(4,5,6))$ 

n := tp m; 

  N(1,1) := 1
  N(1,2) := 4
  N(2,1) := 2
  N(2,2) := 5
  N(3,1) := 3
  N(3,2) := 6

</tt></pre><p>In an assignment statement involving <em>tp</em>, the matrix ident
ifier on the 
left-hand side is redimensioned to the correct size for the transpose. 
<P>
<P>
<P>

<a name=r38_0349>

<title>TRACE</title></a>
<p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
E"></p>
<b><a href=r38_idx.html>INDEX</a></b><p><p>



<b>TRACE</b> _ _ _  _ _ _  _ _ _  _ _ _ <b>operator</b><P>
<P>
 
 <P>
<P>
The <em>trace</em> operator finds the trace of its 
<a href=r38_0300.html#r38_0345>matrix</a> argument. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>trace</em>(&lt;expression&gt;) or <em>trace</em> &lt;simple\_expression&gt; 

<P>
<P>
<P>
&lt;expression&gt; or &lt;simple\_expression&gt; must evaluate to a square 
matrix. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<p><pre><tt>
matrix a; 

a := mat((x1,y1),(x2,y2))$ 

trace a; 

  X1 + Y2

</tt></pre><p>The trace is the sum of the entries along the diagonal of a square
 matrix. 
Given a non-matrix expression, or a non-square matrix, <em>trace</em> returns 
an error message. 
<P>
<P>
<P>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]