lit
    JINRLIB

MATRIX -

F103

: S.Kurjo :

opopaa MATRIX o p caoco ap opa.
oa opa opc opao oo, oop aac p opa opopa ac acoo apapa.

oaco oppao pa pppoa oca p acco, c o o ap pacoaac o coa, a c aoa ap ( ppa c. opa "pco po").

opa opa oaoa c opa.
.
0, - .
, (*), , , opopao coc.

:

: - SUBROUTINE
: - MATRIX
: - DVPACK DMUNPK
: - DVMPY DVCPY (F002)
DMMPY DMCPY DMADD DMSUB (F003)
DMMLT (F004)
DFINV DFEQN DFACT (F011)

:

CALL MATRIX(IOPCOD,M,N,KOP,A,KA,B,KB,C,KC), :

IOPCOD - (INTEGER) opao o, op ap opa;
M - (INTEGER) oco cpo;
N - (INTEGER) oco coo;
KOP - (INTEGER) ;
A - (REAL*8) apa A(KA,*);
KA - (INTEGER) papoc coa A;
B - (REAL*8) apa B(KB,*);
KB - (INTEGER) papoc coa B;
C - (REAL*8) apa C(KC,*);
KC - (INTEGER) papoc coa C.

Mapa opa pao o
pacopoa 0
pca 1
pco po 2
aoa cpc ap 4
acaoa cpc ap 5
pa ap p cc pa 10
cc pa 11
o 20
o 21
a 22
pacopoao o 23

.

:


pacopoa ( 0)

CALL MATRIX(0,M,N,0,A,KA,B,KB,C,0), :

M - oco cpo ap A;
N - oco coo ap A;
A - ;
KA - papoc coa A (KA ≥ M);
B - apa B;
KB - papoc coa B (KB ≥ N);
C - apa C(*).

apa B cop pacopoa ap A.


( 1)

CALL MATRIX(1,M,N,0,A,KA,B,KB,C,0), :

M - oco cpo ap A B;
N - oco coo ap A B;
A - A;
KA - papoc coa A (KA ≥ M);
B - apa B;
KB - papoc coa B (KB ≥ M);
C - apa C(*).

apa B cop ap A.


Cpco po ( 2)

pa "pco po" poo o pacopoao ap A a co ap A.
ao opa c cpca apa.
oa apa B cop oo ppo oo cpco ap, pac o cpoa, , a opao, pca coo aoa ap.
c o oooc occao (pacaoa) o cpc ap, o ocooac opa "acaoa cpo ap", o "pacopoao po".

CALL MATRIX(2,M,N,0,A,KA,B,KB,C,0), :

M - oco cpo ap A;
N - oco coo ap A;
A - A;
KA - papoc coa A (KA ≥ M);
B - apa B;
KB - papoc coa B(*);
C - apa C(*).

apa B cop aoa ppo po A'A (A' oaa pacopoa ap A).
BIJ aoao ap apc BB(I*(K-1)/2-N+J), K=2*N+1.
oco o pao (N2+N)/2.
apa B aa oopo acc BB.


aoa cpco ap ( 4)

pa "aoa" apa ppoo ac oo cpco ap A o cpoa ap B.

CALL MATRIX(4,M,M,0,A,KA,B,KB,C,0), :

M - oco cpo ap A;
A - A;
KA - papoc coa A (KA ≥ M);
B - apa B (M2+M)/2;
KB - papoc coa B(*);
C - apa C(*).

BIJ aoao ap B, I ≤ J, o apcoa
a B(I*(K-I)/2-N+J), c B paccapa a oop acc, K=2N+1.
oco o c (N2+N)/2.


acaoa cpco ap ( 5)

pa "acaoa cpco ap" opp o ap B o ppoo aoao ap A.

CALL MATRIX(5,M,M,0,A,KA,B,KB,C,0), :

M - oco cpo ap B;
A - A;
KA - papoc coa A(*);
B - apa B;
KB - papoc coa B (KB ≥ M);
C - apa C(*).

pa ap p cc pa ( 10)

pa "pa ap p cc pa"
poo opa M*M ac coo ap A , po oo, pa cc ( cc) pa.
c pocc opa ap oapc, o apa ocoa, a c ppaac.

CALL MATRIX(10,M,N,0,A,KA,B,KB,C,0), :

