Manual for Real Matrix Library
--------------------------------------------------------------------

This library defines a matrix class, a vector class and a polynomial
class and their operations. 

-------------------------------------------------------
1 Matrix Class

1.1 Constructors

Typically the matrix can be constructed as the follows:

   dmatrix A(3,4)   // a 3x4 matrix
   dmatrix B(5)     // a 5x5 square matrix
or 
   dmatrix C        // a 4x4 (default) square matrix

Matrix is defined as an alias of dmatrix, so you can also use it
as a constructor.

1.2 Matrix Operations

Matrix binary operations can be performed as usual data-type, e.g.,

   A + B            // addition
   A - B            // substraction
   A * B            // multipication
   A / B            // division

Moreover, the library allows operations on a matrix and a real, e.g.,

   A + 5.0 
   2 - A 
   A * 3 
   1 / A 

Matrix uninary operations include:

   Tran(A)          // Transpose
   Conj(A)          // Conjugate
   Adj(A)           // Adjoint
   Inv(A)           // Inverse
   Det(A)           // Determenant
   Norm(A)          // Norm
   Cond(A)          // Conditional number
   Diag(A)          // Diagonal elements
   Pinv(A)          // Psuedo-inverse
   Rank(A)          // Rank

Matrix index and submatrix:

   A(1,2)            // (1,2)-element of matrix A
   A(10)             // 10th element of matrix A (counted row by row)
   Submat(A,1,3,2,4) // Submatrix of matrix A by its rows (from 1 to 3)
                     //     and columns (from 2 to 4)
   Mcol(A,2)         // 2nd column of matrix A
   Mrow(A,3)         // 3rd row of matrix A
   JoinRow(A,B)      // | A  B |
   JoinCol(A,B)      // | A |
                     // | B |


1.3 Special matrix

   Ident(4)          // 4x4 identity matrix
   Null(4)           // 4x4 zero matrix
   Null(3,4)         // 3x4 zero matrix

1.4 Linear Algebra

This library includes the following linear algebra operations:

   lu(A,L,U)         // LU decomposition (Doolittle's algorithm)
   lud(A,L,U)        // LU decomposition (Crout's algorithm)
   chol(A)           // Choleskey factorization for symmetric matrix
   qr(A,Q,R)         // QR decomposition
   hess(A,H,P)       // Hessenberg form
   svd(A,U,S,V)      // SVD decomposition
   eig(A,Wr,Wi)      // eigenvalues (Wr: real part; Wi: imaginary part)
   eig(A,Wr,Wi,Vr,Vi) // eigenvalues (Wr: real part; Wi: imaginary part) 
                      // eigenvectors (Vr: real part; Vi: imaginary part) 

----------------------------------------------------------------------
2 Vector Class

Vector class comes from matrix class. It is defined to clearify the use 
of vectors and matrices. Some additional operations for vectors are:

   Vector v(5)       // define a 5x1 vector
or
   dvector  u        // define a 4x1 (default) vector
   Subvec(v,2,4)     // subvector of v defines by 2nd to 4th elements
   Vdot(u,v)         // vector dot-product: u*Tran(v)
   Vmul(u,v)         // vector outer-product: Tran(u)*v

-----------------------------------------------------------------------
3 Polynomial Class

Polynomial class also comes from matrix class. It is defined to be row
vector. However, many operations defined in matrix class are changed.
e.g.,
  
   dpoly a(3)        // define a polynomial a(3)*s^3+a(2)*s^2+a(1)*s+a(0)
   Polynm b          // define b(4)*s^4+b(3)*s^3+b(2)*s^2+b(1)*s+b(0)
   a * b             // convolution of polynomials a and b
   a^3               // power of polynomial a
   a + b             // addition of polynomails a and b
   Roots(a,wr,wi)    // roots of polynomial a (wr:real part; wi:imaginary part)
   Char_poly(A)      // characteristic polynomial of matrix A

------------------------------------------------------------------------
4 Usage

Linking the library in yours code is very easy. One thing important is that
if you use Borland C++, you should add the following line in your codes:

   #define NO_BOOLEAN

If you use GNU C++, then it is not necessary.

------------------------------------------------------------------------
5 Copyright

See "readme.txt"
