Module ppm_module_util_matinv_2x2

This module provides the routines that compute inverse of 2x2 matrices.

Defined Types

name description

no types

Defined Module Interfaces

name description

ppm_util_matinv_2x2

Defined Module Subroutines

name description

no subroutines

Interface ppm_util_matinv_2x2

Subroutines contained in this interface:

name description

ppm_util_matinv_2x2_s

This routine computes the inverse of a 2x2 matrix using explicit

ppm_util_matinv_2x2_d

This routine computes the inverse of a 2x2 matrix using explicit

Subroutine ppm_util_matinv_2x2_d

This routine computes the inverse of a 2x2 matrix using explicit formulas.

[Note]Note

This routine uses the formula inv(A) = adj(a)/det(A). The det(A) is computed by expansion of the first row. adj(A) is computed from all 1x1 sub-determinants of A.

[Tip]Tip

For ppm_debug > 1 the routine checks its own result. Maybe - after some time - this can be removed.

Arguments

name type dimension intent optional description

am

real array

(2,2)

(IN)

The 2x2 matrix stored in row-major order (i.e. first index is row

aminv

real array

(2,2)

(OUT)

The inverse of Am

info

integer

(OUT)

Return status, 0 on success

am

real array, (2,2), (IN)

The 2x2 matrix stored in row-major order (i.e. first index is row number, 2nd is column number).

aminv

real array, (2,2), (OUT)

The inverse of Am

info

integer, , (OUT)

Return status, 0 on success

Used Modules

ppm_module_data, ppm_module_error, ppm_module_write, ppm_module_substop, ppm_module_substart

Subroutine ppm_util_matinv_2x2_s

This routine computes the inverse of a 2x2 matrix using explicit formulas.

[Note]Note

This routine uses the formula inv(A) = adj(a)/det(A). The det(A) is computed by expansion of the first row. adj(A) is computed from all 1x1 sub-determinants of A.

[Tip]Tip

For ppm_debug > 1 the routine checks its own result. Maybe - after some time - this can be removed.

Arguments

name type dimension intent optional description

am

real array

(2,2)

(IN)

The 2x2 matrix stored in row-major order (i.e. first index is row

aminv

real array

(2,2)

(OUT)

The inverse of Am

info

integer

(OUT)

Return status, 0 on success

am

real array, (2,2), (IN)

The 2x2 matrix stored in row-major order (i.e. first index is row number, 2nd is column number).

aminv

real array, (2,2), (OUT)

The inverse of Am

info

integer, , (OUT)

Return status, 0 on success

Used Modules

ppm_module_data, ppm_module_error, ppm_module_write, ppm_module_substop, ppm_module_substart

Defined Module Variables

name type dimension description

no variables

Used Modules

has no uses