DEFINITION MODULE MatWOut;
(*******************************************************************
Module MatWOut (Version 1.0)
Copyright (c) 1989-2006 by Olivier Roth, Andreas Fischlin and
ETH Zurich.
Purpose Flexible textual in-/output of matrices
to windows.
Remarks This module is part of the Mat-library, which forms
part of the RAMSES package.
Programming
o Design
Olivier Roth 14/11/1989
Andreas Fischlin 28/05/1993
o Implementation
Olivier Roth 14/11/1989
Andreas Fischlin 28/05/1993
ETH Zurich
Systems Ecology
CHN E 35.1
Universitaetstrasse 16
8092 Zurich
SWITZERLAND
URLs:
<mailto:RAMSES@env.ethz.ch>
<http://www.sysecol.ethz.ch>
<http://www.sysecol.ethz.ch/SimSoftware/RAMSES>
Last revision of definition: 01/06/1993 AF
*******************************************************************)
FROM DMConversions IMPORT RealFormat;
FROM Matrices IMPORT Matrix;
TYPE
MatFormat = RECORD
realF : RealFormat;
len, dec : CARDINAL;
separator: ARRAY[0..63] OF CHAR;
crCol : INTEGER;
eOM : ARRAY[0..63] OF CHAR;
END(*RECORD*);
(* MatFormat describes the format in which a matrix will be written
* to the current output window of the 'Dialog Machine'. "realF"
* will be applied to every number, "len" stands for the length of
* the field for the real number (including decimal digits and
* point), "dec" stands for the number of decimal digits,
* "separator" is a string which is written after each matrix
* element except at the end of a line (cr), and "crCol" specifies
* the matrix column after which a carriage return (cr) is
* inserted. If "crCol"is negative or 0 the matrix's number of
* columns is taken. "eOM" stands for 'end of matrix' and may
* contain any string which is written after the matrix' elements
* have been written. *)
VAR
standardO : MatFormat; (* read only var!!!
is set to: fix, 10, 3, , 0, "EOM" *)
PROCEDURE SetMatFormat ( mf: MatFormat );
PROCEDURE GetMatFormat ( VAR mf: MatFormat );
(* Sets the MatFormat to be used for all subsequent writing
routines. The default format is standardO. *)
PROCEDURE WriteMatrix( m: Matrix );
PROCEDURE WriteRow ( m: Matrix; rowNr: INTEGER );
PROCEDURE WriteCol ( m: Matrix; colNr: INTEGER );
PROCEDURE WriteEle ( m: Matrix; row,col:INTEGER );
(* All writing routines use routines from DMWindIO *)
END MatWOut.