F06QJF (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

F06QJF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

F06QJF permutes the rows or columns of a real rectangular matrix using an integer array of permutations.

2  Specification

SUBROUTINE F06QJF ( SIDE, TRANS, N, PERM, K, B, LDB)
INTEGER  N, PERM(*), K, LDB
REAL (KIND=nag_wp)  B(LDB,*)
CHARACTER(1)  SIDE, TRANS

3  Description

F06QJF performs one of the permutation operations
BPTB, BPB, BBPT  or BBP,  
where B is a real matrix, and P is a permutation matrix.
P is represented in the form
P=P1,p1P2,p2Pn,pn,  
where Pi,j is the permutation matrix that interchanges items i and j; that is, Pi,j is the unit matrix with rows and columns i and j interchanged. If i=j, Pi,j=I.
Let m denote the number of rows of B if SIDE='L', or the number of columns of B if SIDE='R': the routine does not require m to be passed as an argument, but assumes that mpi, for i=1,2,,n.
This routine requires the indices pi to be supplied in an integer array; F06QKF performs the same operation with the indices supplied in a real array.

4  References

None.

5  Parameters

1:     SIDE – CHARACTER(1)Input
2:     TRANS – CHARACTER(1)Input
On entry: specifies the operation to be performed.
SIDE='L' and TRANS='T'
BPTB.
SIDE='L' and TRANS='N'
BPB.
SIDE='R' and TRANS='T'
BBPT.
SIDE='R' and TRANS='N'
BBP.
Constraints:
  • SIDE='L' or 'R';
  • TRANS='N' or 'T'.
3:     N – INTEGERInput
On entry: n, the number of interchanges in the representation of P.
Constraint: N0.
4:     PERM* – INTEGER arrayInput
Note: the dimension of the array PERM must be at least max1,N .
On entry: the n indices pi which define the interchanges in the representation of P. It is usual to have pii, but this is not necessary.
Constraint: 1PERMim.
5:     K – INTEGERInput
On entry: k, the number of columns of B if SIDE='L', or the number of rows of B if SIDE='R'.
Constraint: K0.
6:     BLDB* – REAL (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array B must be at least max1,K if SIDE='L' and at least max1,maxkPERMk  if SIDE='R'.
On entry: the original matrix B; B is m by k if SIDE='L', or k by m if SIDE='R'.
On exit: the permuted matrix B.
7:     LDB – INTEGERInput
On entry: the first dimension of the array B as declared in the (sub)program from which F06QJF is called.
Constraints:
  • if SIDE='L', LDB max1,m ;
  • if SIDE='R', LDB max1,K .

6  Error Indicators and Warnings

None.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

None.

F06QJF (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015