f08ag multiplies an arbitrary real matrix C by the real orthogonal matrix Q from a QR factorization computed by (F08AEF not in this release) f08be f08bf.

Syntax

C#
public static void f08ag(
	string side,
	string trans,
	int m,
	int n,
	int k,
	double[,] a,
	double[] tau,
	double[,] c,
	out int info
)
Visual Basic
Public Shared Sub f08ag ( _
	side As String, _
	trans As String, _
	m As Integer, _
	n As Integer, _
	k As Integer, _
	a As Double(,), _
	tau As Double(), _
	c As Double(,), _
	<OutAttribute> ByRef info As Integer _
)
Visual C++
public:
static void f08ag(
	String^ side, 
	String^ trans, 
	int m, 
	int n, 
	int k, 
	array<double,2>^ a, 
	array<double>^ tau, 
	array<double,2>^ c, 
	[OutAttribute] int% info
)
F#
static member f08ag : 
        side : string * 
        trans : string * 
        m : int * 
        n : int * 
        k : int * 
        a : float[,] * 
        tau : float[] * 
        c : float[,] * 
        info : int byref -> unit 

Parameters

side
Type: System..::..String
On entry: indicates how Q or QT is to be applied to C.
side="L"
Q or QT is applied to C from the left.
side="R"
Q or QT is applied to C from the right.
Constraint: side="L" or "R".
trans
Type: System..::..String
On entry: indicates whether Q or QT is to be applied to C.
trans="N"
Q is applied to C.
trans="T"
QT is applied to C.
Constraint: trans="N" or "T".
m
Type: System..::..Int32
On entry: m, the number of rows of the matrix C.
Constraint: m0.
n
Type: System..::..Int32
On entry: n, the number of columns of the matrix C.
Constraint: n0.
k
Type: System..::..Int32
On entry: k, the number of elementary reflectors whose product defines the matrix Q.
Constraints:
  • if side="L", mk0;
  • if side="R", nk0.
a
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint:
  • if side="L", dim1max1,m;
  • if side="R", dim1max1,n.
Note: the second dimension of the array a must be at least max1,k.
On entry: details of the vectors which define the elementary reflectors, as returned by f08aef08be or f08bf.
tau
Type: array<System..::..Double>[]()[][]
An array of size [dim1]
Note: the dimension of the array tau must be at least max1,k.
On entry: further details of the elementary reflectors, as returned by f08aef08be or f08bf.
c
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: dim1max1,m
Note: the second dimension of the array c must be at least max1,n.
On entry: the m by n matrix C.
On exit: c is overwritten by QC or QTC or CQ or CQT as specified by side and trans.
info
Type: System..::..Int32%
On exit: info=0 unless the method detects an error (see [Error Indicators and Warnings]).

Description

f08ag is intended to be used after a call to (F08AEF not in this release) f08be f08bf which perform a QR factorization of a real matrix A. The orthogonal matrix Q is represented as a product of elementary reflectors.
This method may be used to form one of the matrix products
QC,QTC,CQ​ or ​CQT,
overwriting the result on c (which may be any real rectangular matrix).
A common application of this method is in solving linear least squares problems, as described in the F08 class and illustrated in [Example] in f08ae.

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Error Indicators and Warnings

Some error messages may refer to parameters that are dropped from this interface (LDA, LDC) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
info<0
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.
ifail=-9000
An error occured, see message report.
ifail=-6000
Invalid Parameters value
ifail=-4000
Invalid dimension for array value
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value
ifail=-6000
Invalid Parameters value

Accuracy

The computed result differs from the exact result by a matrix E such that
E2=OεC2,
where ε is the machine precision.

Parallelism and Performance

None.

Further Comments

The total number of floating-point operations is approximately 2nk2m-k if side="L" and 2mk2n-k if side="R".
The complex analogue of this method is (F08AUF not in this release).

Example

See Also