psqp_matrix_module Module

Matrix routines.

History

  • Original version: LU, 1991

Note

Some of these could just be replaced with normal array operations.


Uses

  • module~~psqp_matrix_module~~UsesGraph module~psqp_matrix_module psqp_matrix_module module~psqp_kind_module psqp_kind_module module~psqp_matrix_module->module~psqp_kind_module iso_fortran_env iso_fortran_env module~psqp_kind_module->iso_fortran_env

Used by

  • module~~psqp_matrix_module~~UsedByGraph module~psqp_matrix_module psqp_matrix_module module~psqp_module psqp_module module~psqp_module->module~psqp_matrix_module

Functions

public pure function mxdpgp(n, a, x, y)

Date
91/12/01

computation of the number mxdpgp=trans(x)*d**(-1)*y where d is a diagonal matrix in the factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(in) :: a(*)

a(n*(n+1)/2) factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.

real(kind=wp), intent(in) :: x(*)

input vector.

real(kind=wp), intent(in) :: y(*)

input vector.

Return Value real(kind=wp)

computed number mxdpgp=trans(x)*d**(-1)*y.

public pure function mxvdot(n, x, y)

Date
91/12/01

dot product of two vectors.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

vector dimension.

real(kind=wp), intent(in) :: x(*)

x(n) input vector.

real(kind=wp), intent(in) :: y(*)

y(n) input vector.

Return Value real(kind=wp)

value of dot product mxvdot=trans(x)*y.

public pure function mxvmax(n, x)

Date
91/12/01

l-infinity norm of a vector.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

vector dimension.

real(kind=wp), intent(in) :: x(*)

x(n) input vector.

Return Value real(kind=wp)

l-infinity norm of the vector x.


Subroutines

public pure subroutine mxdpgb(n, a, x, job)

Date
91/12/01

solution of a system of linear equations with a dense symmetric positive definite matrix a+e using the factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(in) :: a(*)

a(n*(n+1)/2) factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.

real(kind=wp), intent(inout) :: x(*)

x(n) on input the right hand side of a system of linear equations. on output the solution of a system of linear equations.

integer, intent(in) :: job

option

Read more…

public pure subroutine mxdpgf(n, a, inf, alf, tau)

Date
89/12/01

factorization a+e=l*d*trans(l) of a dense symmetric positive definite matrix a+e where d and e are diagonal positive definite matrices and l is a lower triangular matrix. if a is sufficiently positive definite then e=0.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(inout) :: a(*)

a(n*(n+1)/2) on input a given dense symmetric (usually positive definite) matrix a stored in the packed form. on output the computed factorization a+e=l*d*trans(l).

integer, intent(out) :: inf

an information obtained in the factorization process. if:

Read more…
real(kind=wp), intent(inout) :: alf

on input a desired tolerance for positive definiteness. on output the most negative diagonal element used in the factorization process (if inf>0).

real(kind=wp), intent(out) :: tau

maximum diagonal element of the matrix e.

public pure subroutine mxdpgs(n, a, alf)

Date
91/12/01

scaling of a dense symmetric positive definite matrix a+e using the factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(inout) :: a(*)

a(n*(n+1)/2) factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.

real(kind=wp), intent(in) :: alf

scaling factor.

public pure subroutine mxdpgu(n, a, alf, x, y)

Date
89/12/01

correction of a dense symmetric positive definite matrix a+e in the factored form a+e=l*d*trans(l) obtained by the subroutine mxdpgf. the correction is defined as a+e:=a+e+alf*x*trans(x) where alf is a given scaling factor and x is a given vector.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(inout) :: a(*)

a(n*(n+1)/2) factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.

real(kind=wp), intent(in) :: alf

scaling factor in the correction term.

real(kind=wp), intent(in) :: x(*)

vector in the correction term.

real(kind=wp), intent(out) :: y(*)

auxiliary vector.

public pure subroutine mxdprb(n, a, x, job)

Date
89/12/01

solution of a system of linear equations with a dense symmetric positive definite matrix a using the factorization a=trans(r)*r.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(in) :: a(*)

a(n(n+1)/2) factorization a=trans(r)r.

real(kind=wp), intent(inout) :: x(*)

x(n) on input the right hand side of a system of linear equations. on output the solution of a system of linear equations.

integer, intent(in) :: job

option

Read more…

public pure subroutine mxdsmi(n, a)

Date
88/12/01

dense symmetric matrix a is set to the unit matrix with the same order.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(out) :: a(*)

a(n*(n+1)/2) dense symmetric matrix stored in the packed form which is set to the unit matrix (i.e. a:=i).

