mctc_io_math Module

Simple algebraic functions



Functions

public pure function crossprod(a, b) result(c)

Implements the cross/vector product between two 3D vectors

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a(3)

First vector

real(kind=wp), intent(in) :: b(3)

Second vector

Return Value real(kind=wp), (3)

Orthogonal vector

public pure function matdet_3x3(a) result(det)

Determinant of 3×3 matrix

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a(3,3)

Matrix

Return Value real(kind=wp)

Determinant

public pure function matinv_3x3(a) result(b)

Performs a direct calculation of the inverse of a 3×3 matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a(3,3)

Matrix

Return Value real(kind=wp), (3,3)

Inverse matrix


Subroutines

public pure subroutine eigval_3x3(a, w)

Calculates eigenvalues based on the trigonometric solution of A = pB + qI

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a(3,3)

The symmetric input matrix

real(kind=wp), intent(out) :: w(3)

Contains eigenvalues on exit

public pure subroutine eigvec_3x3(a, w, q)

Calculates eigenvector using an analytical method based on vector cross

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: a(3,3)
real(kind=wp), intent(out) :: w(3)
real(kind=wp), intent(out) :: q(3,3)