## MB04DI

### Applying the inverse of a balancing transformation for a real Hamiltonian matrix

[Specification] [Arguments] [Method] [References] [Comments] [Example]

Purpose

```  To apply the inverse of a balancing transformation, computed by
the SLICOT Library routines MB04DD or MB04DS, to a 2*N-by-M matrix

[   V1   ]
[        ],
[ sgn*V2 ]

where sgn is either +1 or -1.

```
Specification
```      SUBROUTINE MB04DI( JOB, SGN, N, ILO, SCALE, M, V1, LDV1, V2, LDV2,
\$                   INFO )
C     .. Scalar Arguments ..
CHARACTER         JOB, SGN
INTEGER           ILO, INFO, LDV1, LDV2, M, N
C     .. Array Arguments ..
DOUBLE PRECISION  SCALE(*), V1(LDV1,*), V2(LDV2,*)

```
Arguments

Mode Parameters

```  JOB     CHARACTER*1
Specifies the type of inverse transformation required:
= 'N':  do nothing, return immediately;
= 'P':  do inverse transformation for permutation only;
= 'S':  do inverse transformation for scaling only;
= 'B':  do inverse transformations for both permutation
and scaling.
JOB must be the same as the argument JOB supplied to
MB04DD or MB04DS.

SGN     CHARACTER*1
Specifies the sign to use for V2:
= 'P':  sgn = +1;
= 'N':  sgn = -1.

```
Input/Output Parameters
```  N       (input) INTEGER
The number of rows of the matrices V1 and V2. N >= 0.

ILO     (input) INTEGER
The integer ILO determined by MB04DD or MB04DS.
1 <= ILO <= N+1.

SCALE   (input) DOUBLE PRECISION array, dimension (N)
Details of the permutation and scaling factors, as
returned by MB04DD or MB04DS.

M       (input) INTEGER
The number of columns of the matrices V1 and V2.  M >= 0.

V1      (input/output) DOUBLE PRECISION array, dimension (LDV1,M)
On entry, the leading N-by-M part of this array must
contain the matrix V1.
On exit, the leading N-by-M part of this array is
overwritten by the updated matrix V1 of the transformed
matrix.

LDV1    INTEGER
The leading dimension of the array V1. LDV1 >= max(1,N).

V2      (input/output) DOUBLE PRECISION array, dimension (LDV2,M)
On entry, the leading N-by-M part of this array must
contain the matrix V2.
On exit, the leading N-by-M part of this array is
overwritten by the updated matrix V2 of the transformed
matrix.

LDV2    INTEGER
The leading dimension of the array V2. LDV2 >= max(1,N).

```
Error Indicator
```  INFO    INTEGER
= 0:  successful exit;
< 0:  if INFO = -i, the i-th argument had an illegal
value.

```
References
```   Benner, P.
Symplectic balancing of Hamiltonian matrices.
SIAM J. Sci. Comput., 22 (5), pp. 1885-1904, 2001.

```
```  None
```
Example

Program Text

```  None
```
Program Data
```  None
```
Program Results
```  None
```