Next: Linear algebra
Up: User's Guide
Previous: Data structures
  Contents
  Index
Input/Output
inherits the stream I/O model provided by SALLI. In particular
SumitType inherits OutputType from SALLI, which means
that elements of a SumitType can be written in text format
to any TextWriter (in particular I/O streams, strings or files).
Because it is desirable to output mathematical objects such as
matrices and polynomials in more than one format depending on the
context,
types do not in general define their own
function. Rather, they implement
the extree function, that converts their elements
into elements of ExpressionTree. Expression trees,
wich are similar to Lisp's S-expressions, are the unique layer
between all the types in
and the outside world. When
writing your own types, once you provide or inherit an implementation
of extree, your elements can then be written
to any TextWriter in any of the many formats that
ExpressionTree understands, for example using
lisp to produce Lisp output.
In that case, the default behavior of the
is to convert your objects to expression trees and then to
use tex to produce TEXoutput. You
can override this default behaviour by providing your own
implementation of
if you choose.
As with SALLI, you can use #include "sallio" after
#include "sumit" in order to import the types commonly used
for input and output.
Next: Linear algebra
Up: User's Guide
Previous: Data structures
  Contents
  Index
Manuel Bronstein
2000-12-13