1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
*DECK ALPINV
SUBROUTINE ALPINV(M,N,A,AINV)
*
*-----------------------------------------------------------------------
*
*Purpose:
* pseudo inversion of a non singular matrix using Gaussian elimination
* with partial pivoting. Real version.
*
*Copyright:
* Copyright (C) 2015 Ecole Polytechnique de Montreal
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
*Author(s): A. Hebert
*
*Parameters: input
* M first dimension of matrix A.
* N second dimension of matrix A.
* A coefficient matrix to be inverted.
*
*Parameters: output
* AINV pseudo inverted matrix.
*
*-----------------------------------------------------------------------
*
*----
* SUBROUTINE ARGUMENTS
*----
INTEGER M,N
REAL A(M,N),AINV(N,M)
*----
* LOCAL VARIABLES
*----
REAL, DIMENSION(:,:), ALLOCATABLE :: B
*
ALLOCATE(B(N,N))
B=MATMUL(TRANSPOSE(A),A)
CALL ALINV(N, B, N, IER)
IF(IER.NE.0) CALL XABORT('ALPINV: PSEUDO INVERSION FAILURE.')
AINV=MATMUL(B, TRANSPOSE(A))
DEALLOCATE(B)
RETURN
END
|