ETHZ_Logo RAMSES_Logo_Right   RAMSES   RAMSES_Logo_Left Systems Ecology  
Start    search button      Modules:   A-Z   Function   Layer        QuickRefs:   DM   AuxLib   AuxLibE   SciLib   EasyMW   MW   ISIS   RMSLib

DEFINITION MODULE LgMatCalc;

  (*******************************************************************

    Module  LgMatCalc     (Version 1.0)

      Copyright (c) 1998-2006 by Dimitrios Gyalistras and ETH Zurich.

    Purpose   Basic calculations for double precision matrices and
              vectors (large matrices, more than 4k x 4k elements). 

    Remarks   This module is part of the package LgMatrices.


    Programming

      o Design
        Dimitrios Gyalistras      20/07/1998

      o Implementation
        Dimitrios Gyalistras      20/07/1998


    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:  24/05/2002  AF

  *******************************************************************)


  FROM LgMatrices IMPORT LMatrix, LVector;


  (******************************************************************)

  (*
    Note: the dimensions of all LVector and LMatrix objects used below
    are determined automatically via procedures LMatrices.NElems,
    LMatrices.NRows and LMatrices.NCols.
  *)


  PROCEDURE SetToIdentityMatrix( mat: LMatrix );


  PROCEDURE IsIdentityMatrix( mat : LMatrix;
                              tol : LONGREAL ): BOOLEAN;


  PROCEDURE ScaleMatrix( mat  : LMatrix;
                         fact : LONGREAL );


  PROCEDURE MatrixProduct( mat1 : LMatrix;
                           mat2 : LMatrix;
                           res  : LMatrix );


  PROCEDURE MatrixSum( mat1 : LMatrix;
                       mat2 : LMatrix;
                       res  : LMatrix );


  PROCEDURE MatVecProduct( mat : LMatrix;
                           vec : LVector;
                           res : LVector );




  PROCEDURE GetColMuSig( data    : LMatrix;
                         col     : INTEGER;
                         VAR nn  : INTEGER;
                         VAR mu  : LONGREAL;
                         VAR sig : LONGREAL );

  PROCEDURE GetRowMuSig( data    : LMatrix;
                         row     : INTEGER;
                         VAR nn  : INTEGER;
                         VAR mu  : LONGREAL;
                         VAR sig : LONGREAL );




  PROCEDURE GetColsCov( data    : LMatrix;
                        col1    : INTEGER;
                        col2    : INTEGER;
                        lag     : INTEGER;
                        VAR nn  : INTEGER;
                        VAR mu1 : LONGREAL;
                        VAR mu2 : LONGREAL;
                        VAR cov : LONGREAL );
  (*
    Computes covariance between columns col1 and col2 of matrix data,
    with col2 lagged lag time steps in relation to col1.
  *)

  PROCEDURE GetRowsCov( data    : LMatrix;
                        row1    : INTEGER;
                        row2    : INTEGER;
                        lag     : INTEGER;
                        VAR nn  : INTEGER;
                        VAR mu1 : LONGREAL;
                        VAR mu2 : LONGREAL;
                        VAR cov : LONGREAL );


END LgMatCalc.

  Contact RAMSES@env.ethz.ch Last updated: 25-Jul-2011 [Top of page]