public pure subroutine mxdsmm(n, a, x, y)

Date
89/12/01

multiplication of a dense symmetric matrix a by a vector x.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(in) :: a(*)

a(n*(n+1)/2) dense symmetric matrix stored in the packed form.

real(kind=wp), intent(in) :: x(*)

x(n) input vector.

real(kind=wp), intent(out) :: y(*)

y(n) output vector equal to a*x.

public pure subroutine mxdsmv(n, a, x, k)

Date
91/12/01

k-th row of a dense symmetric matrix a is copied to the vector x.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(in) :: a(*)

a(n*(n+1)/2) dense symmetric matrix stored in the packed form.

real(kind=wp), intent(out) :: x(*)

x(n) output vector.

integer, intent(in) :: k

index of copied row.

public pure subroutine mxvcop(n, x, y)

Date
88/12/01

copying of a vector.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

vector dimension.

real(kind=wp), intent(in) :: x(*)

x(n) input vector.

real(kind=wp), intent(out) :: y(*)

y(n) output vector where y:= x.

public pure subroutine mxvdif(n, x, y, z)

Date
88/12/01

vector difference.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

vector dimension.

real(kind=wp), intent(in) :: x(*)

x(n) input vector.

real(kind=wp), intent(in) :: y(*)

y(n) input vector.

real(kind=wp), intent(out) :: z(*)

z(n) output vector where z:= x - y.

public pure subroutine mxvdir(n, a, x, y, z)

Date
91/12/01

vector augmented by the scaled vector.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

vector dimension.

real(kind=wp), intent(in) :: a

scaling factor.

real(kind=wp), intent(in) :: x(*)

x(n) input vector.

real(kind=wp), intent(in) :: y(*)

y(n) input vector.

real(kind=wp), intent(out) :: z(*)

z(n) output vector where z:= y + a*x.

public pure subroutine mxvina(n, ix)

Date
90/12/01

elements of the integer vector are replaced by their absolute values.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

dimension of the integer vector.

integer, intent(inout) :: ix(*)

vector which is updated so that ix(i):=abs(ix(i)) for all i.

public pure subroutine mxvinv(ix, i, job)

Date
91/12/01

change of the integer vector element for the constraint addition.

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: ix(*)

ix(n) integer vector.

integer, intent(in) :: i

index of the changed element.

integer, intent(in) :: job

change specification

public pure subroutine mxvneg(n, x, y)

Date
88/12/01

change the signs of vector elements.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

vector dimension.

real(kind=wp), intent(in) :: x(*)

x(n) input vector.

real(kind=wp), intent(out) :: y(*)

y(n) output vector where y:= - x.

public pure subroutine mxvort(xk, xl, ck, cl, ier)

Date
91/12/01

determination of an elementary orthogonal matrix for plane rotation.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: xk

first value for plane rotation (xk is transformed to sqrt(xk2+xl2))

real(kind=wp), intent(inout) :: xl

second value for plane rotation (xl is transformed to zero)

real(kind=wp), intent(out) :: ck

diagonal element of the elementary orthogonal matrix.

real(kind=wp), intent(out) :: cl

off-diagonal element of the elementary orthogonal matrix.

integer, intent(out) :: ier

information on the transformation.

Read more…

public pure subroutine mxvrot(xk, xl, ck, cl, ier)

Date
91/12/01

plane rotation is applied to two values.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: xk

first value for plane rotation.

real(kind=wp), intent(inout) :: xl

second value for plane rotation.

real(kind=wp), intent(in) :: ck

diagonal element of the elementary orthogonal matrix.

real(kind=wp), intent(in) :: cl

off-diagonal element of the elementary orthogonal matrix.

integer, intent(in) :: ier

information on the transformation:

Read more…

public pure subroutine mxvsav(n, x, y)

Date
91/12/01

difference of two vectors returned in the subtracted one.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

vector dimension.

real(kind=wp), intent(inout) :: x(*)

x(n) input vector.

real(kind=wp), intent(inout) :: y(*)

y(n) update vector where y:= x - y.

public pure subroutine mxvscl(n, a, x, y)

Date
88/12/01

scaling of a vector.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

vector dimension.

real(kind=wp), intent(in) :: a

scaling factor.

real(kind=wp), intent(in) :: x(*)

x(n) input vector.

real(kind=wp), intent(out) :: y(*)

y(n) output vector where y:= a*x.

public pure subroutine mxvset(n, a, x)

Date
88/12/01

a scalar is set to all the elements of a vector.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

vector dimension.

real(kind=wp), intent(in) :: a

initial value.

real(kind=wp), intent(out) :: x(*)

x(n) output vector such that x(i)=a for all i.