M - oco cpo ap A;
N - oco coo ap A;
A - A; p M coo ap copa o cc, c N>M, c N-M coo copa pa ac N-M cc apac pa, p oop o c;
KA - papoc coa A (KA ≥ M);
B - op cc
( , 1 );
KB - papoc coa B(*);
C - apa C(*).

B pa M coo ap A copa opa ap, c N-M coo copa p cooc cc apac pa. B cop op cc M*M.


cc pa ( 11)

pa " cc pa" oca p cc apac pa co pa ac, oa pc opa ap (ao op cc).
pa opopa o o opa coco aa apapo , o p opa c opao oo 10.
o - 11.


o ( 20)

pa "o" poa co ap A B apa
pa C. ac C o aaa a ap A B.
o ca co ap o ocaoo o, o oo o pac pa o.

CALL MATRIX(20,M,N,KOP,A,KA,B,KB,C,KC), :

M - oco cpo A C;
N - oco coo A; oco cpo B;
KOP - oco coo B C;
A - A;
KA - papoc coa A (KA ≥ M);
B - apa B;
KB - papoc coa B (KB ≥ N);
C - apa C (o aaa A B);
KC - papoc coa C (KC ≥ M).

c C=A B, a c co cpoa ap C caaa apac acc, a pcac cooc co cpo A B.


o ( 21)

pa oo co o ap A B,
pa apac ap C.

CALL MATRIX(21,M,N,0,A,KA,B,KB,C,KC), :

M - oco cpo ap A, B C;
N - oco coo ap A, B C;
A - A;
KA - papoc coa A (KA ≥ M);
B - apa B;
KB - papoc coa B (KB ≥ M);
C - apa C;
KC - papoc coa C (KC ≥ M).

a ( 22)

pa "a" poo a ap B A
apa pa C.

CALL MATRIX(22,M,N,0,A,KA,B,KB,C,KC), :

M - oco cpo ap A, B C;
N - oco coo ap A, B C;
A - A;
KA - papoc coa A (KA ≥ M);
B - apa B;
KB - papoc coa B (KB ≥ M);
C - apa C;
KC - papoc coa C (KC ≥ M).

pacopoao po ( 23)

pa poo o pacopoao ap A a B.
po apac C.

CALL MATRIX(23,M,N,KOP,A,KA,B,KB,C,KC), :

M - oco cpo A B;
N - oco coo A, oco cpo C;
KOP - oco coo B C;
A - A;
KA - papoc coa A (KA ≥ M);
B - apa B;
KB - papoc coa B (KB ≥ M);
C - apa C;
KC - papoc coa C (KC ≥ N).

:
       IMPLICIT REAL*8 (A-H,O-Z)
       DIMENSION A(10,10),B(10,10),C(10,10)
       . . .
    C..ADD A TO A TO OBTAIN ATRANS
       CALL MATRIX (21,10,10,0,A,10,B,10,C,10)
    C..SUBTRACT MATRIX A FROM MATRIX B
       CALL MATRIX (22,10,10,0,B,10,A,10,C,10)
       . . .
:
       INPUT MATRIX  A
 
       .100E+01   .100E+01   .100E+01   .100E+01
       .100E+01   .100E+01   .100E+01   .100E+01
       .100E+01   .100E+01   .100E+01   .100E+01
       .100E+01   .100E+01   .100E+01   .100E+01
 
       INPUT MATRIX  B
 
       .200E+01   .200E+01   .200E+01   .200E+01
       .200E+01   .200E+01   .200E+01   .200E+01
       .200E+01   .200E+01   .200E+01   .200E+01
       .200E+01   .200E+01   .200E+01   .200E+01
 
       SUM OF MATRIX A AND B (IOP = 21)
 
       .300E+01   .300E+01   .300E+01   .300E+01
       .300E+01   .300E+01   .300E+01   .300E+01
       .300E+01   .300E+01   .300E+01   .300E+01
       .300E+01   .300E+01   .300E+01   .300E+01
 
        SUBTRACT MATRIX A FROM MATRIX B (IOP = 22)
 
       .100E+01   .100E+01   .100E+01   .100E+01
       .100E+01   .100E+01   .100E+01   .100E+01
       .100E+01   .100E+01   .100E+01   .100E+01
       .100E+01   .100E+01   .100E+01   .100E+01


home up e-mail