0.Contents
  --------
1.....Introduction
2.....Requirements
3.....List of files
4.....Installation
5.....Upon registration
6.....Usage
6.1...Generalities
6.2...Parameters
6.3...Operators
6.4...Return values
7.....Contacting the author
8.....Notice


1.Introduction
  ------------
This 32-bits DLL for Windows NT/95 implements a function that allows you
various operations on matrices (determinant calculus, inversion, triangularization,
 LU and QR decomposition's, addition, multiplication, transposition...).


2.Requirements
  ------------
A processor with Windows NT/95.


3.List of files
  -------------
The package includes the following files:
   - README.1ST: a readme file to read before to begin with the
                 installation
   - README.TXT: this file
   - LICENSE.TXT: the license agreement
   - REGISTER.TXT: contains the information to register
   - WMTRX32.DLL: the DLL file implementing the "matrix" function
   - WMTRX32.H: the header file containing the prototype of the "matrix" function
   - WMTRX32.LIB: the lib file to put with your library files and
                  to include in your link parameters
   - SETUP.EXE: the setup program file


4.Installation
  ------------
You can put the files in any directory. The only limitation is for
running setup: you have to put SETUP.EXE and WMTRX32.DLL in the SAME
directory.
Simply run setup.exe. It will ask you for a registration key; leave
the field to 0 for demo purpose.
After a trial period of 30 days, the software will be disabled (RC=1) and
you will have to register to continue using it (see register.txt).


5.Upon registration
  -----------------
Simply run setup.exe again and enter your registration key.


6.Usage
  -----
6.1.Generalities
    ------------
As you should know, to use a DLL, you have to put it into the directory
of your application, your path or your system directory (e. g. winnt\system32).
This DLL implements the 'matrix' function whose prototype is as follows:

int matrix(char oper,double* mat1=NULL,unsigned long m=0,unsigned long n=0,
double* mat2=NULL,unsigned long p=0,unsigned long q=0,double* res1=NULL,
double* res2=NULL,unsigned long *np=NULL);

THE NECESSARY SPACE FOR RES1, RES2 AND NP MUST BE ALLOCATED IN THE CALLING 
PROGRAM.

6.2.Parameters
    ----------
    oper: operator; a character among the set {+,-,*,.,d,t,f,h,x,i,v}
    mat1: a pointer to the 1st (m x n) matrix operand
    m: the number of rows of mat1
    n: the number of columns of mat1
    mat2: a pointer to the 2nd (p x q) matrix operand (if applicable)
    p: the number of rows of mat2
    q: the number of columns of mat2
    res1: a pointer to the 1st matrix of the result (see note 1)
    res2: a pointer to the 2nd matrix of the result (if applicable) (see note 1)
    np: a pointer to a ulong integer to retrieve the number of exchanged
        lines (see note 1)

Note 1: for res1, res2 and np, no space is allocated through the 'matrix'
        function. It is up to the calling program to allocate the
        necessary space.
Note 2: a scalar can be considered as a 1 by 1 matrix.

6.3.Operators
    ---------
    + operator (addition)
    ---------------------
    Addition of 2 m by n matrices: C=A+B

    Sample call: ret=matrix('+',A,m,n,B,m,n,C);

    - operator (subtraction)
    -------------------------
    Subtraction of 2 m by n matrices: C=A-B

    Sample call: ret=matrix('-',A,m,n,B,m,n,C);

    * operator (multiplication of a matrix by another)
    --------------------------------------------------
    Multiplication of a m x n matrix A by a n x q matrix B: C=A*B

    Sample call: ret=matrix('*',A,m,n,B,n,q,C);

    . operator (multiplication of a matrix by a scalar)
    ---------------------------------------------------
    Multiplication of a m x n matrix A by a scalar a: B=a.A

    Sample call: ret=matrix('.',A,m,n,a,1,1,B);

    d operator (determinant computing)
    ----------------------------------
    Compute the determinant of the m x m matrix A and retrieve it in d: d=|A|

    Sample call: ret=matrix('d',A,m,m,NULL,0,0,d);

    t operator (triangularization)
    ------------------------------
    Triangularization of a m x m matrix A in an upper triangular matrix R.
    Simple pivotation (exchange of lines) is used.

    In systems of linear equations, we have generally:
         Ax=b (1)

    After transformation, (1) becomes:
         Rx=c (2)

    So it is quite practical to be able to retrieve c.
    You can obtain this by passing A as mat1, b as mat2; you will retrieve
    R in res1 and c in res2.
   
    Sample call: ret=matrix('t',A,m,m,b,m,1,R,c) (here q=1 but it could be
                 anything else);

    f operator (LU decomposition)
    -----------------------------
    Decomposition of a m x m matrix A in a lower triangular matrix L whose
    all the diagonal elements are 1's and an upper triangular matrix U.
    No pivoting methods are used in this factorization.

    The resulting matrix (res1) has the following form:

      u(1,1) u(1,2)........u(1,m)
      l(2,1) u(2,2)........u(2,m)
         .      .             .
         .      .             .
      l(m,1) l(m,2)........u(m,m)

    and l(i,i)=1 for 1=<i=<m

    THE 1ST ELEMENT (1st row, 1st column) OF A CANNOT BE 0.

    Sample call: ret=matrix('f',A,m,m,NULL,0,0,F);

    h operator (QR decomposition - Householder method)
    --------------------------------------------------
    Decomposition of a m x n (m >= n) matrix A in an unitary matrix Q and 
    an upper triangular matrix R.
    Q is stored in res1 and R in res2.

    Sample call: ret=matrix('h',A,m,n,NULL,0,0,Q,R);

    x operator (transposition)
    --------------------------
    Transpose the matrix m x n A and store the result in the n x m matrix B

    Sample call: ret=matrix('x',A,m,n,NULL,0,0,B);

    i operator (inversion)
    ----------------------
    Compute the inverse of the matrix m x m A and store the result in
    the m x m matrix B.

    THERE IS NO CHECK ON THE VALUE OF THE DETERMINANT (must not be null)
    IMPLEMENTED IN THIS FUNCTION. IT IS UP TO THE USER TO CHECK IT FIRST!

    Sample call: ret=matrix('i',A,m,m,NULL,0,0,B);

    v operator (pivot)
    ---------------------
    Line exchanges on a m x m matrix A to obtain a matrix C whose the diagonal
    element (i,i) with i>=1 is such that its absolute value is the maximum of the 
    elements of the i-th column of the m-i+1 x m-i+1 sub-matrix.

    If another matrix B is passed as mat2, the permutation matrix applied on A
    will also be applied on it and the resulting matrix will be found in res2.

    Sample call: ret=matrix('v',A,m,m,B,m,q,C,D);


6.4.Return values
    -------------
     0: normal completion.
     1: your trial period has expired; you have now to register
        (see register.txt for more information's).
     2: division by 0.
     4: the 1st element of the matrix (1st row, 1st column) is 0;
        exchange lines and/or columns to avoid it. This return code
        can happen only in LU factorization.
     8: dimensions don't match.
    12: missing or invalid parameter(s).
    16: invalid operator.
    24: memory allocation failure.


7.Contacting the author
  ---------------------
You can contact the author at the following location:

			Serge COLLIN
			rue Montoyer 37/3
			B-1000 Brussels
			BELGIUM (Europe)
			e-mail: sergecollin@hotmail.com


8.Notice
  ------
Windows 95 and Windows NT are trademarks of Microsoft Inc.