NAG FL Interface
f01dgf (real_​tri_​matmul_​inplace)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

f01dgf performs one of the matrix-matrix operations
BαAB, BαATB, BαBA  or BαBAT,  
where A and B are real triangular matrices, and α is a real scalar.

2 Specification

Fortran Interface
Subroutine f01dgf ( side, uplo, transa, n, alpha, a, lda, b, ldb, ifail)
Integer, Intent (In) :: n, lda, ldb
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: alpha, a(lda,*)
Real (Kind=nag_wp), Intent (Inout) :: b(ldb,*)
Character (1), Intent (In) :: side, uplo, transa
C Header Interface
#include <nag.h>
void  f01dgf_ (const char *side, const char *uplo, const char *transa, const Integer *n, const double *alpha, const double a[], const Integer *lda, double b[], const Integer *ldb, Integer *ifail, const Charlen length_side, const Charlen length_uplo, const Charlen length_transa)
The routine may be called by the names f01dgf or nagf_matop_real_tri_matmul_inplace.

3 Description

f01dgf computes the matrix product B=αAB or B=αBA for two upper triangular or two lower triangular matrices. The storage method for matrices A and B must match (e.g., A and B must both be upper triangular or lower triangular matrices). When the transpose of the input matrix A is used during computation, the solution matrix B is a general matrix. Otherwise, the solution matrix B is a triangular matrix with the storage method identified by the input argument uplo.

4 References

None.

5 Arguments

1: side Character(1) Input
On entry: specifies whether B is operated on from the left or the right.
side='L'
B is pre-multiplied from the left.
side='R'
B is post-multiplied from the right.
Constraint: side='L' or 'R'.
2: uplo Character(1) Input
On entry: specifies whether A and B are upper or lower triangular.
uplo='U'
A and B are upper triangular.
uplo='L'
A and B are lower triangular.
Constraint: uplo='U' or 'L'.
3: transa Character(1) Input
On entry: specifies whether the operation involves A or AT.
transa='N'
The operation involves A.
transa='T' or 'C'
The operation involves AT.
Constraint: transa='N', 'T' or 'C'.
4: n Integer Input
On entry: n, the order of the triangular matrices A and B.
Constraint: n0.
5: alpha Real (Kind=nag_wp) Input
On entry: the scalar α.
6: a(lda,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array a must be at least max(1,n).
On entry: the n×n triangular matrix A.
  • If uplo='U', A is upper triangular and the elements of the array below the diagonal are not referenced.
  • If uplo='L', A is lower triangular and the elements of the array above the diagonal are not referenced.
7: lda Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f01dgf is called.
Constraint: ldamax(1,n).
8: b(ldb,*) Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array b must be at least max(1,n).
On entry: the n×n triangular matrix B.
  • If uplo='U', B is upper triangular and the elements of the array below the diagonal are not referenced.
  • If uplo='L', B is lower triangularand the elements of the array above the diagonal are not referenced.
If alpha=0, b need not be set.
On exit: B is overwritten.
  • If transa='N',
    • if uplo='U', B is upper triangular and the elements of the array below the diagonal are not set.
    • if uplo='L', B is lower triangular and the elements of the array above the diagonal are not set.
  • If transa='T' or 'C', B is a general matrix.
9: ldb Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f01dgf is called.
Constraint: ldbmax(1,n).
10: ifail Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or −1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, side=value.
Constraint: side='L' or 'R'.
ifail=2
On entry, uplo=value.
Constraint: uplo='U' or 'L'.
ifail=3
On entry, transa=value.
Constraint: transa='N', 'T' or 'C'.
ifail=4
On entry, n=value.
Constraint: n0.
ifail=5
On entry, lda=value, n=value.
Constraint: ldamax(1,n).
ifail=6
On entry, ldb=value, n=value.
Constraint: ldbmax(1,n).
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
f01dgf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

None.

10 Example

This example reads in two upper triangular matrices A and B. It then calls f01dgf to compute the triangular matrix product B=αATB.

10.1 Program Text

Program Text (f01dgfe.f90)

10.2 Program Data

Program Data (f01dgfe.d)

10.3 Program Results

Program Results (f01dgfe.r)