Matrix routines.
Note
Some of these could just be replaced with normal array operations.
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
order of the matrix a. |
||
| real(kind=wp), | intent(in) | :: | a(*) |
|
||
| real(kind=wp), | intent(in) | :: | x(*) |
input vector. |
||
| real(kind=wp), | intent(in) | :: | y(*) |
input vector. |
computed number mxdpgp=trans(x)*d**(-1)*y.
dot product of two vectors.
| Type | Intent | Optional | 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. |
value of dot product mxvdot=trans(x)*y.
l-infinity norm of a vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
vector dimension. |
||
| real(kind=wp), | intent(in) | :: | x(*) |
x(n) input vector. |
l-infinity norm of the vector x.
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
order of the matrix a. |
||
| real(kind=wp), | intent(in) | :: | a(*) |
|
||
| 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 |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
order of the matrix a. |
||
| real(kind=wp), | intent(inout) | :: | a(*) |
|
||
| integer, | intent(out) | :: | inf |
an information obtained in the factorization process. if: |
||
| 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. |
scaling of a dense symmetric positive definite matrix a+e using the
factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
order of the matrix a. |
||
| real(kind=wp), | intent(inout) | :: | a(*) |
|
||
| real(kind=wp), | intent(in) | :: | alf |
scaling factor. |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
order of the matrix a. |
||
| real(kind=wp), | intent(inout) | :: | a(*) |
|
||
| 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. |
solution of a system of linear equations with a dense symmetric positive definite matrix a using the factorization a=trans(r)*r.
| Type | Intent | Optional | 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 |
dense symmetric matrix a is set to the unit matrix with the same order.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
order of the matrix a. |
||
| real(kind=wp), | intent(out) | :: | a(*) |
|
multiplication of a dense symmetric matrix a by a vector x.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
order of the matrix a. |
||
| real(kind=wp), | intent(in) | :: | a(*) |
|
||
| real(kind=wp), | intent(in) | :: | x(*) |
x(n) input vector. |
||
| real(kind=wp), | intent(out) | :: | y(*) |
y(n) output vector equal to |
k-th row of a dense symmetric matrix a is copied to the vector x.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
order of the matrix a. |
||
| real(kind=wp), | intent(in) | :: | a(*) |
|
||
| real(kind=wp), | intent(out) | :: | x(*) |
x(n) output vector. |
||
| integer, | intent(in) | :: | k |
index of copied row. |
copying of a vector.
| Type | Intent | Optional | 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 |
vector difference.
| Type | Intent | Optional | 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 |
vector augmented by the scaled vector.
| Type | Intent | Optional | 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 |
elements of the integer vector are replaced by their absolute values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
dimension of the integer vector. |
||
| integer, | intent(inout) | :: | ix(*) |
vector which is updated so that
|
change of the integer vector element for the constraint addition.
| Type | Intent | Optional | 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 |
change the signs of vector elements.
| Type | Intent | Optional | 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 |
determination of an elementary orthogonal matrix for plane rotation.
| Type | Intent | Optional | 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. |
plane rotation is applied to two values.
| Type | Intent | Optional | 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: |
difference of two vectors returned in the subtracted one.
| Type | Intent | Optional | 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 |
scaling of a vector.
| Type | Intent | Optional | 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 |
a scalar is set to all the elements of a vector.
| Type | Intent | Optional | 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 |