MATPROG,CMATPROG         Library  "JINRLIB"                      
                                       
    Author: E.V.Zemlyanaya                                           You are
    Language: Fortran                                                
                                                                     visitor here.

        SOLUTION OF THREE-DIAGONAL ALGEBRAIC SYSTEM OF VECTOR EQUATIONS

    Subroutines MATPROG and CMATPROG solve an algebraic system 
    of the following form:

    ai * zi-1 + bi * zi + ci * zi+1 = di          i =1,...,N           (1)

    where:
       a, b, c  -  matrixes of coefficients (L,L,N);
       d        -  vector of right parts (L,N);
       z        -  vector of solutions (L,N).  
               
    In the code MATPROG variables a,b,c,d,z are real;      
    In CMATPROG a,b,c,d,z are complex.

    Systems of the form (1) typically arise in result of finite difference
    approximation of linear systems of ordinary differential equations (ODE).
    So the code can be useful for numerical solution of these systems.
    It can also be applied in Newtonian schemes for numerical solution
    of nonlinear ODEs, and in implicit schemes for numerical simulation
    of particle differential systems.       

    For example, MATPROG was used in the implicit scheme for the modelling
    of thermoelastic effects in metals irradiated by impulse ion beams [1];
    CMATPROG was used in Newtonian scheme for stability analyses of gap 
    solitons [2].
           
    Algorithm of codes MATPROG and CMATPROG is given in [1], sect.4.      

    References:
    -----------
    1. I.V.Amirkhanov,E.V.Zemlyanaya,I.V.Puzynin,T.P.Puzynina,I.Sarhadov.
       JINR Comm. 11-2002-24, Dubna, 2002.
    2. I.V.Barashenkov and E.V.Zemlyanaya. Comp. Phys. Comm.       
       Vol.126, No.1-2, 2000, pp.22-27.

    Usage:
    ------ 
    CALL MATPROG  (N,L,a,b,c,d,z,aa,bb)
    CALL CMATPROG (N,L,a,b,c,d,z,aa,bb), where:
       N, L  - (INTEGER) dimension of arrays;      
       a,b,c - arrays of coefficients (L,L,N);      
       d     - array of right parts (L,N);      
       z     - array of solutions (L,N);      
       aa,bb - job arrays (L,L,N).      
   
    In subroutine MATPROG the type of variables a,b,c,d,z,aa,bb - REAL*8;       
    In subroutine CMATPROG the type of variables a,b,c,d,z,aa,bb - COMPLEX*16.      

    Subroutines MULTMM, MULTMV, INVERSE, MULTMMC, MULTMVC, INVERSE_C      
    are used for multiplication of matrixes and vectors (both complex and real)       
    and for the matrix inverse (in complex and real variables).      

    Sources and the detailed description (in Russian) are submitted.