DEFINITION MODULE MatAccess;
(*******************************************************************
Module MatAccess (Version 1.0)
Copyright (c) 1990-2006 by Andreas Fischlin, Olivier Roth and
ETH Zurich.
Purpose Access matrices and their elements.
Remarks This module is part of the Mat-library, which forms
part of the RAMSES package.
Programming
o Design
Andreas Fischlin 28/05/1993
Olivier Roth 24/04/1990
o Implementation
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: 28/05/1993 AF
*******************************************************************)
FROM Matrices IMPORT Matrix;
PROCEDURE SetMatrixEle( m: Matrix; row, col: INTEGER; val: REAL );
PROCEDURE GetMatrixEle( m: Matrix; row, col: INTEGER; VAR val: REAL );
(* for efficiency, index range checks can be switched off, see
* SetIndexRangeChecking; (assumes that m exists!) *)
PROCEDURE MEle( m: Matrix; row, col: INTEGER ): REAL;
(* returns as a function result the value of the matrix m's cell
* at "row" and "col". See also GetMatrixEle for further comments *)
PROCEDURE FillMatrix( m: Matrix; v : REAL );
(* if m exists the matrix m is filled with value v. *)
PROCEDURE SetMatrixRow( m: Matrix; nrRow : INTEGER;
VAR rowArr : ARRAY OF REAL );
(* copies "rowArr" to the "nrRow" in the matrix "m", only the lower
* of HIGH(rowArr) and m's col dimension is copied.
* (assumes that m exists!) *)
PROCEDURE SetMatrixCol( m: Matrix; nrCol : INTEGER;
VAR colArr : ARRAY OF REAL );
(* copies "colArr" to the "nrCol" in the matrix "m", only the lower
* of HIGH(colArr) and m's row dimension is copied.
* (assumes that m exists!) *)
PROCEDURE GetMatrixRow( m: Matrix; nrRow : INTEGER;
VAR rowArr : ARRAY OF REAL );
(* copies the "nrRow" in the matrix "m" to "rowArr", only the lower
* of HIGH(rowArr) and m's col dimension is copied.
* (assumes that m exists!) *)
PROCEDURE GetMatrixCol( m: Matrix; nrCol : INTEGER;
VAR colArr : ARRAY OF REAL );
(* copies the "nrCol" in the matrix "m" to "colArr", only the lower
* of HIGH(colArr) and m's row dimension is copied.
* (assumes that m exists!) *)
PROCEDURE SetIndexRangeChecking( doCheck: BOOLEAN );
PROCEDURE GetIndexRangeChecking( VAR doCheck: BOOLEAN );
(* if doCheck is TRUE index range checks will be performed *)
PROCEDURE SetMatrixName( m: Matrix; VAR name: ARRAY OF CHAR );
PROCEDURE GetMatrixName( m: Matrix; VAR name: ARRAY OF CHAR );
(* sets/returns the matrix's name, 0C if m does not exist. *)
END MatAccess.