Documentation INTEL

CD ROM Annuaire d'Entreprises France prospect (avec ou sans emails) : REMISE DE 10 % Avec le code réduction AUDEN872
: matrix-matrix product, triangular matrix, double-precision
complex.
Sparse BLAS level 1 naming conventions are similar to those of BLAS level 1. For more information, see
Naming Conventions.
Fortran 95 Interface Conventions
Fortran 95 interface to BLAS and Sparse BLAS Level 1 routines is implemented through wrappers that call
respective FORTRAN 77 routines. This interface uses such features of Fortran 95 as assumed-shape arrays
and optional arguments to provide simplified calls to BLAS and Sparse BLAS Level 1 routines with fewer
parameters.
2 Intel® Math Kernel Library Reference Manual
52
NOTE For BLAS, Intel MKL offers two types of Fortran 95 interfaces:
• using mkl_blas.fi only through include 'mkl_blas_subroutine.fi' statement. Such
interfaces allow you to make use of the original LAPACK routines with all their arguments
• using blas.f90 that includes improved interfaces. This file is used to generate the module files
blas95.mod and f95_precision.mod. The module files mkl95_blas.mod and
mkl95_precision.mod are also generated. See also section "Fortran 95 interfaces and wrappers
to LAPACK and BLAS" of Intel® MKL User's Guide for details. The module files are used to process
the FORTRAN use clauses referencing the BLAS interface: use blas95 (or an equivalent use
mkl95_blas) and use f95_precision (or an equivalent use mkl95_precision).
The main conventions used in Fortran 95 interface are as follows:
• The names of parameters used in Fortran 95 interface are typically the same as those used for the
respective generic (FORTRAN 77) interface. In rare cases formal argument names may be different.
• Some input parameters such as array dimensions are not required in Fortran 95 and are skipped from the
calling sequence. Array dimensions are reconstructed from the user data that must exactly follow the
required array shape.
• A parameter can be skipped if its value is completely defined by the presence or absence of another
parameter in the calling sequence, and the restored value is the only meaningful value for the skipped
parameter.
• Parameters specifying the increment values incx and incy are skipped. In most cases their values are
equal to 1. In Fortran 95 an increment with different value can be directly established in the
corresponding parameter.
• Some generic parameters are declared as optional in Fortran 95 interface and may or may not be present
in the calling sequence. A parameter can be declared optional if it satisfies one of the following conditions:
1. It can take only a few possible values. The default value of such parameter typically is the first value in
the list; all exceptions to this rule are explicitly stated in the routine description.
2. It has a natural default value.
Optional parameters are given in square brackets in Fortran 95 call syntax.
The particular rules used for reconstructing the values of omitted optional parameters are specific for each
routine and are detailed in the respective "Fortran 95 Notes" subsection at the end of routine specification
section. If this subsection is omitted, the Fortran 95 interface for the given routine does not differ from the
corresponding FORTRAN 77 interface.
Note that this interface is not implemented in the current version of Sparse BLAS Level 2 and Level 3
routines.
Matrix Storage Schemes
Matrix arguments of BLAS routines can use the following storage schemes:
• Full storage: a matrix A is stored in a two-dimensional array a, with the matrix element aij stored in the
array element a(i,j).
• Packed storage scheme allows you to store symmetric, Hermitian, or triangular matrices more compactly:
the upper or lower triangle of the matrix is packed by columns in a one-dimensional array.
• Band storage: a band matrix is stored compactly in a two-dimensional array: columns of the matrix are
stored in the corresponding columns of the array, and diagonals of the matrix are stored in rows of the
array.
For more information on matrix storage schemes, see Matrix Arguments in Appendix B.
BLAS Level 1 Routines and Functions
BLAS Level 1 includes routines and functions, which perform vector-vector operations. Table “BLAS Level 1
Routine Groups and Their Data Types” lists the BLAS Level 1 routine and function groups and the data types
associated with them.
BLAS and Sparse BLAS Routines 2
53
BLAS Level 1 Routine and Function Groups and Their Data Types
Routine or
Function Group
Data Types Description
?asum s, d, sc, dz Sum of vector magnitudes (functions)
?axpy s, d, c, z Scalar-vector product (routines)
?copy s, d, c, z Copy vector (routines)
?dot s, d Dot product (functions)
?sdot sd, d Dot product with extended precision (functions)
?dotc c, z Dot product conjugated (functions)
?dotu c, z Dot product unconjugated (functions)
?nrm2 s, d, sc, dz Vector 2-norm (Euclidean norm) (functions)
?rot s, d, cs, zd Plane rotation of points (routines)
?rotg s, d, c, z Generate Givens rotation of points (routines)
?rotm s, d Modified Givens plane rotation of points (routines)
?rotmg s, d Generate modified Givens plane rotation of points
(routines)
?scal s, d, c, z, cs, zd Vector-scalar product (routines)
?swap s, d, c, z Vector-vector swap (routines)
i?amax s, d, c, z Index of the maximum absolute value element of a vector
(functions)
i?amin s, d, c, z Index of the minimum absolute value element of a vector
(functions)
?cabs1 s, d Auxiliary functions, compute the absolute value of a
complex number of single or double precision
?asum
Computes the sum of magnitudes of the vector
elements.
Syntax
Fortran 77:
res = sasum(n, x, incx)
res = scasum(n, x, incx)
res = dasum(n, x, incx)
res = dzasum(n, x, incx)
Fortran 95:
res = asum(x)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
2 Intel® Math Kernel Library Reference Manual
54
• C: mkl_blas.h
Description
The ?asum routine computes the sum of the magnitudes of elements of a real vector, or the sum of
magnitudes of the real and imaginary parts of elements of a complex vector:
res = |Re x(1)| + |Im x(1)| + |Re x(2)| + |Im x(2)|+ ... + |Re x(n)| + |Im x(n)|,
where x is a vector with a number of elements that equals n.
Input Parameters
n INTEGER. Specifies the number of elements in vector x.
x REAL for sasum
DOUBLE PRECISION for dasum
COMPLEX for scasum
DOUBLE COMPLEX for dzasum
Array, DIMENSION at least (1 + (n-1)*abs(incx)).
incx INTEGER. Specifies the increment for indexing vector x.
Output Parameters
res REAL for sasum
DOUBLE PRECISION for dasum
REAL for scasum
DOUBLE PRECISION for dzasum
Contains the sum of magnitudes of real and imaginary parts of all elements
of the vector.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine asum interface are the following:
x Holds the array of size n.
?axpy
Computes a vector-scalar product and adds the result
to a vector.
Syntax
Fortran 77:
call saxpy(n, a, x, incx, y, incy)
call daxpy(n, a, x, incx, y, incy)
call caxpy(n, a, x, incx, y, incy)
call zaxpy(n, a, x, incx, y, incy)
Fortran 95:
call axpy(x, y [,a])
BLAS and Sparse BLAS Routines 2
55
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?axpy routines perform a vector-vector operation defined as
y := a*x + y
where:
a is a scalar
x and y are vectors each with a number of elements that equals n.
Input Parameters
n INTEGER. Specifies the number of elements in vectors x and y.
a REAL for saxpy
DOUBLE PRECISION for daxpy
COMPLEX for caxpy
DOUBLE COMPLEX for zaxpy
Specifies the scalar a.
x REAL for saxpy
DOUBLE PRECISION for daxpy
COMPLEX for caxpy
DOUBLE COMPLEX for zaxpy
Array, DIMENSION at least (1 + (n-1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
y REAL for saxpy
DOUBLE PRECISION for daxpy
COMPLEX for caxpy
DOUBLE COMPLEX for zaxpy
Array, DIMENSION at least (1 + (n-1)*abs(incy)).
incy INTEGER. Specifies the increment for the elements of y.
Output Parameters
y Contains the updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine axpy interface are the following:
x Holds the array of size n.
y Holds the array of size n.
a The default value is 1.
?copy
Copies vector to another vector.
2 Intel® Math Kernel Library Reference Manual
56
Syntax
Fortran 77:
call scopy(n, x, incx, y, incy)
call dcopy(n, x, incx, y, incy)
call ccopy(n, x, incx, y, incy)
call zcopy(n, x, incx, y, incy)
Fortran 95:
call copy(x, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?copy routines perform a vector-vector operation defined as
y = x,
where x and y are vectors.
Input Parameters
n INTEGER. Specifies the number of elements in vectors x and y.
x REAL for scopy
DOUBLE PRECISION for dcopy
COMPLEX for ccopy
DOUBLE COMPLEX for zcopy
Array, DIMENSION at least (1 + (n-1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
y REAL for scopy
DOUBLE PRECISION for dcopy
COMPLEX for ccopy
DOUBLE COMPLEX for zcopy
Array, DIMENSION at least (1 + (n-1)*abs(incy)).
incy INTEGER. Specifies the increment for the elements of y.
Output Parameters
y Contains a copy of the vector x if n is positive. Otherwise, parameters are
unaltered.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine copy interface are the following:
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
BLAS and Sparse BLAS Routines 2
57
?dot
Computes a vector-vector dot product.
Syntax
Fortran 77:
res = sdot(n, x, incx, y, incy)
res = ddot(n, x, incx, y, incy)
Fortran 95:
res = dot(x, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?dot routines perform a vector-vector reduction operation defined as
where xi and yi are elements of vectors x and y.
Input Parameters
n INTEGER. Specifies the number of elements in vectors x and y.
x REAL for sdot
DOUBLE PRECISION for ddot
Array, DIMENSION at least (1+(n-1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
y REAL for sdot
DOUBLE PRECISION for ddot
Array, DIMENSION at least (1+(n-1)*abs(incy)).
incy INTEGER. Specifies the increment for the elements of y.
Output Parameters
res REAL for sdot
DOUBLE PRECISION for ddot
Contains the result of the dot product of x and y, if n is positive. Otherwise,
res contains 0.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine dot interface are the following:
2 Intel® Math Kernel Library Reference Manual
58
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
?sdot
Computes a vector-vector dot product with extended
precision.
Syntax
Fortran 77:
res = sdsdot(n, sb, sx, incx, sy, incy)
res = dsdot(n, sx, incx, sy, incy)
Fortran 95:
res = sdot(sx, sy)
res = sdot(sx, sy, sb)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?sdot routines compute the inner product of two vectors with extended precision. Both routines use
extended precision accumulation of the intermediate results, but the sdsdot routine outputs the final result
in single precision, whereas the dsdot routine outputs the double precision result. The function sdsdot also
adds scalar value sb to the inner product.
Input Parameters
n INTEGER. Specifies the number of elements in the input vectors sx and sy.
sb REAL. Single precision scalar to be added to inner product (for the function
sdsdot only).
sx, sy REAL.
Arrays, DIMENSION at least (1+(n -1)*abs(incx)) and (1+
(n-1)*abs(incy)), respectively. Contain the input single precision
vectors.
incx INTEGER. Specifies the increment for the elements of sx.
incy INTEGER. Specifies the increment for the elements of sy.
Output Parameters
res REAL for sdsdot
DOUBLE PRECISION for dsdot
Contains the result of the dot product of sx and sy (with sb added for
sdsdot), if n is positive. Otherwise, res contains sb for sdsdot and 0 for
dsdot.
BLAS and Sparse BLAS Routines 2
59
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sdot interface are the following:
sx Holds the vector with the number of elements n.
sy Holds the vector with the number of elements n.
NOTE Note that scalar parameter sb is declared as a required parameter in Fortran 95 interface for
the function sdot to distinguish between function flavors that output final result in different precision.
?dotc
Computes a dot product of a conjugated vector with
another vector.
Syntax
Fortran 77:
res = cdotc(n, x, incx, y, incy)
res = zdotc(n, x, incx, y, incy)
Fortran 95:
res = dotc(x, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?dotc routines perform a vector-vector operation defined as:
where xi and yi are elements of vectors x and y.
Input Parameters
n INTEGER. Specifies the number of elements in vectors x and y.
x COMPLEX for cdotc
DOUBLE COMPLEX for zdotc
Array, DIMENSION at least (1 + (n -1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
y COMPLEX for cdotc
DOUBLE COMPLEX for zdotc
Array, DIMENSION at least (1 + (n -1)*abs(incy)).
incy INTEGER. Specifies the increment for the elements of y.
2 Intel® Math Kernel Library Reference Manual
60
Output Parameters
res COMPLEX for cdotc
DOUBLE COMPLEX for zdotc
Contains the result of the dot product of the conjugated x and unconjugated
y, if n is positive. Otherwise, res contains 0.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine dotc interface are the following:
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
?dotu
Computes a vector-vector dot product.
Syntax
Fortran 77:
res = cdotu(n, x, incx, y, incy)
res = zdotu(n, x, incx, y, incy)
Fortran 95:
res = dotu(x, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?dotu routines perform a vector-vector reduction operation defined as
where xi and yi are elements of complex vectors x and y.
Input Parameters
n INTEGER. Specifies the number of elements in vectors x and y.
x COMPLEX for cdotu
DOUBLE COMPLEX for zdotu
Array, DIMENSION at least (1 + (n -1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
y COMPLEX for cdotu
DOUBLE COMPLEX for zdotu
BLAS and Sparse BLAS Routines 2
61
Array, DIMENSION at least (1 + (n -1)*abs(incy)).
incy INTEGER. Specifies the increment for the elements of y.
Output Parameters
res COMPLEX for cdotu
DOUBLE COMPLEX for zdotu
Contains the result of the dot product of x and y, if n is positive. Otherwise,
res contains 0.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine dotu interface are the following:
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
?nrm2
Computes the Euclidean norm of a vector.
Syntax
Fortran 77:
res = snrm2(n, x, incx)
res = dnrm2(n, x, incx)
res = scnrm2(n, x, incx)
res = dznrm2(n, x, incx)
Fortran 95:
res = nrm2(x)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?nrm2 routines perform a vector reduction operation defined as
res = ||x||,
where:
x is a vector,
res is a value containing the Euclidean norm of the elements of x.
Input Parameters
n INTEGER. Specifies the number of elements in vector x.
x REAL for snrm2
2 Intel® Math Kernel Library Reference Manual
62
DOUBLE PRECISION for dnrm2
COMPLEX for scnrm2
DOUBLE COMPLEX for dznrm2
Array, DIMENSION at least (1 + (n -1)*abs (incx)).
incx INTEGER. Specifies the increment for the elements of x.
Output Parameters
res REAL for snrm2
DOUBLE PRECISION for dnrm2
REAL for scnrm2
DOUBLE PRECISION for dznrm2
Contains the Euclidean norm of the vector x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine nrm2 interface are the following:
x Holds the vector with the number of elements n.
?rot
Performs rotation of points in the plane.
Syntax
Fortran 77:
call srot(n, x, incx, y, incy, c, s)
call drot(n, x, incx, y, incy, c, s)
call csrot(n, x, incx, y, incy, c, s)
call zdrot(n, x, incx, y, incy, c, s)
Fortran 95:
call rot(x, y, c, s)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
Given two complex vectors x and y, each vector element of these vectors is replaced as follows:
x(i) = c*x(i) + s*y(i)
y(i) = c*y(i) - s*x(i)
Input Parameters
n INTEGER. Specifies the number of elements in vectors x and y.
x REAL for srot
BLAS and Sparse BLAS Routines 2
63
DOUBLE PRECISION for drot
COMPLEX for csrot
DOUBLE COMPLEX for zdrot
Array, DIMENSION at least (1 + (n-1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
y REAL for srot
DOUBLE PRECISION for drot
COMPLEX for csrot
DOUBLE COMPLEX for zdrot
Array, DIMENSION at least (1 + (n -1)*abs(incy)).
incy INTEGER. Specifies the increment for the elements of y.
c REAL for srot
DOUBLE PRECISION for drot
REAL for csrot
DOUBLE PRECISION for zdrot
A scalar.
s REAL for srot
DOUBLE PRECISION for drot
REAL for csrot
DOUBLE PRECISION for zdrot
A scalar.
Output Parameters
x Each element is replaced by c*x + s*y.
y Each element is replaced by c*y - s*x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine rot interface are the following:
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
?rotg
Computes the parameters for a Givens rotation.
Syntax
Fortran 77:
call srotg(a, b, c, s)
call drotg(a, b, c, s)
call crotg(a, b, c, s)
call zrotg(a, b, c, s)
Fortran 95:
call rotg(a, b, c, s)
2 Intel® Math Kernel Library Reference Manual
64
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
Given the Cartesian coordinates (a, b) of a point, these routines return the parameters c, s, r, and z
associated with the Givens rotation. The parameters c and s define a unitary matrix such that:
The parameter z is defined such that if |a| > |b|, z is s; otherwise if c is not 0 z is 1/c; otherwise z is 1.
See a more accurate LAPACK version ?lartg.
Input Parameters
a REAL for srotg
DOUBLE PRECISION for drotg
COMPLEX for crotg
DOUBLE COMPLEX for zrotg
Provides the x-coordinate of the point p.
b REAL for srotg
DOUBLE PRECISION for drotg
COMPLEX for crotg
DOUBLE COMPLEX for zrotg
Provides the y-coordinate of the point p.
Output Parameters
a Contains the parameter r associated with the Givens rotation.
b Contains the parameter z associated with the Givens rotation.
c REAL for srotg
DOUBLE PRECISION for drotg
REAL for crotg
DOUBLE PRECISION for zrotg
Contains the parameter c associated with the Givens rotation.
s REAL for srotg
DOUBLE PRECISION for drotg
COMPLEX for crotg
DOUBLE COMPLEX for zrotg
Contains the parameter s associated with the Givens rotation.
?rotm
Performs modified Givens rotation of points in the
plane.
Syntax
Fortran 77:
call srotm(n, x, incx, y, incy, param)
BLAS and Sparse BLAS Routines 2
65
call drotm(n, x, incx, y, incy, param)
Fortran 95:
call rotm(x, y, param)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
Given two vectors x and y, each vector element of these vectors is replaced as follows:
for i=1 to n, where H is a modified Givens transformation matrix whose values are stored in the param(2)
through param(5) array. See discussion on the param argument.
Input Parameters
n INTEGER. Specifies the number of elements in vectors x and y.
x REAL for srotm
DOUBLE PRECISION for drotm
Array, DIMENSION at least (1 + (n -1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
y REAL for srotm
DOUBLE PRECISION for drotm
Array, DIMENSION at least (1 + (n -1)*abs(incy)).
incy INTEGER. Specifies the increment for the elements of y.
param REAL for srotm
DOUBLE PRECISION for drotm
Array, DIMENSION 5.
The elements of the param array are:
param(1) contains a switch, flag. param(2-5) contain h11, h21, h12, and
h22, respectively, the components of the array H.
Depending on the values of flag, the components of H are set as follows:
2 Intel® Math Kernel Library Reference Manual
66
In the last three cases, the matrix entries of 1., -1., and 0. are assumed
based on the value of flag and are not required to be set in the param
vector.
Output Parameters
x Each element x(i) is replaced by h11*x(i) + h12*y(i).
y Each element y(i) is replaced by h21*x(i) + h22*y(i).
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine rotm interface are the following:
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
?rotmg
Computes the parameters for a modified Givens
rotation.
Syntax
Fortran 77:
call srotmg(d1, d2, x1, y1, param)
call drotmg(d1, d2, x1, y1, param)
Fortran 95:
call rotmg(d1, d2, x1, y1, param)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
Given Cartesian coordinates (x1, y1) of an input vector, these routines compute the components of a
modified Givens transformation matrix H that zeros the y-component of the resulting vector:
BLAS and Sparse BLAS Routines 2
67
Input Parameters
d1 REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the scaling factor for the x-coordinate of the input vector.
d2 REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the scaling factor for the y-coordinate of the input vector.
x1 REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the x-coordinate of the input vector.
y1 REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the y-coordinate of the input vector.
Output Parameters
d1 REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the first diagonal element of the updated matrix.
d2 REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the second diagonal element of the updated matrix.
x1 REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the x-coordinate of the rotated vector before scaling.
param REAL for srotmg
DOUBLE PRECISION for drotmg
Array, DIMENSION 5.
The elements of the param array are:
param(1) contains a switch, flag. param(2-5) contain h11, h21, h12, and
h22, respectively, the components of the array H.
Depending on the values of flag, the components of H are set as follows:
2 Intel® Math Kernel Library Reference Manual
68
In the last three cases, the matrix entries of 1., -1., and 0. are assumed
based on the value of flag and are not required to be set in the param
vector.
?scal
Computes the product of a vector by a scalar.
Syntax
Fortran 77:
call sscal(n, a, x, incx)
call dscal(n, a, x, incx)
call cscal(n, a, x, incx)
call zscal(n, a, x, incx)
call csscal(n, a, x, incx)
call zdscal(n, a, x, incx)
Fortran 95:
call scal(x, a)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?scal routines perform a vector operation defined as
x = a*x
where:
a is a scalar, x is an n-element vector.
Input Parameters
n INTEGER. Specifies the number of elements in vector x.
a REAL for sscal and csscal
DOUBLE PRECISION for dscal and zdscal
COMPLEX for cscal
DOUBLE COMPLEX for zscal
Specifies the scalar a.
x REAL for sscal
DOUBLE PRECISION for dscal
COMPLEX for cscal and csscal
DOUBLE COMPLEX for zscal and zdscal
Array, DIMENSION at least (1 + (n -1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
BLAS and Sparse BLAS Routines 2
69
Output Parameters
x Updated vector x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine scal interface are the following:
x Holds the vector with the number of elements n.
?swap
Swaps a vector with another vector.
Syntax
Fortran 77:
call sswap(n, x, incx, y, incy)
call dswap(n, x, incx, y, incy)
call cswap(n, x, incx, y, incy)
call zswap(n, x, incx, y, incy)
Fortran 95:
call swap(x, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
Given two vectors x and y, the ?swap routines return vectors y and x swapped, each replacing the other.
Input Parameters
n INTEGER. Specifies the number of elements in vectors x and y.
x REAL for sswap
DOUBLE PRECISION for dswap
COMPLEX for cswap
DOUBLE COMPLEX for zswap
Array, DIMENSION at least (1 + (n-1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
y REAL for sswap
DOUBLE PRECISION for dswap
COMPLEX for cswap
DOUBLE COMPLEX for zswap
Array, DIMENSION at least (1 + (n-1)*abs(incy)).
incy INTEGER. Specifies the increment for the elements of y.
2 Intel® Math Kernel Library Reference Manual
70
Output Parameters
x Contains the resultant vector x, that is, the input vector y.
y Contains the resultant vector y, that is, the input vector x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine swap interface are the following:
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
i?amax
Finds the index of the element with maximum
absolute value.
Syntax
Fortran 77:
index = isamax(n, x, incx)
index = idamax(n, x, incx)
index = icamax(n, x, incx)
index = izamax(n, x, incx)
Fortran 95:
index = iamax(x)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
This function is declared in mkl_blas.fi for FORTRAN 77 interface, in blas.f90 for Fortran 95 interface,
and in mkl_blas.h for C interface.
Given a vector x, the i?amax functions return the position of the vector element x(i) that has the largest
absolute value for real flavors, or the largest sum |Re(x(i))|+|Im(x(i))| for complex flavors.
If n is not positive, 0 is returned.
If more than one vector element is found with the same largest absolute value, the index of the first one
encountered is returned.
Input Parameters
n INTEGER. Specifies the number of elements in vector x.
x REAL for isamax
DOUBLE PRECISION for idamax
COMPLEX for icamax
BLAS and Sparse BLAS Routines 2
71
DOUBLE COMPLEX for izamax
Array, DIMENSION at least (1+(n-1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
Output Parameters
index INTEGER. Contains the position of vector element x that has the largest
absolute value.
Fortran 95 Interface Notes
Functions and routines in Fortran 95 interface have fewer arguments in the calling sequence than their
FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments,
see Fortran 95 Interface Conventions.
Specific details for the function iamax interface are the following:
x Holds the vector with the number of elements n.
i?amin
Finds the index of the element with the smallest
absolute value.
Syntax
Fortran 77:
index = isamin(n, x, incx)
index = idamin(n, x, incx)
index = icamin(n, x, incx)
index = izamin(n, x, incx)
Fortran 95:
index = iamin(x)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
This function is declared in mkl_blas.fi for FORTRAN 77 interface, in blas.f90 for Fortran 95 interface,
and in mkl_blas.h for C interface.
Given a vector x, the i?amin functions return the position of the vector element x(i) that has the smallest
absolute value for real flavors, or the smallest sum |Re(x(i))|+|Im(x(i))| for complex flavors.
If n is not positive, 0 is returned.
If more than one vector element is found with the same smallest absolute value, the index of the first one
encountered is returned.
Input Parameters
n INTEGER. On entry, n specifies the number of elements in vector x.
x REAL for isamin
2 Intel® Math Kernel Library Reference Manual
72
DOUBLE PRECISION for idamin
COMPLEX for icamin
DOUBLE COMPLEX for izamin
Array, DIMENSION at least (1+(n-1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
Output Parameters
index INTEGER. Contains the position of vector element x that has the smallest
absolute value.
Fortran 95 Interface Notes
Functions and routines in Fortran 95 interface have fewer arguments in the calling sequence than their
FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments,
see Fortran 95 Interface Conventions.
Specific details for the function iamin interface are the following:
x Holds the vector with the number of elements n.
?cabs1
Computes absolute value of complex number.
Syntax
Fortran 77:
res = scabs1(z)
res = dcabs1(z)
Fortran 95:
res = cabs1(z)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?cabs1 is an auxiliary routine for a few BLAS Level 1 routines. This routine performs an operation
defined as
res=|Re(z)|+|Im(z)|,
where z is a scalar, and res is a value containing the absolute value of a complex number z.
Input Parameters
z COMPLEX scalar for scabs1.
DOUBLE COMPLEX scalar for dcabs1.
Output Parameters
res REAL for scabs1.
DOUBLE PRECISION for dcabs1.
Contains the absolute value of a complex number z.
BLAS and Sparse BLAS Routines 2
73
BLAS Level 2 Routines
This section describes BLAS Level 2 routines, which perform matrix-vector operations. Table “BLAS Level 2
Routine Groups and Their Data Types” lists the BLAS Level 2 routine groups and the data types associated
with them.
BLAS Level 2 Routine Groups and Their Data Types
Routine Groups Data Types Description
?gbmv s, d, c, z Matrix-vector product using a general band matrix
gemv s, d, c, z Matrix-vector product using a general matrix
?ger s, d Rank-1 update of a general matrix
?gerc c, z Rank-1 update of a conjugated general matrix
?geru c, z Rank-1 update of a general matrix, unconjugated
?hbmv c, z Matrix-vector product using a Hermitian band matrix
?hemv c, z Matrix-vector product using a Hermitian matrix
?her c, z Rank-1 update of a Hermitian matrix
?her2 c, z Rank-2 update of a Hermitian matrix
?hpmv c, z Matrix-vector product using a Hermitian packed matrix
?hpr c, z Rank-1 update of a Hermitian packed matrix
?hpr2 c, z Rank-2 update of a Hermitian packed matrix
?sbmv s, d Matrix-vector product using symmetric band matrix
?spmv s, d Matrix-vector product using a symmetric packed matrix
?spr s, d Rank-1 update of a symmetric packed matrix
?spr2 s, d Rank-2 update of a symmetric packed matrix
?symv s, d Matrix-vector product using a symmetric matrix
?syr s, d Rank-1 update of a symmetric matrix
?syr2 s, d Rank-2 update of a symmetric matrix
?tbmv s, d, c, z Matrix-vector product using a triangular band matrix
?tbsv s, d, c, z Solution of a linear system of equations with a triangular
band matrix
?tpmv s, d, c, z Matrix-vector product using a triangular packed matrix
?tpsv s, d, c, z Solution of a linear system of equations with a triangular
packed matrix
?trmv s, d, c, z Matrix-vector product using a triangular matrix
?trsv s, d, c, z Solution of a linear system of equations with a triangular
matrix
2 Intel® Math Kernel Library Reference Manual
74
?gbmv
Computes a matrix-vector product using a general
band matrix
Syntax
Fortran 77:
call sgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
call dgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
call cgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
call zgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
Fortran 95:
call gbmv(a, x, y [,kl] [,m] [,alpha] [,beta] [,trans])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?gbmv routines perform a matrix-vector operation defined as
y := alpha*A*x + beta*y,
or
y := alpha*A'*x + beta*y,
or
y := alpha *conjg(A')*x + beta*y,
where:
alpha and beta are scalars,
x and y are vectors,
A is an m-by-n band matrix, with kl sub-diagonals and ku super-diagonals.
Input Parameters
trans CHARACTER*1. Specifies the operation:
If trans= 'N' or 'n', then y := alpha*A*x + beta*y
If trans= 'T' or 't', then y := alpha*A'*x + beta*y
If trans= 'C' or 'c', then y := alpha *conjg(A')*x + beta*y
m INTEGER. Specifies the number of rows of the matrix A.
The value of m must be at least zero.
n INTEGER. Specifies the number of columns of the matrix A.
The value of n must be at least zero.
kl INTEGER. Specifies the number of sub-diagonals of the matrix A.
The value of kl must satisfy 0 = kl.
ku INTEGER. Specifies the number of super-diagonals of the matrix A.
The value of ku must satisfy 0 = ku.
BLAS and Sparse BLAS Routines 2
75
alpha REAL for sgbmv
DOUBLE PRECISION for dgbmv
COMPLEX for cgbmv
DOUBLE COMPLEX for zgbmv
Specifies the scalar alpha.
a REAL for sgbmv
DOUBLE PRECISION for dgbmv
COMPLEX for cgbmv
DOUBLE COMPLEX for zgbmv
Array, DIMENSION (lda, n).
Before entry, the leading (kl + ku + 1) by n part of the array a must
contain the matrix of coefficients. This matrix must be supplied column-bycolumn,
with the leading diagonal of the matrix in row (ku + 1) of the
array, the first super-diagonal starting at position 2 in row ku, the first subdiagonal
starting at position 1 in row (ku + 2), and so on. Elements in the
array a that do not correspond to elements in the band matrix (such as the
top left ku by ku triangle) are not referenced.
The following program segment transfers a band matrix from conventional
full matrix storage to band storage:
do 20, j = 1, n
k = ku + 1 - j
do 10, i = max(1, j-ku), min(m, j+kl)
a(k+i, j) = matrix(i,j)
10 continue
20 continue
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least (kl + ku + 1).
x REAL for sgbmv
DOUBLE PRECISION for dgbmv
COMPLEX for cgbmv
DOUBLE COMPLEX for zgbmv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)) when trans = 'N'
or 'n', and at least (1 + (m - 1)*abs(incx)) otherwise. Before entry,
the array x must contain the vector x.
incx INTEGER. Specifies the increment for the elements of x. incx must not be
zero.
beta REAL for sgbmv
DOUBLE PRECISION for dgbmv
COMPLEX for cgbmv
DOUBLE COMPLEX for zgbmv
Specifies the scalar beta. When beta is equal to zero, then y need not be
set on input.
y REAL for sgbmv
DOUBLE PRECISION for dgbmv
COMPLEX for cgbmv
DOUBLE COMPLEX for zgbmv
Array, DIMENSION at least (1 +(m - 1)*abs(incy)) when trans = 'N'
or 'n' and at least (1 +(n - 1)*abs(incy)) otherwise. Before entry, the
incremented array y must contain the vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
2 Intel® Math Kernel Library Reference Manual
76
Output Parameters
y Updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gbmv interface are the following:
a Holds the array a of size (kl+ku+1, n). Contains a banded matrix m*nwith
kl lower diagonal and ku upper diagonal.
x Holds the vector with the number of elements rx, where rx = n if trans =
'N',rx = m otherwise.
y Holds the vector with the number of elements ry, where ry = m if trans =
'N',ry = n otherwise.
trans Must be 'N', 'C', or 'T'.
The default value is 'N'.
kl If omitted, assumed kl = ku, that is, the number of lower diagonals equals
the number of the upper diagonals.
ku Restored as ku = lda-kl-1, where lda is the leading dimension of matrix
A.
m If omitted, assumed m = n, that is, a square matrix.
alpha The default value is 1.
beta The default value is 0.
?gemv
Computes a matrix-vector product using a general
matrix
Syntax
Fortran 77:
call sgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
call dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
call cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
call zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
call scgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
call dzgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
Fortran 95:
call gemv(a, x, y [,alpha][,beta] [,trans])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
BLAS and Sparse BLAS Routines 2
77
Description
The ?gemv routines perform a matrix-vector operation defined as
y := alpha*A*x + beta*y,
or
y := alpha*A'*x + beta*y,
or
y := alpha*conjg(A')*x + beta*y,
where:
alpha and beta are scalars,
x and y are vectors,
A is an m-by-n matrix.
Input Parameters
trans CHARACTER*1. Specifies the operation:
if trans= 'N' or 'n', then y := alpha*A*x + beta*y;
if trans= 'T' or 't', then y := alpha*A'*x + beta*y;
if trans= 'C' or 'c', then y := alpha *conjg(A')*x + beta*y.
m INTEGER. Specifies the number of rows of the matrix A. The value of m must
be at least zero.
n INTEGER. Specifies the number of columns of the matrix A. The value of n
must be at least zero.
alpha REAL for sgemv
DOUBLE PRECISION for dgemv
COMPLEX for cgemv, scgemv
DOUBLE COMPLEX for zgemv, dzgemv
Specifies the scalar alpha.
a REAL for sgemv, scgemv
DOUBLE PRECISION for dgemv, dzgemv
COMPLEX for cgemv
DOUBLE COMPLEX for zgemv
Array, DIMENSION (lda, n). Before entry, the leading m-by-n part of the
array a must contain the matrix of coefficients.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, m).
x REAL for sgemv
DOUBLE PRECISION for dgemv
COMPLEX for cgemv, scgemv
DOUBLE COMPLEX for zgemv, dzgemv
Array, DIMENSION at least (1+(n-1)*abs(incx)) when trans = 'N' or
'n' and at least (1+(m - 1)*abs(incx)) otherwise. Before entry, the
incremented array x must contain the vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
beta REAL for sgemv
DOUBLE PRECISION for dgemv
COMPLEX for cgemv, scgemv
2 Intel® Math Kernel Library Reference Manual
78
DOUBLE COMPLEX for zgemv, dzgemv
Specifies the scalar beta. When beta is set to zero, then y need not be set
on input.
y REAL for sgemv
DOUBLE PRECISION for dgemv
COMPLEX for cgemv, scgemv
DOUBLE COMPLEX for zgemv, dzgemv
Array, DIMENSION at least (1 +(m - 1)*abs(incy)) when trans = 'N'
or 'n' and at least (1 +(n - 1)*abs(incy)) otherwise. Before entry with
non-zero beta, the incremented array y must contain the vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
Output Parameters
y Updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gemv interface are the following:
a Holds the matrix A of size (m,n).
x Holds the vector with the number of elements rx where rx = n if trans =
'N', rx = m otherwise.
y Holds the vector with the number of elements ry where ry = m if trans =
'N', ry = n otherwise.
trans Must be 'N', 'C', or 'T'.
The default value is 'N'.
alpha The default value is 1.
beta The default value is 0.
?ger
Performs a rank-1 update of a general matrix.
Syntax
Fortran 77:
call sger(m, n, alpha, x, incx, y, incy, a, lda)
call dger(m, n, alpha, x, incx, y, incy, a, lda)
Fortran 95:
call ger(a, x, y [,alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
BLAS and Sparse BLAS Routines 2
79
Description
The ?ger routines perform a matrix-vector operation defined as
A := alpha*x*y'+ A,
where:
alpha is a scalar,
x is an m-element vector,
y is an n-element vector,
A is an m-by-n general matrix.
Input Parameters
m INTEGER. Specifies the number of rows of the matrix A.
The value of m must be at least zero.
n INTEGER. Specifies the number of columns of the matrix A.
The value of n must be at least zero.
alpha REAL for sger
DOUBLE PRECISION for dger
Specifies the scalar alpha.
x REAL for sger
DOUBLE PRECISION for dger
Array, DIMENSION at least (1 + (m - 1)*abs(incx)). Before entry, the
incremented array x must contain the m-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
y REAL for sger
DOUBLE PRECISION for dger
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
a REAL for sger
DOUBLE PRECISION for dger
Array, DIMENSION (lda, n).
Before entry, the leading m-by-n part of the array a must contain the matrix
of coefficients.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, m).
Output Parameters
a Overwritten by the updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine ger interface are the following:
a Holds the matrix A of size (m,n).
2 Intel® Math Kernel Library Reference Manual
80
x Holds the vector with the number of elements m.
y Holds the vector with the number of elements n.
alpha The default value is 1.
?gerc
Performs a rank-1 update (conjugated) of a general
matrix.
Syntax
Fortran 77:
call cgerc(m, n, alpha, x, incx, y, incy, a, lda)
call zgerc(m, n, alpha, x, incx, y, incy, a, lda)
Fortran 95:
call gerc(a, x, y [,alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?gerc routines perform a matrix-vector operation defined as
A := alpha*x*conjg(y') + A,
where:
alpha is a scalar,
x is an m-element vector,
y is an n-element vector,
A is an m-by-n matrix.
Input Parameters
m INTEGER. Specifies the number of rows of the matrix A.
The value of m must be at least zero.
n INTEGER. Specifies the number of columns of the matrix A.
The value of n must be at least zero.
alpha COMPLEX for cgerc
DOUBLE COMPLEX for zgerc
Specifies the scalar alpha.
x COMPLEX for cgerc
DOUBLE COMPLEX for zgerc
Array, DIMENSION at least (1 + (m - 1)*abs(incx)). Before entry, the
incremented array x must contain the m-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
y COMPLEX for cgerc
BLAS and Sparse BLAS Routines 2
81
DOUBLE COMPLEX for zgerc
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
a COMPLEX for cgerc
DOUBLE COMPLEX for zgerc
Array, DIMENSION (lda, n).
Before entry, the leading m-by-n part of the array a must contain the matrix
of coefficients.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, m).
Output Parameters
a Overwritten by the updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gerc interface are the following:
a Holds the matrix A of size (m,n).
x Holds the vector with the number of elements m.
y Holds the vector with the number of elements n.
alpha The default value is 1.
?geru
Performs a rank-1 update (unconjugated) of a general
matrix.
Syntax
Fortran 77:
call cgeru(m, n, alpha, x, incx, y, incy, a, lda)
call zgeru(m, n, alpha, x, incx, y, incy, a, lda)
Fortran 95:
call geru(a, x, y [,alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?geru routines perform a matrix-vector operation defined as
A := alpha*x*y ' + A,
where:
2 Intel® Math Kernel Library Reference Manual
82
alpha is a scalar,
x is an m-element vector,
y is an n-element vector,
A is an m-by-n matrix.
Input Parameters
m INTEGER. Specifies the number of rows of the matrix A.
The value of m must be at least zero.
n INTEGER. Specifies the number of columns of the matrix A.
The value of n must be at least zero.
alpha COMPLEX for cgeru
DOUBLE COMPLEX for zgeru
Specifies the scalar alpha.
x COMPLEX for cgeru
DOUBLE COMPLEX for zgeru
Array, DIMENSION at least (1 + (m - 1)*abs(incx)). Before entry, the
incremented array x must contain the m-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
y COMPLEX for cgeru
DOUBLE COMPLEX for zgeru
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
a COMPLEX for cgeru
DOUBLE COMPLEX for zgeru
Array, DIMENSION (lda, n).
Before entry, the leading m-by-n part of the array a must contain the matrix
of coefficients.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, m).
Output Parameters
a Overwritten by the updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine geru interface are the following:
a Holds the matrix A of size (m,n).
x Holds the vector with the number of elements m.
y Holds the vector with the number of elements n.
alpha The default value is 1.
BLAS and Sparse BLAS Routines 2
83
?hbmv
Computes a matrix-vector product using a Hermitian
band matrix.
Syntax
Fortran 77:
call chbmv(uplo, n, k, alpha, a, lda, x, incx, beta, y, incy)
call zhbmv(uplo, n, k, alpha, a, lda, x, incx, beta, y, incy)
Fortran 95:
call hbmv(a, x, y [,uplo][,alpha] [,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?hbmv routines perform a matrix-vector operation defined as y := alpha*A*x + beta*y,
where:
alpha and beta are scalars,
x and y are n-element vectors,
A is an n-by-n Hermitian band matrix, with k super-diagonals.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
Hermitian band matrix A is used:
If uplo = 'U' or 'u', then the upper triangular part of the matrix A is
used.
If uplo = 'L' or 'l', then the low triangular part of the matrix A is used.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
k INTEGER. Specifies the number of super-diagonals of the matrix A.
The value of k must satisfy 0 = k.
alpha COMPLEX for chbmv
DOUBLE COMPLEX for zhbmv
Specifies the scalar alpha.
a COMPLEX for chbmv
DOUBLE COMPLEX for zhbmv
Array, DIMENSION (lda, n).
Before entry with uplo = 'U' or 'u', the leading (k + 1) by n part of the
array a must contain the upper triangular band part of the Hermitian
matrix. The matrix must be supplied column-by-column, with the leading
diagonal of the matrix in row (k + 1) of the array, the first super-diagonal
starting at position 2 in row k, and so on. The top left k by k triangle of the
array a is not referenced.
2 Intel® Math Kernel Library Reference Manual
84
The following program segment transfers the upper triangular part of a
Hermitian band matrix from conventional full matrix storage to band
storage:
do 20, j = 1, n
m = k + 1 - j
do 10, i = max(1, j - k), j
a(m + i, j) = matrix(i, j)
10 continue
20 continue
Before entry with uplo = 'L' or 'l', the leading (k + 1) by n part of the
array a must contain the lower triangular band part of the Hermitian matrix,
supplied column-by-column, with the leading diagonal of the matrix in row
1 of the array, the first sub-diagonal starting at position 1 in row 2, and so
on. The bottom right k by k triangle of the array a is not referenced.
The following program segment transfers the lower triangular part of a
Hermitian band matrix from conventional full matrix storage to band
storage:
do 20, j = 1, n
m = 1 - j
do 10, i = j, min( n, j + k )
a( m + i, j ) = matrix( i, j )
10 continue
20 continue
The imaginary parts of the diagonal elements need not be set and are
assumed to be zero.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least (k + 1).
x COMPLEX for chbmv
DOUBLE COMPLEX for zhbmv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
beta COMPLEX for chbmv
DOUBLE COMPLEX for zhbmv
Specifies the scalar beta.
y COMPLEX for chbmv
DOUBLE COMPLEX for zhbmv
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
Output Parameters
y Overwritten by the updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hbmv interface are the following:
a Holds the array a of size (k+1,n).
BLAS and Sparse BLAS Routines 2
85
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
beta The default value is 0.
?hemv
Computes a matrix-vector product using a Hermitian
matrix.
Syntax
Fortran 77:
call chemv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
call zhemv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
Fortran 95:
call hemv(a, x, y [,uplo][,alpha] [,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?hemv routines perform a matrix-vector operation defined as
y := alpha*A*x + beta*y,
where:
alpha and beta are scalars,
x and y are n-element vectors,
A is an n-by-n Hermitian matrix.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array a is used.
If uplo = 'U' or 'u', then the upper triangular of the array a is used.
If uplo = 'L' or 'l', then the low triangular of the array a is used.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha COMPLEX for chemv
DOUBLE COMPLEX for zhemv
Specifies the scalar alpha.
a COMPLEX for chemv
DOUBLE COMPLEX for zhemv
Array, DIMENSION (lda, n).
2 Intel® Math Kernel Library Reference Manual
86
Before entry with uplo = 'U' or 'u', the leading n-by-n upper triangular
part of the array a must contain the upper triangular part of the Hermitian
matrix and the strictly lower triangular part of a is not referenced. Before
entry with uplo = 'L' or 'l', the leading n-by-n lower triangular part of
the array a must contain the lower triangular part of the Hermitian matrix
and the strictly upper triangular part of a is not referenced.
The imaginary parts of the diagonal elements need not be set and are
assumed to be zero.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, n).
x COMPLEX for chemv
DOUBLE COMPLEX for zhemv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
beta COMPLEX for chemv
DOUBLE COMPLEX for zhemv
Specifies the scalar beta. When beta is supplied as zero then y need not be
set on input.
y COMPLEX for chemv
DOUBLE COMPLEX for zhemv
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
Output Parameters
y Overwritten by the updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hemv interface are the following:
a Holds the matrix A of size (n,n).
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
beta The default value is 0.
?her
Performs a rank-1 update of a Hermitian matrix.
Syntax
Fortran 77:
call cher(uplo, n, alpha, x, incx, a, lda)
BLAS and Sparse BLAS Routines 2
87
call zher(uplo, n, alpha, x, incx, a, lda)
Fortran 95:
call her(a, x [,uplo] [, alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?her routines perform a matrix-vector operation defined as
A := alpha*x*conjg(x') + A,
where:
alpha is a real scalar,
x is an n-element vector,
A is an n-by-n Hermitian matrix.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array a is used.
If uplo = 'U' or 'u', then the upper triangular of the array a is used.
If uplo = 'L' or 'l', then the low triangular of the array a is used.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha REAL for cher
DOUBLE PRECISION for zher
Specifies the scalar alpha.
x COMPLEX for cher
DOUBLE COMPLEX for zher
Array, dimension at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
a COMPLEX for cher
DOUBLE COMPLEX for zher
Array, DIMENSION (lda, n).
Before entry with uplo = 'U' or 'u', the leading n-by-n upper triangular
part of the array a must contain the upper triangular part of the Hermitian
matrix and the strictly lower triangular part of a is not referenced.
Before entry with uplo = 'L' or 'l', the leading n-by-n lower triangular
part of the array a must contain the lower triangular part of the Hermitian
matrix and the strictly upper triangular part of a is not referenced.
The imaginary parts of the diagonal elements need not be set and are
assumed to be zero.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, n).
2 Intel® Math Kernel Library Reference Manual
88
Output Parameters
a With uplo = 'U' or 'u', the upper triangular part of the array a is
overwritten by the upper triangular part of the updated matrix.
With uplo = 'L' or 'l', the lower triangular part of the array a is
overwritten by the lower triangular part of the updated matrix.
The imaginary parts of the diagonal elements are set to zero.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine her interface are the following:
a Holds the matrix A of size (n,n).
x Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
?her2
Performs a rank-2 update of a Hermitian matrix.
Syntax
Fortran 77:
call cher2(uplo, n, alpha, x, incx, y, incy, a, lda)
call zher2(uplo, n, alpha, x, incx, y, incy, a, lda)
Fortran 95:
call her2(a, x, y [,uplo][,alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?her2 routines perform a matrix-vector operation defined as
A := alpha *x*conjg(y') + conjg(alpha)*y *conjg(x') + A,
where:
alpha is a scalar,
x and y are n-element vectors,
A is an n-by-n Hermitian matrix.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array a is used.
If uplo = 'U' or 'u', then the upper triangular of the array a is used.
BLAS and Sparse BLAS Routines 2
89
If uplo = 'L' or 'l', then the low triangular of the array a is used.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha COMPLEX for cher2
DOUBLE COMPLEX for zher2
Specifies the scalar alpha.
x COMPLEX for cher2
DOUBLE COMPLEX for zher2
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
y COMPLEX for cher2
DOUBLE COMPLEX for zher2
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
a COMPLEX for cher2
DOUBLE COMPLEX for zher2
Array, DIMENSION (lda, n).
Before entry with uplo = 'U' or 'u', the leading n-by-n upper triangular
part of the array a must contain the upper triangular part of the Hermitian
matrix and the strictly lower triangular part of a is not referenced.
Before entry with uplo = 'L' or 'l', the leading n-by-n lower triangular
part of the array a must contain the lower triangular part of the Hermitian
matrix and the strictly upper triangular part of a is not referenced.
The imaginary parts of the diagonal elements need not be set and are
assumed to be zero.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, n).
Output Parameters
a With uplo = 'U' or 'u', the upper triangular part of the array a is
overwritten by the upper triangular part of the updated matrix.
With uplo = 'L' or 'l', the lower triangular part of the array a is
overwritten by the lower triangular part of the updated matrix.
The imaginary parts of the diagonal elements are set to zero.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine her2 interface are the following:
a Holds the matrix A of size (n,n).
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
2 Intel® Math Kernel Library Reference Manual
90
?hpmv
Computes a matrix-vector product using a Hermitian
packed matrix.
Syntax
Fortran 77:
call chpmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
call zhpmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
Fortran 95:
call hpmv(ap, x, y [,uplo][,alpha] [,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?hpmv routines perform a matrix-vector operation defined as
y := alpha*A*x + beta*y,
where:
alpha and beta are scalars,
x and y are n-element vectors,
A is an n-by-n Hermitian matrix, supplied in packed form.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
matrix A is supplied in the packed array ap.
If uplo = 'U' or 'u', then the upper triangular part of the matrix A is
supplied in the packed array ap .
If uplo = 'L' or 'l', then the low triangular part of the matrix A is
supplied in the packed array ap .
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha COMPLEX for chpmv
DOUBLE COMPLEX for zhpmv
Specifies the scalar alpha.
ap COMPLEX for chpmv
DOUBLE COMPLEX for zhpmv
Array, DIMENSION at least ((n*(n + 1))/2). Before entry with uplo =
'U' or 'u', the array ap must contain the upper triangular part of the
Hermitian matrix packed sequentially, column-by-column, so that ap(1)
contains a(1, 1), ap(2) and ap(3) contain a(1, 2) and a(2, 2)
respectively, and so on. Before entry with uplo = 'L' or 'l', the array ap
must contain the lower triangular part of the Hermitian matrix packed
sequentially, column-by-column, so that ap(1) contains a(1, 1), ap(2)
and ap(3) contain a(2, 1) and a(3, 1) respectively, and so on.
BLAS and Sparse BLAS Routines 2
91
The imaginary parts of the diagonal elements need not be set and are
assumed to be zero.
x COMPLEX for chpmv
DOUBLE PRECISION COMPLEX for zhpmv
Array, DIMENSION at least (1 +(n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
beta COMPLEX for chpmv
DOUBLE COMPLEX for zhpmv
Specifies the scalar beta.
When beta is equal to zero then y need not be set on input.
y COMPLEX for chpmv
DOUBLE COMPLEX for zhpmv
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
Output Parameters
y Overwritten by the updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hpmv interface are the following:
ap Holds the array ap of size (n*(n+1)/2).
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
beta The default value is 0.
?hpr
Performs a rank-1 update of a Hermitian packed
matrix.
Syntax
Fortran 77:
call chpr(uplo, n, alpha, x, incx, ap)
call zhpr(uplo, n, alpha, x, incx, ap)
Fortran 95:
call hpr(ap, x [,uplo] [, alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
2 Intel® Math Kernel Library Reference Manual
92
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?hpr routines perform a matrix-vector operation defined as
A := alpha*x*conjg(x') + A,
where:
alpha is a real scalar,
x is an n-element vector,
A is an n-by-n Hermitian matrix, supplied in packed form.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
matrix A is supplied in the packed array ap.
If uplo = 'U' or 'u', the upper triangular part of the matrix A is supplied
in the packed array ap .
If uplo = 'L' or 'l', the low triangular part of the matrix A is supplied in
the packed array ap .
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha REAL for chpr
DOUBLE PRECISION for zhpr
Specifies the scalar alpha.
x COMPLEX for chpr
DOUBLE COMPLEX for zhpr
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x. incx must not be
zero.
ap COMPLEX for chpr
DOUBLE COMPLEX for zhpr
Array, DIMENSION at least ((n*(n + 1))/2). Before entry with uplo =
'U' or 'u', the array ap must contain the upper triangular part of the
Hermitian matrix packed sequentially, column-by-column, so that ap(1)
contains a(1, 1), ap(2) and ap(3) contain a(1, 2) and a(2, 2)
respectively, and so on.
Before entry with uplo = 'L' or 'l', the array ap must contain the lower
triangular part of the Hermitian matrix packed sequentially, column-bycolumn,
so that ap(1) contains a(1, 1), ap(2) and ap(3) contain a(2,
1) and a(3, 1) respectively, and so on.
The imaginary parts of the diagonal elements need not be set and are
assumed to be zero.
Output Parameters
ap With uplo = 'U' or 'u', overwritten by the upper triangular part of the
updated matrix.
With uplo = 'L' or 'l', overwritten by the lower triangular part of the
updated matrix.
The imaginary parts of the diagonal elements are set to zero.
BLAS and Sparse BLAS Routines 2
93
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hpr interface are the following:
ap Holds the array ap of size (n*(n+1)/2).
x Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
?hpr2
Performs a rank-2 update of a Hermitian packed
matrix.
Syntax
Fortran 77:
call chpr2(uplo, n, alpha, x, incx, y, incy, ap)
call zhpr2(uplo, n, alpha, x, incx, y, incy, ap)
Fortran 95:
call hpr2(ap, x, y [,uplo][,alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?hpr2 routines perform a matrix-vector operation defined as
A := alpha*x*conjg(y') + conjg(alpha)*y*conjg(x') + A,
where:
alpha is a scalar,
x and y are n-element vectors,
A is an n-by-n Hermitian matrix, supplied in packed form.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
matrix A is supplied in the packed array ap.
If uplo = 'U' or 'u', then the upper triangular part of the matrix A is
supplied in the packed array ap .
If uplo = 'L' or 'l', then the low triangular part of the matrix A is
supplied in the packed array ap .
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha COMPLEX for chpr2
2 Intel® Math Kernel Library Reference Manual
94
DOUBLE COMPLEX for zhpr2
Specifies the scalar alpha.
x COMPLEX for chpr2
DOUBLE COMPLEX for zhpr2
Array, dimension at least (1 +(n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
y COMPLEX for chpr2
DOUBLE COMPLEX for zhpr2
Array, DIMENSION at least (1 +(n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
ap COMPLEX for chpr2
DOUBLE COMPLEX for zhpr2
Array, DIMENSION at least ((n*(n + 1))/2). Before entry with uplo =
'U' or 'u', the array ap must contain the upper triangular part of the
Hermitian matrix packed sequentially, column-by-column, so that ap(1)
contains a(1,1), ap(2) and ap(3) contain a(1,2) and a(2,2)
respectively, and so on.
Before entry with uplo = 'L' or 'l', the array ap must contain the lower
triangular part of the Hermitian matrix packed sequentially, column-bycolumn,
so that ap(1) contains a(1,1), ap(2) and ap(3) contain a(2,1)
and a(3,1) respectively, and so on.
The imaginary parts of the diagonal elements need not be set and are
assumed to be zero.
Output Parameters
ap With uplo = 'U' or 'u', overwritten by the upper triangular part of the
updated matrix.
With uplo = 'L' or 'l', overwritten by the lower triangular part of the
updated matrix.
The imaginary parts of the diagonal elements need are set to zero.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hpr2 interface are the following:
ap Holds the array ap of size (n*(n+1)/2).
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
?sbmv
Computes a matrix-vector product using a symmetric
band matrix.
BLAS and Sparse BLAS Routines 2
95
Syntax
Fortran 77:
call ssbmv(uplo, n, k, alpha, a, lda, x, incx, beta, y, incy)
call dsbmv(uplo, n, k, alpha, a, lda, x, incx, beta, y, incy)
Fortran 95:
call sbmv(a, x, y [,uplo][,alpha] [,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?sbmv routines perform a matrix-vector operation defined as
y := alpha*A*x + beta*y,
where:
alpha and beta are scalars,
x and y are n-element vectors,
A is an n-by-n symmetric band matrix, with k super-diagonals.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
band matrix A is used:
if uplo = 'U' or 'u' - upper triangular part;
if uplo = 'L' or 'l' - low triangular part.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
k INTEGER. Specifies the number of super-diagonals of the matrix A.
The value of k must satisfy 0 = k.
alpha REAL for ssbmv
DOUBLE PRECISION for dsbmv
Specifies the scalar alpha.
a REAL for ssbmv
DOUBLE PRECISION for dsbmv
Array, DIMENSION (lda, n). Before entry with uplo = 'U' or 'u', the
leading (k + 1) by n part of the array a must contain the upper triangular
band part of the symmetric matrix, supplied column-by-column, with the
leading diagonal of the matrix in row (k + 1) of the array, the first superdiagonal
starting at position 2 in row k, and so on. The top left k by k
triangle of the array a is not referenced.
The following program segment transfers the upper triangular part of a
symmetric band matrix from conventional full matrix storage to band
storage:
do 20, j = 1, n
m = k + 1 - j
do 10, i = max( 1, j - k ), j
2 Intel® Math Kernel Library Reference Manual
96
a( m + i, j ) = matrix( i, j )
10 continue
20 continue
Before entry with uplo = 'L' or 'l', the leading (k + 1) by n part of the
array a must contain the lower triangular band part of the symmetric
matrix, supplied column-by-column, with the leading diagonal of the matrix
in row 1 of the array, the first sub-diagonal starting at position 1 in row 2,
and so on. The bottom right k by k triangle of the array a is not referenced.
The following program segment transfers the lower triangular part of a
symmetric band matrix from conventional full matrix storage to band
storage:
do 20, j = 1, n
m = 1 - j
do 10, i = j, min( n, j + k )
a( m + i, j ) = matrix( i, j )
10 continue
20 continue
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least (k + 1).
x REAL for ssbmv
DOUBLE PRECISION for dsbmv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
beta REAL for ssbmv
DOUBLE PRECISION for dsbmv
Specifies the scalar beta.
y REAL for ssbmv
DOUBLE PRECISION for dsbmv
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
Output Parameters
y Overwritten by the updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sbmv interface are the following:
a Holds the array a of size (k+1,n).
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
beta The default value is 0.
BLAS and Sparse BLAS Routines 2
97
?spmv
Computes a matrix-vector product using a symmetric
packed matrix.
Syntax
Fortran 77:
call sspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
call dspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
Fortran 95:
call spmv(ap, x, y [,uplo][,alpha] [,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?spmv routines perform a matrix-vector operation defined as
y := alpha*A*x + beta*y,
where:
alpha and beta are scalars,
x and y are n-element vectors,
A is an n-by-n symmetric matrix, supplied in packed form.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
matrix A is supplied in the packed array ap.
If uplo = 'U' or 'u', then the upper triangular part of the matrix A is
supplied in the packed array ap .
If uplo = 'L' or 'l', then the low triangular part of the matrix A is
supplied in the packed array ap .
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha REAL for sspmv
DOUBLE PRECISION for dspmv
Specifies the scalar alpha.
ap REAL for sspmv
DOUBLE PRECISION for dspmv
Array, DIMENSION at least ((n*(n + 1))/2).
Before entry with uplo = 'U' or 'u', the array ap must contain the upper
triangular part of the symmetric matrix packed sequentially, column-bycolumn,
so that ap(1) contains a(1,1), ap(2) and ap(3) contain a(1,2)
and a(2, 2) respectively, and so on. Before entry with uplo = 'L' or
'l', the array ap must contain the lower triangular part of the symmetric
2 Intel® Math Kernel Library Reference Manual
98
matrix packed sequentially, column-by-column, so that ap(1) contains
a(1,1), ap(2) and ap(3) contain a(2,1) and a(3,1) respectively, and so
on.
x REAL for sspmv
DOUBLE PRECISION for dspmv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
beta REAL for sspmv
DOUBLE PRECISION for dspmv
Specifies the scalar beta.
When beta is supplied as zero, then y need not be set on input.
y REAL for sspmv
DOUBLE PRECISION for dspmv
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
Output Parameters
y Overwritten by the updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine spmv interface are the following:
ap Holds the array ap of size (n*(n+1)/2).
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
beta The default value is 0.
?spr
Performs a rank-1 update of a symmetric packed
matrix.
Syntax
Fortran 77:
call sspr(uplo, n, alpha, x, incx, ap)
call dspr(uplo, n, alpha, x, incx, ap)
Fortran 95:
call spr(ap, x [,uplo] [, alpha])
BLAS and Sparse BLAS Routines 2
99
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?spr routines perform a matrix-vector operation defined as
a:= alpha*x*x'+ A,
where:
alpha is a real scalar,
x is an n-element vector,
A is an n-by-n symmetric matrix, supplied in packed form.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
matrix A is supplied in the packed array ap.
If uplo = 'U' or 'u', then the upper triangular part of the matrix A is
supplied in the packed array ap .
If uplo = 'L' or 'l', then the low triangular part of the matrix A is
supplied in the packed array ap .
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha REAL for sspr
DOUBLE PRECISION for dspr
Specifies the scalar alpha.
x REAL for sspr
DOUBLE PRECISION for dspr
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
ap REAL for sspr
DOUBLE PRECISION for dspr
Array, DIMENSION at least ((n*(n + 1))/2). Before entry with uplo =
'U' or 'u', the array ap must contain the upper triangular part of the
symmetric matrix packed sequentially, column-by-column, so that ap(1)
contains a(1,1), ap(2) and ap(3) contain a(1,2) and a(2,2)
respectively, and so on.
Before entry with uplo = 'L' or 'l', the array ap must contain the lower
triangular part of the symmetric matrix packed sequentially, column-bycolumn,
so that ap(1) contains a(1,1), ap(2) and ap(3) contain a(2,1)
and a(3,1) respectively, and so on.
Output Parameters
ap With uplo = 'U' or 'u', overwritten by the upper triangular part of the
updated matrix.
2 Intel® Math Kernel Library Reference Manual
100
With uplo = 'L' or 'l', overwritten by the lower triangular part of the
updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine spr interface are the following:
ap Holds the array ap of size (n*(n+1)/2).
x Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
?spr2
Performs a rank-2 update of a symmetric packed
matrix.
Syntax
Fortran 77:
call sspr2(uplo, n, alpha, x, incx, y, incy, ap)
call dspr2(uplo, n, alpha, x, incx, y, incy, ap)
Fortran 95:
call spr2(ap, x, y [,uplo][,alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?spr2 routines perform a matrix-vector operation defined as
A:= alpha*x*y'+ alpha*y*x' + A,
where:
alpha is a scalar,
x and y are n-element vectors,
A is an n-by-n symmetric matrix, supplied in packed form.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
matrix A is supplied in the packed array ap.
If uplo = 'U' or 'u', then the upper triangular part of the matrix A is
supplied in the packed array ap .
If uplo = 'L' or 'l', then the low triangular part of the matrix A is
supplied in the packed array ap .
BLAS and Sparse BLAS Routines 2
101
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha REAL for sspr2
DOUBLE PRECISION for dspr2
Specifies the scalar alpha.
x REAL for sspr2
DOUBLE PRECISION for dspr2
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
y REAL for sspr2
DOUBLE PRECISION for dspr2
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y. The value of incy
must not be zero.
ap REAL for sspr2
DOUBLE PRECISION for dspr2
Array, DIMENSION at least ((n*(n + 1))/2). Before entry with uplo =
'U' or 'u', the array ap must contain the upper triangular part of the
symmetric matrix packed sequentially, column-by-column, so that ap(1)
contains a(1,1), ap(2) and ap(3) contain a(1,2) and a(2,2)
respectively, and so on.
Before entry with uplo = 'L' or 'l', the array ap must contain the lower
triangular part of the symmetric matrix packed sequentially, column-bycolumn,
so that ap(1) contains a(1,1), ap(2) and ap(3) contain a (2,1)
and a(3,1) respectively, and so on.
Output Parameters
ap With uplo = 'U' or 'u', overwritten by the upper triangular part of the
updated matrix.
With uplo = 'L' or 'l', overwritten by the lower triangular part of the
updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine spr2 interface are the following:
ap Holds the array ap of size (n*(n+1)/2).
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
?symv
Computes a matrix-vector product for a symmetric
matrix.
2 Intel® Math Kernel Library Reference Manual
102
Syntax
Fortran 77:
call ssymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
call dsymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
Fortran 95:
call symv(a, x, y [,uplo][,alpha] [,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?symv routines perform a matrix-vector operation defined as
y := alpha*A*x + beta*y,
where:
alpha and beta are scalars,
x and y are n-element vectors,
A is an n-by-n symmetric matrix.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array a is used.
If uplo = 'U' or 'u', then the upper triangular part of the array a is used.
If uplo = 'L' or 'l', then the low triangular part of the array a is used.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha REAL for ssymv
DOUBLE PRECISION for dsymv
Specifies the scalar alpha.
a REAL for ssymv
DOUBLE PRECISION for dsymv
Array, DIMENSION (lda, n).
Before entry with uplo = 'U' or 'u', the leading n-by-n upper triangular
part of the array a must contain the upper triangular part of the symmetric
matrix A and the strictly lower triangular part of a is not referenced. Before
entry with uplo = 'L' or 'l', the leading n-by-n lower triangular part of
the array a must contain the lower triangular part of the symmetric matrix
A and the strictly upper triangular part of a is not referenced.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, n).
x REAL for ssymv
DOUBLE PRECISION for dsymv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
BLAS and Sparse BLAS Routines 2
103
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
beta REAL for ssymv
DOUBLE PRECISION for dsymv
Specifies the scalar beta.
When beta is supplied as zero, then y need not be set on input.
y REAL for ssymv
DOUBLE PRECISION for dsymv
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y.
The value of incy must not be zero.
Output Parameters
y Overwritten by the updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine symv interface are the following:
a Holds the matrix A of size (n,n).
x Holds the vector with the number of elements n.
y Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
beta The default value is 0.
?syr
Performs a rank-1 update of a symmetric matrix.
Syntax
Fortran 77:
call ssyr(uplo, n, alpha, x, incx, a, lda)
call dsyr(uplo, n, alpha, x, incx, a, lda)
Fortran 95:
call syr(a, x [,uplo] [, alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?syr routines perform a matrix-vector operation defined as
A := alpha*x*x' + A ,
2 Intel® Math Kernel Library Reference Manual
104
where:
alpha is a real scalar,
x is an n-element vector,
A is an n-by-n symmetric matrix.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array a is used.
If uplo = 'U' or 'u', then the upper triangular part of the array a is used.
If uplo = 'L' or 'l', then the low triangular part of the array a is used.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha REAL for ssyr
DOUBLE PRECISION for dsyr
Specifies the scalar alpha.
x REAL for ssyr
DOUBLE PRECISION for dsyr
Array, DIMENSION at least (1 + (n-1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
a REAL for ssyr
DOUBLE PRECISION for dsyr
Array, DIMENSION (lda, n).
Before entry with uplo = 'U' or 'u', the leading n-by-n upper triangular
part of the array a must contain the upper triangular part of the symmetric
matrix A and the strictly lower triangular part of a is not referenced.
Before entry with uplo = 'L' or 'l', the leading n-by-n lower triangular
part of the array a must contain the lower triangular part of the symmetric
matrix A and the strictly upper triangular part of a is not referenced.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, n).
Output Parameters
a With uplo = 'U' or 'u', the upper triangular part of the array a is
overwritten by the upper triangular part of the updated matrix.
With uplo = 'L' or 'l', the lower triangular part of the array a is
overwritten by the lower triangular part of the updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine syr interface are the following:
a Holds the matrix A of size (n,n).
x Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
BLAS and Sparse BLAS Routines 2
105
?syr2
Performs a rank-2 update of symmetric matrix.
Syntax
Fortran 77:
call ssyr2(uplo, n, alpha, x, incx, y, incy, a, lda)
call dsyr2(uplo, n, alpha, x, incx, y, incy, a, lda)
Fortran 95:
call syr2(a, x, y [,uplo][,alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?syr2 routines perform a matrix-vector operation defined as
A := alpha*x*y'+ alpha*y*x' + A,
where:
alpha is a scalar,
x and y are n-element vectors,
A is an n-by-n symmetric matrix.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array a is used.
If uplo = 'U' or 'u', then the upper triangular part of the array a is used.
If uplo = 'L' or 'l', then the low triangular part of the array a is used.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
alpha REAL for ssyr2
DOUBLE PRECISION for dsyr2
Specifies the scalar alpha.
x REAL for ssyr2
DOUBLE PRECISION for dsyr2
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
y REAL for ssyr2
DOUBLE PRECISION for dsyr2
Array, DIMENSION at least (1 + (n - 1)*abs(incy)). Before entry, the
incremented array y must contain the n-element vector y.
incy INTEGER. Specifies the increment for the elements of y. The value of incy
must not be zero.
2 Intel® Math Kernel Library Reference Manual
106
a REAL for ssyr2
DOUBLE PRECISION for dsyr2
Array, DIMENSION (lda, n).
Before entry with uplo = 'U' or 'u', the leading n-by-n upper triangular
part of the array a must contain the upper triangular part of the symmetric
matrix and the strictly lower triangular part of a is not referenced.
Before entry with uplo = 'L' or 'l', the leading n-by-n lower triangular
part of the array a must contain the lower triangular part of the symmetric
matrix and the strictly upper triangular part of a is not referenced.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, n).
Output Parameters
a With uplo = 'U' or 'u', the upper triangular part of the array a is
overwritten by the upper triangular part of the updated matrix.
With uplo = 'L' or 'l', the lower triangular part of the array a is
overwritten by the lower triangular part of the updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine syr2 interface are the following:
a Holds the matrix A of size (n,n).
x Holds the vector x of length n.
y Holds the vector y of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
?tbmv
Computes a matrix-vector product using a triangular
band matrix.
Syntax
Fortran 77:
call stbmv(uplo, trans, diag, n, k, a, lda, x, incx)
call dtbmv(uplo, trans, diag, n, k, a, lda, x, incx)
call ctbmv(uplo, trans, diag, n, k, a, lda, x, incx)
call ztbmv(uplo, trans, diag, n, k, a, lda, x, incx)
Fortran 95:
call tbmv(a, x [,uplo] [, trans] [,diag])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
BLAS and Sparse BLAS Routines 2
107
Description
The ?tbmv routines perform one of the matrix-vector operations defined as
x := A*x, or x := A'*x, or x := conjg(A')*x,
where:
x is an n-element vector,
A is an n-by-n unit, or non-unit, upper or lower triangular band matrix, with (k +1) diagonals.
Input Parameters
uplo CHARACTER*1. Specifies whether the matrix A is an upper or lower
triangular matrix:
if uplo = 'U' or 'u', then the matrix is upper triangular;
if uplo = 'L' or 'l', then the matrix is low triangular.
trans CHARACTER*1. Specifies the operation:
if trans = 'N' or 'n', then x := A*x;
if trans = 'T' or 't', then x := A'*x;
if trans = 'C' or 'c', then x := conjg(A')*x.
diag CHARACTER*1. Specifies whether the matrix A is unit triangular:
if diag = 'U' or 'u' then the matrix is unit triangular;
if diag = 'N' or 'n', then the matrix is not unit triangular.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
k INTEGER. On entry with uplo = 'U' or 'u', k specifies the number of
super-diagonals of the matrix A. On entry with uplo = 'L' or 'l', k
specifies the number of sub-diagonals of the matrix a.
The value of k must satisfy 0 = k.
a REAL for stbmv
DOUBLE PRECISION for dtbmv
COMPLEX for ctbmv
DOUBLE COMPLEX for ztbmv
Array, DIMENSION (lda, n).
Before entry with uplo = 'U' or 'u', the leading (k + 1) by n part of the
array a must contain the upper triangular band part of the matrix of
coefficients, supplied column-by-column, with the leading diagonal of the
matrix in row (k + 1) of the array, the first super-diagonal starting at
position 2 in row k, and so on. The top left k by k triangle of the array a is
not referenced. The following program segment transfers an upper
triangular band matrix from conventional full matrix storage to band
storage:
do 20, j = 1, n
m = k + 1 - j
do 10, i = max(1, j - k), j
a(m + i, j) = matrix(i, j)
10 continue
20 continue
Before entry with uplo = 'L' or 'l', the leading (k + 1) by n part of the
array a must contain the lower triangular band part of the matrix of
coefficients, supplied column-by-column, with the leading diagonal of the
matrix in row1 of the array, the first sub-diagonal starting at position 1 in
2 Intel® Math Kernel Library Reference Manual
108
row 2, and so on. The bottom right k by k triangle of the array a is not
referenced. The following program segment transfers a lower triangular
band matrix from conventional full matrix storage to band storage:
do 20, j = 1, n
m = 1 - j
do 10, i = j, min(n, j + k)
a(m + i, j) = matrix (i, j)
10 continue
20 continue
Note that when diag = 'U' or 'u', the elements of the array a
corresponding to the diagonal elements of the matrix are not referenced,
but are assumed to be unity.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least (k + 1).
x REAL for stbmv
DOUBLE PRECISION for dtbmv
COMPLEX for ctbmv
DOUBLE COMPLEX for ztbmv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
Output Parameters
x Overwritten with the transformed vector x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tbmv interface are the following:
a Holds the array a of size (k+1,n).
x Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'.
The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
?tbsv
Solves a system of linear equations whose coefficients
are in a triangular band matrix.
Syntax
Fortran 77:
call stbsv(uplo, trans, diag, n, k, a, lda, x, incx)
call dtbsv(uplo, trans, diag, n, k, a, lda, x, incx)
call ctbsv(uplo, trans, diag, n, k, a, lda, x, incx)
call ztbsv(uplo, trans, diag, n, k, a, lda, x, incx)
BLAS and Sparse BLAS Routines 2
109
Fortran 95:
call tbsv(a, x [,uplo] [, trans] [,diag])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?tbsv routines solve one of the following systems of equations:
A*x = b, or A'*x = b, or conjg(A')*x = b,
where:
b and x are n-element vectors,
A is an n-by-n unit, or non-unit, upper or lower triangular band matrix, with (k + 1) diagonals.
The routine does not test for singularity or near-singularity.
Such tests must be performed before calling this routine.
Input Parameters
uplo CHARACTER*1. Specifies whether the matrix A is an upper or lower
triangular matrix:
if uplo = 'U' or 'u' the matrix is upper triangular;
if uplo = 'L' or 'l', the matrix is low triangular.
trans CHARACTER*1. Specifies the system of equations:
if trans = 'N' or 'n', then A*x = b;
if trans = 'T' or 't', then A'*x = b;
if trans = 'C' or 'c', then conjg(A')*x = b.
diag CHARACTER*1. Specifies whether the matrix A is unit triangular:
if diag = 'U' or 'u' then the matrix is unit triangular;
if diag = 'N' or 'n', then the matrix is not unit triangular.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
k INTEGER. On entry with uplo = 'U' or 'u', k specifies the number of
super-diagonals of the matrix A. On entry with uplo = 'L' or 'l', k
specifies the number of sub-diagonals of the matrix A.
The value of k must satisfy 0 = k.
a REAL for stbsv
DOUBLE PRECISION for dtbsv
COMPLEX for ctbsv
DOUBLE COMPLEX for ztbsv
Array, DIMENSION (lda, n).
Before entry with uplo = 'U' or 'u', the leading (k + 1) by n part of the
array a must contain the upper triangular band part of the matrix of
coefficients, supplied column-by-column, with the leading diagonal of the
matrix in row (k + 1) of the array, the first super-diagonal starting at
position 2 in row k, and so on. The top left k by k triangle of the array a is
not referenced.
2 Intel® Math Kernel Library Reference Manual
110
The following program segment transfers an upper triangular band matrix
from conventional full matrix storage to band storage:
do 20, j = 1, n
m = k + 1 - j
do 10, i = max(1, j - k), jl
a(m + i, j) = matrix (i, j)
10 continue
20 continue
Before entry with uplo = 'L' or 'l', the leading (k + 1) by n part of the
array a must contain the lower triangular band part of the matrix of
coefficients, supplied column-by-column, with the leading diagonal of the
matrix in row 1 of the array, the first sub-diagonal starting at position 1 in
row 2, and so on. The bottom right k by k triangle of the array a is not
referenced.
The following program segment transfers a lower triangular band matrix
from conventional full matrix storage to band storage:
do 20, j = 1, n
m = 1 - j
do 10, i = j, min(n, j + k)
a(m + i, j) = matrix (i, j)
10 continue
20 continue
When diag = 'U' or 'u', the elements of the array a corresponding to the
diagonal elements of the matrix are not referenced, but are assumed to be
unity.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least (k + 1).
x REAL for stbsv
DOUBLE PRECISION for dtbsv
COMPLEX for ctbsv
DOUBLE COMPLEX for ztbsv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element right-hand side vector b.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
Output Parameters
x Overwritten with the solution vector x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tbsv interface are the following:
a Holds the array a of size (k+1,n).
x Holds the vector with the number of elements n.
BLAS and Sparse BLAS Routines 2
111
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'.
The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
?tpmv
Computes a matrix-vector product using a triangular
packed matrix.
Syntax
Fortran 77:
call stpmv(uplo, trans, diag, n, ap, x, incx)
call dtpmv(uplo, trans, diag, n, ap, x, incx)
call ctpmv(uplo, trans, diag, n, ap, x, incx)
call ztpmv(uplo, trans, diag, n, ap, x, incx)
Fortran 95:
call tpmv(ap, x [,uplo] [, trans] [,diag])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?tpmv routines perform one of the matrix-vector operations defined as
x := A*x, or x := A'*x, or x := conjg(A')*x,
where:
x is an n-element vector,
A is an n-by-n unit, or non-unit, upper or lower triangular matrix, supplied in packed form.
Input Parameters
uplo CHARACTER*1. Specifies whether the matrix A is upper or lower triangular:
if uplo = 'U' or 'u', then the matrix is upper triangular;
if uplo = 'L' or 'l', then the matrix is low triangular.
trans CHARACTER*1. Specifies the operation:
if trans = 'N' or 'n', then x := A*x;
if trans = 'T' or 't', then x := A'*x;
if trans = 'C' or 'c', then x := conjg(A')*x.
diag CHARACTER*1. Specifies whether the matrix A is unit triangular:
if diag = 'U' or 'u' then the matrix is unit triangular;
if diag = 'N' or 'n', then the matrix is not unit triangular.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
ap REAL for stpmv
2 Intel® Math Kernel Library Reference Manual
112
DOUBLE PRECISION for dtpmv
COMPLEX for ctpmv
DOUBLE COMPLEX for ztpmv
Array, DIMENSION at least ((n*(n + 1))/2). Before entry with uplo =
'U' or 'u', the array ap must contain the upper triangular matrix packed
sequentially, column-by-column, so that ap(1) contains a(1,1), ap(2)
and ap(3) contain a(1,2) and a(2,2) respectively, and so on. Before
entry with uplo = 'L' or 'l', the array ap must contain the lower
triangular matrix packed sequentially, column-by-column, so that ap(1)
contains a(1,1), ap(2) and ap(3) contain a(2,1) and a(3,1)
respectively, and so on. When diag = 'U' or 'u', the diagonal elements
of a are not referenced, but are assumed to be unity.
x REAL for stpmv
DOUBLE PRECISION for dtpmv
COMPLEX for ctpmv
DOUBLE COMPLEX for ztpmv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
Output Parameters
x Overwritten with the transformed vector x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tpmv interface are the following:
ap Holds the array ap of size (n*(n+1)/2).
x Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'.
The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
?tpsv
Solves a system of linear equations whose coefficients
are in a triangular packed matrix.
Syntax
Fortran 77:
call stpsv(uplo, trans, diag, n, ap, x, incx)
call dtpsv(uplo, trans, diag, n, ap, x, incx)
call ctpsv(uplo, trans, diag, n, ap, x, incx)
call ztpsv(uplo, trans, diag, n, ap, x, incx)
BLAS and Sparse BLAS Routines 2
113
Fortran 95:
call tpsv(ap, x [,uplo] [, trans] [,diag])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?tpsv routines solve one of the following systems of equations
A*x = b, or A'*x = b, or conjg(A')*x = b,
where:
b and x are n-element vectors,
A is an n-by-n unit, or non-unit, upper or lower triangular matrix, supplied in packed form.
This routine does not test for singularity or near-singularity.
Such tests must be performed before calling this routine.
Input Parameters
uplo CHARACTER*1. Specifies whether the matrix A is upper or lower triangular:
if uplo = 'U' or 'u', then the matrix is upper triangular;
if uplo = 'L' or 'l', then the matrix is low triangular.
trans CHARACTER*1. Specifies the system of equations:
if trans = 'N' or 'n', then A*x = b;
if trans = 'T' or 't', then A'*x = b;
if trans = 'C' or 'c', then conjg(A')*x = b.
diag CHARACTER*1. Specifies whether the matrix A is unit triangular:
if diag = 'U' or 'u' then the matrix is unit triangular;
if diag = 'N' or 'n', then the matrix is not unit triangular.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
ap REAL for stpsv
DOUBLE PRECISION for dtpsv
COMPLEX for ctpsv
DOUBLE COMPLEX for ztpsv
Array, DIMENSION at least ((n*(n + 1))/2). Before entry with uplo =
'U' or 'u', the array ap must contain the upper triangular matrix packed
sequentially, column-by-column, so that ap(1) contains a(1, +1), ap(2)
and ap(3) contain a(1, 2) and a(2, 2) respectively, and so on.
Before entry with uplo = 'L' or 'l', the array ap must contain the lower
triangular matrix packed sequentially, column-by-column, so that ap(1)
contains a(1, +1), ap(2) and ap(3) contain a(2, +1) and a(3, +1)
respectively, and so on.
When diag = 'U' or 'u', the diagonal elements of a are not referenced,
but are assumed to be unity.
x REAL for stpsv
DOUBLE PRECISION for dtpsv
COMPLEX for ctpsv
2 Intel® Math Kernel Library Reference Manual
114
DOUBLE COMPLEX for ztpsv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element right-hand side vector b.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
Output Parameters
x Overwritten with the solution vector x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tpsv interface are the following:
ap Holds the array ap of size (n*(n+1)/2).
x Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'.
The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
?trmv
Computes a matrix-vector product using a triangular
matrix.
Syntax
Fortran 77:
call strmv(uplo, trans, diag, n, a, lda, x, incx)
call dtrmv(uplo, trans, diag, n, a, lda, x, incx)
call ctrmv(uplo, trans, diag, n, a, lda, x, incx)
call ztrmv(uplo, trans, diag, n, a, lda, x, incx)
Fortran 95:
call trmv(a, x [,uplo] [, trans] [,diag])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?trmv routines perform one of the following matrix-vector operations defined as
x := A*x, or x := A'*x, or x := conjg(A')*x,
where:
x is an n-element vector,
A is an n-by-n unit, or non-unit, upper or lower triangular matrix.
BLAS and Sparse BLAS Routines 2
115
Input Parameters
uplo CHARACTER*1. Specifies whether the matrix A is upper or lower triangular:
if uplo = 'U' or 'u', then the matrix is upper triangular;
if uplo = 'L' or 'l', then the matrix is low triangular.
trans CHARACTER*1. Specifies the operation:
if trans = 'N' or 'n', then x := A*x;
if trans = 'T' or 't', then x := A'*x;
if trans = 'C' or 'c', then x := conjg(A')*x.
diag CHARACTER*1. Specifies whether the matrix A is unit triangular:
if diag = 'U' or 'u' then the matrix is unit triangular;
if diag = 'N' or 'n', then the matrix is not unit triangular.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
a REAL for strmv
DOUBLE PRECISION for dtrmv
COMPLEX for ctrmv
DOUBLE COMPLEX for ztrmv
Array, DIMENSION (lda,n). Before entry with uplo = 'U' or 'u', the
leading n-by-n upper triangular part of the array a must contain the upper
triangular matrix and the strictly lower triangular part of a is not
referenced. Before entry with uplo = 'L' or 'l', the leading n-by-n lower
triangular part of the array a must contain the lower triangular matrix and
the strictly upper triangular part of a is not referenced.
When diag = 'U' or 'u', the diagonal elements of a are not referenced
either, but are assumed to be unity.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, n).
x REAL for strmv
DOUBLE PRECISION for dtrmv
COMPLEX for ctrmv
DOUBLE COMPLEX for ztrmv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element vector x.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
Output Parameters
x Overwritten with the transformed vector x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine trmv interface are the following:
a Holds the matrix A of size (n,n).
x Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'.
2 Intel® Math Kernel Library Reference Manual
116
The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
?trsv
Solves a system of linear equations whose coefficients
are in a triangular matrix.
Syntax
Fortran 77:
call strsv(uplo, trans, diag, n, a, lda, x, incx)
call dtrsv(uplo, trans, diag, n, a, lda, x, incx)
call ctrsv(uplo, trans, diag, n, a, lda, x, incx)
call ztrsv(uplo, trans, diag, n, a, lda, x, incx)
Fortran 95:
call trsv(a, x [,uplo] [, trans] [,diag])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?trsv routines solve one of the systems of equations:
A*x = b, or A'*x = b, or conjg(A')*x = b,
where:
b and x are n-element vectors,
A is an n-by-n unit, or non-unit, upper or lower triangular matrix.
The routine does not test for singularity or near-singularity.
Such tests must be performed before calling this routine.
Input Parameters
uplo CHARACTER*1. Specifies whether the matrix A is upper or lower triangular:
if uplo = 'U' or 'u', then the matrix is upper triangular;
if uplo = 'L' or 'l', then the matrix is low triangular.
trans CHARACTER*1. Specifies the systems of equations:
if trans = 'N' or 'n', then A*x = b;
if trans = 'T' or 't', then A'*x = b;
if trans = 'C' or 'c', then oconjg(A')*x = b.
diag CHARACTER*1. Specifies whether the matrix A is unit triangular:
if diag = 'U' or 'u' then the matrix is unit triangular;
if diag = 'N' or 'n', then the matrix is not unit triangular.
n INTEGER. Specifies the order of the matrix A. The value of n must be at
least zero.
a REAL for strsv
BLAS and Sparse BLAS Routines 2
117
DOUBLE PRECISION for dtrsv
COMPLEX for ctrsv
DOUBLE COMPLEX for ztrsv
Array, DIMENSION (lda,n). Before entry with uplo = 'U' or 'u', the
leading n-by-n upper triangular part of the array a must contain the upper
triangular matrix and the strictly lower triangular part of a is not
referenced. Before entry with uplo = 'L' or 'l', the leading n-by-n lower
triangular part of the array a must contain the lower triangular matrix and
the strictly upper triangular part of a is not referenced.
When diag = 'U' or 'u', the diagonal elements of a are not referenced
either, but are assumed to be unity.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, n).
x REAL for strsv
DOUBLE PRECISION for dtrsv
COMPLEX for ctrsv
DOUBLE COMPLEX for ztrsv
Array, DIMENSION at least (1 + (n - 1)*abs(incx)). Before entry, the
incremented array x must contain the n-element right-hand side vector b.
incx INTEGER. Specifies the increment for the elements of x.
The value of incx must not be zero.
Output Parameters
x Overwritten with the solution vector x.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine trsv interface are the following:
a Holds the matrix a of size (n,n).
x Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'.
The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
BLAS Level 3 Routines
BLAS Level 3 routines perform matrix-matrix operations. Table “BLAS Level 3 Routine Groups and Their Data
Types” lists the BLAS Level 3 routine groups and the data types associated with them.
BLAS Level 3 Routine Groups and Their Data Types
Routine Group Data Types Description
?gemm s, d, c, z Matrix-matrix product of general matrices
?hemm c, z Matrix-matrix product of Hermitian matrices
?herk c, z Rank-k update of Hermitian matrices
2 Intel® Math Kernel Library Reference Manual
118
Routine Group Data Types Description
?her2k c, z Rank-2k update of Hermitian matrices
?symm s, d, c, z Matrix-matrix product of symmetric matrices
?syrk s, d, c, z Rank-k update of symmetric matrices
?syr2k s, d, c, z Rank-2k update of symmetric matrices
?trmm s, d, c, z Matrix-matrix product of triangular matrices
?trsm s, d, c, z Linear matrix-matrix solution for triangular matrices
Symmetric Multiprocessing Version of Intel® MKL
Many applications spend considerable time executing BLAS routines. This time can be scaled by the number
of processors available on the system through using the symmetric multiprocessing (SMP) feature built into
the Intel MKL Library. The performance enhancements based on the parallel use of the processors are
available without any programming effort on your part.
To enhance performance, the library uses the following methods:
• The BLAS functions are blocked where possible to restructure the code in a way that increases the
localization of data reference, enhances cache memory use, and reduces the dependency on the memory
bus.
• The code is distributed across the processors to maximize parallelism.
Optimization Notice
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are
not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other
optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on
microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for
use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel
microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the
specific instruction sets covered by this notice.
Notice revision #20110804
?gemm
Computes a scalar-matrix-matrix product and adds
the result to a scalar-matrix product.
Syntax
Fortran 77:
call sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call scgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call dzgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
Fortran 95:
call gemm(a, b, c [,transa][,transb] [,alpha][,beta])
BLAS and Sparse BLAS Routines 2
119
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?gemm routines perform a matrix-matrix operation with general matrices. The operation is defined as
C := alpha*op(A)*op(B) + beta*C,
where:
op(x) is one of op(x) = x, or op(x) = x', or op(x) = conjg(x'),
alpha and beta are scalars,
A, B and C are matrices:
op(A) is an m-by-k matrix,
op(B) is a k-by-n matrix,
C is an m-by-n matrix.
See also ?gemm3m, BLAS-like extension routines, that use matrix multiplication for similar matrix-matrix
operations.
Input Parameters
transa CHARACTER*1. Specifies the form of op(A) used in the matrix
multiplication:
if transa = 'N' or 'n', then op(A) = A;
if transa = 'T' or 't', then op(A) = A';
if transa = 'C' or 'c', then op(A) = conjg(A').
transb CHARACTER*1. Specifies the form of op(B) used in the matrix
multiplication:
if transb = 'N' or 'n', then op(B) = B;
if transb = 'T' or 't', then op(B) = B';
if transb = 'C' or 'c', then op(B) = conjg(B').
m INTEGER. Specifies the number of rows of the matrix op(A) and of the
matrix C. The value of m must be at least zero.
n INTEGER. Specifies the number of columns of the matrix op(B) and the
number of columns of the matrix C.
The value of n must be at least zero.
k INTEGER. Specifies the number of columns of the matrix op(A) and the
number of rows of the matrix op(B).
The value of k must be at least zero.
alpha REAL for sgemm
DOUBLE PRECISION for dgemm
COMPLEX for cgemm, scgemm
DOUBLE COMPLEX for zgemm, dzgemm
Specifies the scalar alpha.
a REAL for sgemm, scgemm
DOUBLE PRECISION for dgemm, dzgemm
COMPLEX for cgemm
DOUBLE COMPLEX for zgemm
2 Intel® Math Kernel Library Reference Manual
120
Array, DIMENSION (lda, ka), where ka is k when transa = 'N' or 'n',
and is m otherwise. Before entry with transa = 'N' or 'n', the leading mby-
k part of the array a must contain the matrix A, otherwise the leading kby-
m part of the array a must contain the matrix A.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When transa = 'N' or 'n', then lda must be at least
max(1, m), otherwise lda must be at least max(1, k).
b REAL for sgemm
DOUBLE PRECISION for dgemm
COMPLEX for cgemm, scgemm
DOUBLE COMPLEX for zgemm, dzgemm
Array, DIMENSION (ldb, kb), where kb is n when transb = 'N' or 'n',
and is k otherwise. Before entry with transb = 'N' or 'n', the leading kby-
n part of the array b must contain the matrix B, otherwise the leading nby-
k part of the array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program. When transb = 'N' or 'n', then ldb must be at least
max(1, k), otherwise ldb must be at least max(1, n).
beta REAL for sgemm
DOUBLE PRECISION for dgemm
COMPLEX for cgemm, scgemm
DOUBLE COMPLEX for zgemm, dzgemm
Specifies the scalar beta.
When beta is equal to zero, then c need not be set on input.
c REAL for sgemm
DOUBLE PRECISION for dgemm
COMPLEX for cgemm, scgemm
DOUBLE COMPLEX for zgemm, dzgemm
Array, DIMENSION (ldc, n).
Before entry, the leading m-by-n part of the array c must contain the matrix
C, except when beta is equal to zero, in which case c need not be set on
entry.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program. The value of ldc must be at least max(1, m).
Output Parameters
c Overwritten by the m-by-n matrix (alpha*op(A)*op(B) + beta*C).
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gemm interface are the following:
a Holds the matrix A of size (ma,ka) where
ka = k if transa= 'N',
ka = m otherwise,
ma = m if transa= 'N',
ma = k otherwise.
b Holds the matrix B of size (mb,kb) where
BLAS and Sparse BLAS Routines 2
121
kb = n if transb = 'N',
kb = k otherwise,
mb = k if transb = 'N',
mb = n otherwise.
c Holds the matrix C of size (m,n).
transa Must be 'N', 'C', or 'T'.
The default value is 'N'.
transb Must be 'N', 'C', or 'T'.
The default value is 'N'.
alpha The default value is 1.
beta The default value is 0.
?hemm
Computes a scalar-matrix-matrix product (either one
of the matrices is Hermitian) and adds the result to
scalar-matrix product.
Syntax
Fortran 77:
call chemm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
call zhemm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
Fortran 95:
call hemm(a, b, c [,side][,uplo] [,alpha][,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?hemm routines perform a matrix-matrix operation using Hermitian matrices. The operation is defined as
C := alpha*A*B + beta*C
or
C := alpha*B*A + beta*C,
where:
alpha and beta are scalars,
A is an Hermitian matrix,
B and C are m-by-n matrices.
Input Parameters
side CHARACTER*1. Specifies whether the Hermitian matrix A appears on the left
or right in the operation as follows:
if side = 'L' or 'l', then C := alpha*A*B + beta*C;
if side = 'R' or 'r', then C := alpha*B*A + beta*C.
2 Intel® Math Kernel Library Reference Manual
122
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
Hermitian matrix A is used:
If uplo = 'U' or 'u', then the upper triangular part of the Hermitian
matrix A is used.
If uplo = 'L' or 'l', then the low triangular part of the Hermitian matrix
A is used.
m INTEGER. Specifies the number of rows of the matrix C.
The value of m must be at least zero.
n INTEGER. Specifies the number of columns of the matrix C.
The value of n must be at least zero.
alpha COMPLEX for chemm
DOUBLE COMPLEX for zhemm
Specifies the scalar alpha.
a COMPLEX for chemm
DOUBLE COMPLEX for zhemm
Array, DIMENSION (lda,ka), where ka is m when side = 'L' or 'l' and
is n otherwise. Before entry with side = 'L' or 'l', the m-by-m part of the
array a must contain the Hermitian matrix, such that when uplo = 'U' or
'u', the leading m-by-m upper triangular part of the array a must contain
the upper triangular part of the Hermitian matrix and the strictly lower
triangular part of a is not referenced, and when uplo = 'L' or 'l', the
leading m-by-m lower triangular part of the array a must contain the lower
triangular part of the Hermitian matrix, and the strictly upper triangular
part of a is not referenced.
Before entry with side = 'R' or 'r', the n-by-n part of the array a must
contain the Hermitian matrix, such that when uplo = 'U' or 'u', the
leading n-by-n upper triangular part of the array a must contain the upper
triangular part of the Hermitian matrix and the strictly lower triangular part
of a is not referenced, and when uplo = 'L' or 'l', the leading n-by-n
lower triangular part of the array a must contain the lower triangular part of
the Hermitian matrix, and the strictly upper triangular part of a is not
referenced. The imaginary parts of the diagonal elements need not be set,
they are assumed to be zero.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub) program. When side = 'L' or 'l' then lda must be at least
max(1, m), otherwise lda must be at least max(1,n).
b COMPLEX for chemm
DOUBLE COMPLEX for zhemm
Array, DIMENSION (ldb,n).
Before entry, the leading m-by-n part of the array b must contain the matrix
B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program. The value of ldb must be at least max(1, m).
beta COMPLEX for chemm
DOUBLE COMPLEX for zhemm
Specifies the scalar beta.
When beta is supplied as zero, then c need not be set on input.
c COMPLEX for chemm
DOUBLE COMPLEX for zhemm
BLAS and Sparse BLAS Routines 2
123
Array, DIMENSION (c, n). Before entry, the leading m-by-n part of the
array c must contain the matrix C, except when beta is zero, in which case
c need not be set on entry.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program. The value of ldc must be at least max(1, m).
Output Parameters
c Overwritten by the m-by-n updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hemm interface are the following:
a Holds the matrix A of size (k,k) where
k = m if side = 'L',
k = n otherwise.
b Holds the matrix B of size (m,n).
c Holds the matrix C of size (m,n).
side Must be 'L' or 'R'. The default value is 'L'.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
beta The default value is 0.
?herk
Performs a rank-k update of a Hermitian matrix.
Syntax
Fortran 77:
call cherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
call zherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
Fortran 95:
call herk(a, c [,uplo] [, trans] [,alpha][,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?herk routines perform a matrix-matrix operation using Hermitian matrices. The operation is defined as
C := alpha*A*conjg(A') + beta*C,
or
C := alpha*conjg(A')*A + beta*C,
where:
2 Intel® Math Kernel Library Reference Manual
124
alpha and beta are real scalars,
C is an n-by-n Hermitian matrix,
A is an n-by-k matrix in the first case and a k-by-n matrix in the second case.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array c is used.
If uplo = 'U' or 'u', then the upper triangular part of the array c is used.
If uplo = 'L' or 'l', then the low triangular part of the array c is used.
trans CHARACTER*1. Specifies the operation:
if trans = 'N' or 'n', then C:= alpha*A*conjg(A')+beta*C;
if trans = 'C' or 'c', then C:= alpha*conjg(A')*A+beta*C.
n INTEGER. Specifies the order of the matrix C. The value of n must be at
least zero.
k INTEGER. With trans = 'N' or 'n', k specifies the number of columns of
the matrix A, and with trans = 'C' or 'c', k specifies the number of rows
of the matrix A.
The value of k must be at least zero.
alpha REAL for cherk
DOUBLE PRECISION for zherk
Specifies the scalar alpha.
a COMPLEX for cherk
DOUBLE COMPLEX for zherk
Array, DIMENSION (lda, ka), where ka is k when trans = 'N' or 'n',
and is n otherwise. Before entry with trans = 'N' or 'n', the leading nby-
k part of the array a must contain the matrix a, otherwise the leading kby-
n part of the array a must contain the matrix A.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When trans = 'N' or 'n', then lda must be at least
max(1, n), otherwise lda must be at least max(1, k).
beta REAL for cherk
DOUBLE PRECISION for zherk
Specifies the scalar beta.
c COMPLEX for cherk
DOUBLE COMPLEX for zherk
Array, DIMENSION (ldc,n).
Before entry with uplo = 'U' or 'u', the leading n-by-n upper triangular
part of the array c must contain the upper triangular part of the Hermitian
matrix and the strictly lower triangular part of c is not referenced.
Before entry with uplo = 'L' or 'l', the leading n-by-n lower triangular
part of the array c must contain the lower triangular part of the Hermitian
matrix and the strictly upper triangular part of c is not referenced.
The imaginary parts of the diagonal elements need not be set, they are
assumed to be zero.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program. The value of ldc must be at least max(1, n).
BLAS and Sparse BLAS Routines 2
125
Output Parameters
c With uplo = 'U' or 'u', the upper triangular part of the array c is
overwritten by the upper triangular part of the updated matrix.
With uplo = 'L' or 'l', the lower triangular part of the array c is
overwritten by the lower triangular part of the updated matrix.
The imaginary parts of the diagonal elements are set to zero.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine herk interface are the following:
a Holds the matrix A of size (ma,ka) where
ka = k if transa= 'N',
ka = n otherwise,
ma = n if transa= 'N',
ma = k otherwise.
c Holds the matrix C of size (n,n).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N' or 'C'. The default value is 'N'.
alpha The default value is 1.
beta The default value is 0.
?her2k
Performs a rank-2k update of a Hermitian matrix.
Syntax
Fortran 77:
call cher2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call zher2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
Fortran 95:
call her2k(a, b, c [,uplo][,trans] [,alpha][,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?her2k routines perform a rank-2k matrix-matrix operation using Hermitian matrices. The operation is
defined as
C := alpha*A*conjg(B') + conjg(alpha)*B*conjg(A') + beta*C,
or
C := alpha *conjg(B')*A + conjg(alpha) *conjg(A')*B + beta*C,
where:
2 Intel® Math Kernel Library Reference Manual
126
alpha is a scalar and beta is a real scalar,
C is an n-by-n Hermitian matrix,
A and B are n-by-k matrices in the first case and k-by-n matrices in the second case.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array c is used.
If uplo = 'U' or 'u', then the upper triangular of the array c is used.
If uplo = 'L' or 'l', then the low triangular of the array c is used.
trans CHARACTER*1. Specifies the operation:
if trans = 'N' or 'n', then C:=alpha*A*conjg(B') +
alpha*B*conjg(A') + beta*C;
if trans = 'C' or 'c', then C:=alpha*conjg(A')*B +
alpha*conjg(B')*A + beta*C.
n INTEGER. Specifies the order of the matrix C. The value of n must be at
least zero.
k INTEGER. With trans = 'N' or 'n', k specifies the number of columns of
the matrix A, and with trans = 'C' or 'c', k specifies the number of rows
of the matrix A.
The value of k must be at least equal to zero.
alpha COMPLEX for cher2k
DOUBLE COMPLEX for zher2k
Specifies the scalar alpha.
a COMPLEX for cher2k
DOUBLE COMPLEX for zher2k
Array, DIMENSION (lda, ka), where ka is k when trans = 'N' or 'n',
and is n otherwise. Before entry with trans = 'N' or 'n', the leading nby-
k part of the array a must contain the matrix A, otherwise the leading kby-
n part of the array a must contain the matrix A.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When trans = 'N' or 'n', then lda must be at least
max(1, n), otherwise lda must be at least max(1, k).
beta REAL for cher2k
DOUBLE PRECISION for zher2k
Specifies the scalar beta.
b COMPLEX for cher2k
DOUBLE COMPLEX for zher2k
Array, DIMENSION (ldb, kb), where kb is k when trans = 'N' or 'n',
and is n otherwise. Before entry with trans = 'N' or 'n', the leading nby-
k part of the array b must contain the matrix B, otherwise the leading kby-
n part of the array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program. When trans = 'N' or 'n', then ldb must be at least
max(1, n), otherwise ldb must be at least max(1, k).
c COMPLEX for cher2k
DOUBLE COMPLEX for zher2k
Array, DIMENSION (ldc,n).
BLAS and Sparse BLAS Routines 2
127
Before entry with uplo = 'U' or 'u', the leading n-by-n upper triangular
part of the array c must contain the upper triangular part of the Hermitian
matrix and the strictly lower triangular part of c is not referenced.
Before entry with uplo = 'L' or 'l', the leading n-by-n lower triangular
part of the array c must contain the lower triangular part of the Hermitian
matrix and the strictly upper triangular part of c is not referenced.
The imaginary parts of the diagonal elements need not be set, they are
assumed to be zero.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program. The value of ldc must be at least max(1, n).
Output Parameters
c With uplo = 'U' or 'u', the upper triangular part of the array c is
overwritten by the upper triangular part of the updated matrix.
With uplo = 'L' or 'l', the lower triangular part of the array c is
overwritten by the lower triangular part of the updated matrix.
The imaginary parts of the diagonal elements are set to zero.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine her2k interface are the following:
a Holds the matrix A of size (ma,ka) where
ka = k if trans = 'N',
ka = n otherwise,
ma = n if trans = 'N',
ma = k otherwise.
b Holds the matrix B of size (mb,kb) where
kb = k if trans = 'N',
kb = n otherwise,
mb = n if trans = 'N',
mb = k otherwise.
c Holds the matrix C of size (n,n).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N' or 'C'. The default value is 'N'.
alpha The default value is 1.
beta The default value is 0.
?symm
Performs a scalar-matrix-matrix product (one matrix
operand is symmetric) and adds the result to a scalarmatrix
product.
Syntax
Fortran 77:
call ssymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
call dsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
call csymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
2 Intel® Math Kernel Library Reference Manual
128
call zsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
Fortran 95:
call symm(a, b, c [,side][,uplo] [,alpha][,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?symm routines perform a matrix-matrix operation using symmetric matrices. The operation is defined as
C := alpha*A*B + beta*C,
or
C := alpha*B*A + beta*C,
where:
alpha and beta are scalars,
A is a symmetric matrix,
B and C are m-by-n matrices.
Input Parameters
side CHARACTER*1. Specifies whether the symmetric matrix A appears on the
left or right in the operation:
if side = 'L' or 'l', then C := alpha*A*B + beta*C;
if side = 'R' or 'r', then C := alpha*B*A + beta*C.
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
symmetric matrix A is used:
if uplo = 'U' or 'u', then the upper triangular part is used;
if uplo = 'L' or 'l', then the lower triangular part is used.
m INTEGER. Specifies the number of rows of the matrix C.
The value of m must be at least zero.
n INTEGER. Specifies the number of columns of the matrix C.
The value of n must be at least zero.
alpha REAL for ssymm
DOUBLE PRECISION for dsymm
COMPLEX for csymm
DOUBLE COMPLEX for zsymm
Specifies the scalar alpha.
a REAL for ssymm
DOUBLE PRECISION for dsymm
COMPLEX for csymm
DOUBLE COMPLEX for zsymm
Array, DIMENSION (lda, ka), where ka is m when side = 'L' or 'l' and
is n otherwise.
Before entry with side = 'L' or 'l', the m-by-m part of the array a must
contain the symmetric matrix, such that when uplo = 'U' or 'u', the
leading m-by-m upper triangular part of the array a must contain the upper
triangular part of the symmetric matrix and the strictly lower triangular part
BLAS and Sparse BLAS Routines 2
129
of a is not referenced, and when uplo = 'L' or 'l', the leading m-by-m
lower triangular part of the array a must contain the lower triangular part of
the symmetric matrix and the strictly upper triangular part of a is not
referenced.
Before entry with side = 'R' or 'r', the n-by-n part of the array a must
contain the symmetric matrix, such that when uplo = 'U' or 'u', the
leading n-by-n upper triangular part of the array a must contain the upper
triangular part of the symmetric matrix and the strictly lower triangular part
of a is not referenced, and when uplo = 'L' or 'l', the leading n-by-n
lower triangular part of the array a must contain the lower triangular part of
the symmetric matrix and the strictly upper triangular part of a is not
referenced.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When side = 'L' or 'l' then lda must be at least max(1,
m), otherwise lda must be at least max(1, n).
b REAL for ssymm
DOUBLE PRECISION for dsymm
COMPLEX for csymm
DOUBLE COMPLEX for zsymm
Array, DIMENSION (ldb,n). Before entry, the leading m-by-n part of the
array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program. The value of ldb must be at least max(1, m).
beta REAL for ssymm
DOUBLE PRECISION for dsymm
COMPLEX for csymm
DOUBLE COMPLEX for zsymm
Specifies the scalar beta.
When beta is set to zero, then c need not be set on input.
c REAL for ssymm
DOUBLE PRECISION for dsymm
COMPLEX for csymm
DOUBLE COMPLEX for zsymm
Array, DIMENSION (ldc,n). Before entry, the leading m-by-n part of the
array c must contain the matrix C, except when beta is zero, in which case
c need not be set on entry.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program. The value of ldc must be at least max(1, m).
Output Parameters
c Overwritten by the m-by-n updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine symm interface are the following:
a Holds the matrix A of size (k,k) where
k = m if side = 'L',
k = n otherwise.
2 Intel® Math Kernel Library Reference Manual
130
b Holds the matrix B of size (m,n).
c Holds the matrix C of size (m,n).
side Must be 'L' or 'R'. The default value is 'L'.
uplo Must be 'U' or 'L'. The default value is 'U'.
alpha The default value is 1.
beta The default value is 0.
?syrk
Performs a rank-n update of a symmetric matrix.
Syntax
Fortran 77:
call ssyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
call dsyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
call csyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
call zsyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
Fortran 95:
call syrk(a, c [,uplo] [, trans] [,alpha][,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?syrk routines perform a matrix-matrix operation using symmetric matrices. The operation is defined as
C := alpha*A*A' + beta*C,
or
C := alpha*A'*A + beta*C,
where:
alpha and beta are scalars,
C is an n-by-n symmetric matrix,
A is an n-by-k matrix in the first case and a k-by-n matrix in the second case.
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array c is used.
If uplo = 'U' or 'u', then the upper triangular part of the array c is used.
If uplo = 'L' or 'l', then the low triangular part of the array c is used.
trans CHARACTER*1. Specifies the operation:
if trans = 'N' or 'n', then C := alpha*A*A' + beta*C;
if trans = 'T' or 't', then C := alpha*A'*A + beta*C;
if trans = 'C' or 'c', then C := alpha*A'*A + beta*C.
BLAS and Sparse BLAS Routines 2
131
n INTEGER. Specifies the order of the matrix C. The value of n must be at
least zero.
k INTEGER. On entry with trans = 'N' or 'n', k specifies the number of
columns of the matrix a, and on entry with trans = 'T' or 't' or 'C' or
'c', k specifies the number of rows of the matrix a.
The value of k must be at least zero.
alpha REAL for ssyrk
DOUBLE PRECISION for dsyrk
COMPLEX for csyrk
DOUBLE COMPLEX for zsyrk
Specifies the scalar alpha.
a REAL for ssyrk
DOUBLE PRECISION for dsyrk
COMPLEX for csyrk
DOUBLE COMPLEX for zsyrk
Array, DIMENSION (lda,ka), where ka is k when trans = 'N' or 'n',
and is n otherwise. Before entry with trans = 'N' or 'n', the leading nby-
k part of the array a must contain the matrix A, otherwise the leading kby-
n part of the array a must contain the matrix A.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When trans = 'N' or 'n', then lda must be at least
max(1,n), otherwise lda must be at least max(1, k).
beta REAL for ssyrk
DOUBLE PRECISION for dsyrk
COMPLEX for csyrk
DOUBLE COMPLEX for zsyrk
Specifies the scalar beta.
c REAL for ssyrk
DOUBLE PRECISION for dsyrk
COMPLEX for csyrk
DOUBLE COMPLEX for zsyrk
Array, DIMENSION (ldc,n). Before entry with uplo = 'U' or 'u', the
leading n-by-n upper triangular part of the array c must contain the upper
triangular part of the symmetric matrix and the strictly lower triangular part
of c is not referenced.
Before entry with uplo = 'L' or 'l', the leading n-by-n lower triangular
part of the array c must contain the lower triangular part of the symmetric
matrix and the strictly upper triangular part of c is not referenced.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program. The value of ldc must be at least max(1, n).
Output Parameters
c With uplo = 'U' or 'u', the upper triangular part of the array c is
overwritten by the upper triangular part of the updated matrix.
With uplo = 'L' or 'l', the lower triangular part of the array c is
overwritten by the lower triangular part of the updated matrix.
2 Intel® Math Kernel Library Reference Manual
132
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine syrk interface are the following:
a Holds the matrix A of size (ma,ka) where
ka = k if transa= 'N',
ka = n otherwise,
ma = n if transa= 'N',
ma = k otherwise.
c Holds the matrix C of size (n,n).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'.
The default value is 'N'.
alpha The default value is 1.
beta The default value is 0.
?syr2k
Performs a rank-2k update of a symmetric matrix.
Syntax
Fortran 77:
call ssyr2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call dsyr2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call csyr2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call zsyr2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
Fortran 95:
call syr2k(a, b, c [,uplo][,trans] [,alpha][,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?syr2k routines perform a rank-2k matrix-matrix operation using symmetric matrices. The operation is
defined as
C := alpha*A*B' + alpha*B*A' + beta*C,
or
C := alpha*A'*B + alpha*B'*A + beta*C,
where:
alpha and beta are scalars,
C is an n-by-n symmetric matrix,
A and B are n-by-k matrices in the first case, and k-by-n matrices in the second case.
BLAS and Sparse BLAS Routines 2
133
Input Parameters
uplo CHARACTER*1. Specifies whether the upper or lower triangular part of the
array c is used.
If uplo = 'U' or 'u', then the upper triangular part of the array c is used.
If uplo = 'L' or 'l', then the low triangular part of the array c is used.
trans CHARACTER*1. Specifies the operation:
if trans = 'N' or 'n', then C := alpha*A*B'+alpha*B*A'+beta*C;
if trans = 'T' or 't', then C := alpha*A'*B +alpha*B'*A +beta*C;
if trans = 'C' or 'c', then C := alpha*A'*B +alpha*B'*A +beta*C.
n INTEGER. Specifies the order of the matrix C. The value of n must be at
least zero.
k INTEGER. On entry with trans = 'N' or 'n', k specifies the number of
columns of the matrices A and B, and on entry with trans = 'T' or 't' or
'C' or 'c', k specifies the number of rows of the matrices A and B. The
value of k must be at least zero.
alpha REAL for ssyr2k
DOUBLE PRECISION for dsyr2k
COMPLEX for csyr2k
DOUBLE COMPLEX for zsyr2k
Specifies the scalar alpha.
a REAL for ssyr2k
DOUBLE PRECISION for dsyr2k
COMPLEX for csyr2k
DOUBLE COMPLEX for zsyr2k
Array, DIMENSION (lda,ka), where ka is k when trans = 'N' or 'n',
and is n otherwise. Before entry with trans = 'N' or 'n', the leading nby-
k part of the array a must contain the matrix A, otherwise the leading kby-
n part of the array a must contain the matrix A.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When trans = 'N' or 'n', then lda must be at least
max(1, n), otherwise lda must be at least max(1, k).
b REAL for ssyr2k
DOUBLE PRECISION for dsyr2k
COMPLEX for csyr2k
DOUBLE COMPLEX for zsyr2k
Array, DIMENSION (ldb, kb) where kb is k when trans = 'N' or 'n' and
is 'n' otherwise. Before entry with trans = 'N' or 'n', the leading n-byk
part of the array b must contain the matrix B, otherwise the leading k-byn
part of the array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When trans = 'N' or 'n', then ldb must be at least
max(1, n), otherwise ldb must be at least max(1, k).
beta REAL for ssyr2k
DOUBLE PRECISION for dsyr2k
COMPLEX for csyr2k
DOUBLE COMPLEX for zsyr2k
Specifies the scalar beta.
c REAL for ssyr2k
DOUBLE PRECISION for dsyr2k
2 Intel® Math Kernel Library Reference Manual
134
COMPLEX for csyr2k
DOUBLE COMPLEX for zsyr2k
Array, DIMENSION (ldc,n). Before entry with uplo = 'U' or 'u', the
leading n-by-n upper triangular part of the array c must contain the upper
triangular part of the symmetric matrix and the strictly lower triangular part
of c is not referenced.
Before entry with uplo = 'L' or 'l', the leading n-by-n lower triangular
part of the array c must contain the lower triangular part of the symmetric
matrix and the strictly upper triangular part of c is not referenced.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program. The value of ldc must be at least max(1, n).
Output Parameters
c With uplo = 'U' or 'u', the upper triangular part of the array c is
overwritten by the upper triangular part of the updated matrix.
With uplo = 'L' or 'l', the lower triangular part of the array c is
overwritten by the lower triangular part of the updated matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine syr2k interface are the following:
a Holds the matrix A of size (ma,ka) where
ka = k if trans = 'N',
ka = n otherwise,
ma = n if trans = 'N',
ma = k otherwise.
b Holds the matrix B of size (mb,kb) where
kb = k if trans = 'N',
kb = n otherwise,
mb = n if trans = 'N',
mb = k otherwise.
c Holds the matrix C of size (n,n).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'.
The default value is 'N'.
alpha The default value is 1.
beta The default value is 0.
?trmm
Computes a scalar-matrix-matrix product (one matrix
operand is triangular).
Syntax
Fortran 77:
call strmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
call dtrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
BLAS and Sparse BLAS Routines 2
135
call ctrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
call ztrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
Fortran 95:
call trmm(a, b [,side] [, uplo] [,transa][,diag] [,alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?trmm routines perform a matrix-matrix operation using triangular matrices. The operation is defined as
B := alpha*op(A)*B
or
B := alpha*B*op(A)
where:
alpha is a scalar,
B is an m-by-n matrix,
A is a unit, or non-unit, upper or lower triangular matrix
op(A) is one of op(A) = A, or op(A) = A', or op(A) = conjg(A').
Input Parameters
side CHARACTER*1. Specifies whether op(A) appears on the left or right of B in
the operation:
if side = 'L' or 'l', then B := alpha*op(A)*B;
if side = 'R' or 'r', then B := alpha*B*op(A).
uplo CHARACTER*1. Specifies whether the matrix A is upper or lower triangular:
if uplo = 'U' or 'u', then the matrix is upper triangular;
if uplo = 'L' or 'l', then the matrix is low triangular.
transa CHARACTER*1. Specifies the form of op(A) used in the matrix
multiplication:
if transa = 'N' or 'n', then op(A) = A;
if transa = 'T' or 't', then op(A) = A';
if transa = 'C' or 'c', then op(A) = conjg(A').
diag CHARACTER*1. Specifies whether the matrix A is unit triangular:
if diag = 'U' or 'u' then the matrix is unit triangular;
if diag = 'N' or 'n', then the matrix is not unit triangular.
m INTEGER. Specifies the number of rows of B. The value of m must be at least
zero.
n INTEGER. Specifies the number of columns of B. The value of n must be at
least zero.
alpha REAL for strmm
DOUBLE PRECISION for dtrmm
COMPLEX for ctrmm
DOUBLE COMPLEX for ztrmm
Specifies the scalar alpha.
2 Intel® Math Kernel Library Reference Manual
136
When alpha is zero, then a is not referenced and b need not be set before
entry.
a REAL for strmm
DOUBLE PRECISION for dtrmm
COMPLEX for ctrmm
DOUBLE COMPLEX for ztrmm
Array, DIMENSION (lda,k), where k is m when side = 'L' or 'l' and is n
when side = 'R' or 'r'. Before entry with uplo = 'U' or 'u', the
leading k by k upper triangular part of the array a must contain the upper
triangular matrix and the strictly lower triangular part of a is not
referenced.
Before entry with uplo = 'L' or 'l', the leading k by k lower triangular
part of the array a must contain the lower triangular matrix and the strictly
upper triangular part of a is not referenced.
When diag = 'U' or 'u', the diagonal elements of a are not referenced
either, but are assumed to be unity.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When side = 'L' or 'l', then lda must be at least
max(1, m), when side = 'R' or 'r', then lda must be at least max(1,
n).
b REAL for strmm
DOUBLE PRECISION for dtrmm
COMPLEX for ctrmm
DOUBLE COMPLEX for ztrmm
Array, DIMENSION (ldb,n).
Before entry, the leading m-by-n part of the array b must contain the matrix
B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program. The value of ldb must be at least max(1, m).
Output Parameters
b Overwritten by the transformed matrix.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine trmm interface are the following:
a Holds the matrix A of size (k,k) where
k = m if side = 'L',
k = n otherwise.
b Holds the matrix B of size (m,n).
side Must be 'L' or 'R'. The default value is 'L'.
uplo Must be 'U' or 'L'. The default value is 'U'.
transa Must be 'N', 'C', or 'T'.
The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
alpha The default value is 1.
BLAS and Sparse BLAS Routines 2
137
?trsm
Solves a matrix equation (one matrix operand is
triangular).
Syntax
Fortran 77:
call strsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
call dtrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
call ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
call ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
Fortran 95:
call trsm(a, b [,side] [, uplo] [,transa][,diag] [,alpha])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?trsm routines solve one of the following matrix equations:
op(A)*X = alpha*B,
or
X*op(A) = alpha*B,
where:
alpha is a scalar,
X and B are m-by-n matrices,
A is a unit, or non-unit, upper or lower triangular matrix
op(A) is one of op(A) = A, or op(A) = A', or op(A) = conjg(A').
The matrix B is overwritten by the solution matrix X.
Input Parameters
side CHARACTER*1. Specifies whether op(A) appears on the left or right of X in
the equation:
if side = 'L' or 'l', then op(A)*X = alpha*B;
if side = 'R' or 'r', then X*op(A) = alpha*B.
uplo CHARACTER*1. Specifies whether the matrix A is upper or lower triangular:
if uplo = 'U' or 'u', then the matrix is upper triangular;
if uplo = 'L' or 'l', then the matrix is low triangular.
transa CHARACTER*1. Specifies the form of op(A) used in the matrix
multiplication:
if transa = 'N' or 'n', then op(A) = A;
if transa = 'T' or 't', then op(A) = A';
if transa = 'C' or 'c', then op(A) = conjg(A').
diag CHARACTER*1. Specifies whether the matrix A is unit triangular:
2 Intel® Math Kernel Library Reference Manual
138
if diag = 'U' or 'u' then the matrix is unit triangular;
if diag = 'N' or 'n', then the matrix is not unit triangular.
m INTEGER. Specifies the number of rows of B. The value of m must be at least
zero.
n INTEGER. Specifies the number of columns of B. The value of n must be at
least zero.
alpha REAL for strsm
DOUBLE PRECISION for dtrsm
COMPLEX for ctrsm
DOUBLE COMPLEX for ztrsm
Specifies the scalar alpha.
When alpha is zero, then a is not referenced and b need not be set before
entry.
a REAL for strsm
DOUBLE PRECISION for dtrsm
COMPLEX for ctrsm
DOUBLE COMPLEX for ztrsm
Array, DIMENSION (lda, k), where k is m when side = 'L' or 'l' and is
n when side = 'R' or 'r'. Before entry with uplo = 'U' or 'u', the
leading k by k upper triangular part of the array a must contain the upper
triangular matrix and the strictly lower triangular part of a is not
referenced.
Before entry with uplo = 'L' or 'l', the leading k by k lower triangular
part of the array a must contain the lower triangular matrix and the strictly
upper triangular part of a is not referenced.
When diag = 'U' or 'u', the diagonal elements of a are not referenced
either, but are assumed to be unity.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When side = 'L' or 'l', then lda must be at least
max(1, m), when side = 'R' or 'r', then lda must be at least max(1,
n).
b REAL for strsm
DOUBLE PRECISION for dtrsm
COMPLEX for ctrsm
DOUBLE COMPLEX for ztrsm
Array, DIMENSION (ldb,n). Before entry, the leading m-by-n part of the
array b must contain the right-hand side matrix B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program. The value of ldb must be at least max(1, +m).
Output Parameters
b Overwritten by the solution matrix X.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine trsm interface are the following:
a Holds the matrix A of size (k,k) where k = m if side = 'L', k = n
otherwise.
BLAS and Sparse BLAS Routines 2
139
b Holds the matrix B of size (m,n).
side Must be 'L' or 'R'. The default value is 'L'.
uplo Must be 'U' or 'L'. The default value is 'U'.
transa Must be 'N', 'C', or 'T'.
The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
alpha The default value is 1.
Sparse BLAS Level 1 Routines
This section describes Sparse BLAS Level 1, an extension of BLAS Level 1 included in the Intel® Math Kernel
Library beginning with the Intel MKL release 2.1. Sparse BLAS Level 1 is a group of routines and functions
that perform a number of common vector operations on sparse vectors stored in compressed form.
Sparse vectors are those in which the majority of elements are zeros. Sparse BLAS routines and functions
are specially implemented to take advantage of vector sparsity. This allows you to achieve large savings in
computer time and memory. If nz is the number of non-zero vector elements, the computer time taken by
Sparse BLAS operations will be O(nz).
Vector Arguments
Compressed sparse vectors. Let a be a vector stored in an array, and assume that the only non-zero
elements of a are the following:
a(k1), a (k2), a (k3) . . . a(knz),
where nz is the total number of non-zero elements in a.
In Sparse BLAS, this vector can be represented in compressed form by two FORTRAN arrays, x (values) and
indx (indices). Each array has nz elements:
x(1)=a(k1), x(2)=a(k2), . . . x(nz)= a(knz),
indx(1)=k1, indx(2)=k2, . . . indx(nz)= knz.
Thus, a sparse vector is fully determined by the triple (nz, x, indx). If you pass a negative or zero value of
nz to Sparse BLAS, the subroutines do not modify any arrays or variables.
Full-storage vectors. Sparse BLAS routines can also use a vector argument fully stored in a single
FORTRAN array (a full-storage vector). If y is a full-storage vector, its elements must be stored contiguously:
the first element in y(1), the second in y(2), and so on. This corresponds to an increment incy = 1 in
BLAS Level 1. No increment value for full-storage vectors is passed as an argument to Sparse BLAS routines
or functions.
Naming Conventions
Similar to BLAS, the names of Sparse BLAS subprograms have prefixes that determine the data type
involved: s and d for single- and double-precision real; c and z for single- and double-precision complex
respectively.
If a Sparse BLAS routine is an extension of a "dense" one, the subprogram name is formed by appending the
suffix i (standing for indexed) to the name of the corresponding "dense" subprogram. For example, the
Sparse BLAS routine saxpyi corresponds to the BLAS routine saxpy, and the Sparse BLAS function cdotci
corresponds to the BLAS function cdotc.
2 Intel® Math Kernel Library Reference Manual
140
Routines and Data Types
Routines and data types supported in the Intel MKL implementation of Sparse BLAS are listed in Table
“Sparse BLAS Routines and Their Data Types”.
Sparse BLAS Routines and Their Data Types
Routine/
Function
Data Types Description
?axpyi s, d, c, z Scalar-vector product plus vector (routines)
?doti s, d Dot product (functions)
?dotci c, z Complex dot product conjugated (functions)
?dotui c, z Complex dot product unconjugated (functions)
?gthr s, d, c, z Gathering a full-storage sparse vector into compressed
form nz, x, indx (routines)
?gthrz s, d, c, z Gathering a full-storage sparse vector into compressed
form and assigning zeros to gathered elements in the fullstorage
vector (routines)
?roti s, d Givens rotation (routines)
?sctr s, d, c, z Scattering a vector from compressed form to full-storage
form (routines)
BLAS Level 1 Routines That Can Work With Sparse Vectors
The following BLAS Level 1 routines will give correct results when you pass to them a compressed-form array
x(with the increment incx=1):
?asum sum of absolute values of vector elements
?copy copying a vector
?nrm2 Euclidean norm of a vector
?scal scaling a vector
i?amax index of the element with the largest absolute value for real flavors, or the
largest sum |Re(x(i))|+|Im(x(i))| for complex flavors.
i?amin index of the element with the smallest absolute value for real flavors, or the
smallest sum |Re(x(i))|+|Im(x(i))| for complex flavors.
The result i returned by i?amax and i?amin should be interpreted as index in the compressed-form array,
so that the largest (smallest) value is x(i); the corresponding index in full-storage array is indx(i).
You can also call ?rotg to compute the parameters of Givens rotation and then pass these parameters to the
Sparse BLAS routines ?roti.
?axpyi
Adds a scalar multiple of compressed sparse vector to
a full-storage vector.
Syntax
Fortran 77:
call saxpyi(nz, a, x, indx, y)
BLAS and Sparse BLAS Routines 2
141
call daxpyi(nz, a, x, indx, y)
call caxpyi(nz, a, x, indx, y)
call zaxpyi(nz, a, x, indx, y)
Fortran 95:
call axpyi(x, indx, y [, a])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?axpyi routines perform a vector-vector operation defined as
y := a*x + y
where:
a is a scalar,
x is a sparse vector stored in compressed form,
y is a vector in full storage form.
The ?axpyi routines reference or modify only the elements of y whose indices are listed in the array indx.
The values in indx must be distinct.
Input Parameters
nz INTEGER. The number of elements in x and indx.
a REAL for saxpyi
DOUBLE PRECISION for daxpyi
COMPLEX for caxpyi
DOUBLE COMPLEX for zaxpyi
Specifies the scalar a.
x REAL for saxpyi
DOUBLE PRECISION for daxpyi
COMPLEX for caxpyi
DOUBLE COMPLEX for zaxpyi
Array, DIMENSION at least nz.
indx INTEGER. Specifies the indices for the elements of x.
Array, DIMENSION at least nz.
y REAL for saxpyi
DOUBLE PRECISION for daxpyi
COMPLEX for caxpyi
DOUBLE COMPLEX for zaxpyi
Array, DIMENSION at least max(indx(i)).
Output Parameters
y Contains the updated vector y.
2 Intel® Math Kernel Library Reference Manual
142
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine axpyi interface are the following:
x Holds the vector with the number of elements nz.
indx Holds the vector with the number of elements nz.
y Holds the vector with the number of elements nz.
a The default value is 1.
?doti
Computes the dot product of a compressed sparse real
vector by a full-storage real vector.
Syntax
Fortran 77:
res = sdoti(nz, x, indx, y )
res = ddoti(nz, x, indx, y )
Fortran 95:
res = doti(x, indx, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?doti routines return the dot product of x and y defined as
res = x(1)*y(indx(1)) + x(2)*y(indx(2)) +...+ x(nz)*y(indx(nz))
where the triple (nz, x, indx) defines a sparse real vector stored in compressed form, and y is a real vector
in full storage form. The functions reference only the elements of y whose indices are listed in the array
indx. The values in indx must be distinct.
Input Parameters
nz INTEGER. The number of elements in x and indx .
x REAL for sdoti
DOUBLE PRECISION for ddoti
Array, DIMENSION at least nz.
indx INTEGER. Specifies the indices for the elements of x.
Array, DIMENSION at least nz.
y REAL for sdoti
DOUBLE PRECISION for ddoti
Array, DIMENSION at least max(indx(i)).
BLAS and Sparse BLAS Routines 2
143
Output Parameters
res REAL for sdoti
DOUBLE PRECISION for ddoti
Contains the dot product of x and y, if nz is positive. Otherwise, res
contains 0.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine doti interface are the following:
x Holds the vector with the number of elements nz.
indx Holds the vector with the number of elements nz.
y Holds the vector with the number of elements nz.
?dotci
Computes the conjugated dot product of a
compressed sparse complex vector with a full-storage
complex vector.
Syntax
Fortran 77:
res = cdotci(nz, x, indx, y )
res = zdotci(nz, x, indx, y )
Fortran 95:
res = dotci(x, indx, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?dotci routines return the dot product of x and y defined as
conjg(x(1))*y(indx(1)) + ... + conjg(x(nz))*y(indx(nz))
where the triple (nz, x, indx) defines a sparse complex vector stored in compressed form, and y is a real
vector in full storage form. The functions reference only the elements of y whose indices are listed in the
array indx. The values in indx must be distinct.
Input Parameters
nz INTEGER. The number of elements in x and indx .
x COMPLEX for cdotci
DOUBLE COMPLEX for zdotci
Array, DIMENSION at least nz.
indx INTEGER. Specifies the indices for the elements of x.
2 Intel® Math Kernel Library Reference Manual
144
Array, DIMENSION at least nz.
y COMPLEX for cdotci
DOUBLE COMPLEX for zdotci
Array, DIMENSION at least max(indx(i)).
Output Parameters
res COMPLEX for cdotci
DOUBLE COMPLEX for zdotci
Contains the conjugated dot product of x and y, if nz is positive. Otherwise,
res contains 0.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine dotci interface are the following:
x Holds the vector with the number of elements (nz).
indx Holds the vector with the number of elements (nz).
y Holds the vector with the number of elements (nz).
?dotui
Computes the dot product of a compressed sparse
complex vector by a full-storage complex vector.
Syntax
Fortran 77:
res = cdotui(nz, x, indx, y )
res = zdotui(nz, x, indx, y )
Fortran 95:
res = dotui(x, indx, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?dotui routines return the dot product of x and y defined as
res = x(1)*y(indx(1)) + x(2)*y(indx(2)) +...+ x(nz)*y(indx(nz))
where the triple (nz, x, indx) defines a sparse complex vector stored in compressed form, and y is a real
vector in full storage form. The functions reference only the elements of y whose indices are listed in the
array indx. The values in indx must be distinct.
Input Parameters
nz INTEGER. The number of elements in x and indx .
BLAS and Sparse BLAS Routines 2
145
x COMPLEX for cdotui
DOUBLE COMPLEX for zdotui
Array, DIMENSION at least nz.
indx INTEGER. Specifies the indices for the elements of x.
Array, DIMENSION at least nz.
y COMPLEX for cdotui
DOUBLE COMPLEX for zdotui
Array, DIMENSION at least max(indx(i)).
Output Parameters
res COMPLEX for cdotui
DOUBLE COMPLEX for zdotui
Contains the dot product of x and y, if nz is positive. Otherwise, res
contains 0.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine dotui interface are the following:
x Holds the vector with the number of elements nz.
indx Holds the vector with the number of elements nz.
y Holds the vector with the number of elements nz.
?gthr
Gathers a full-storage sparse vector's elements into
compressed form.
Syntax
Fortran 77:
call sgthr(nz, y, x, indx )
call dgthr(nz, y, x, indx )
call cgthr(nz, y, x, indx )
call zgthr(nz, y, x, indx )
Fortran 95:
res = gthr(x, indx, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?gthr routines gather the specified elements of a full-storage sparse vector y into compressed form(nz,
x, indx). The routines reference only the elements of y whose indices are listed in the array indx:
2 Intel® Math Kernel Library Reference Manual
146
x(i) = y(indx(i)), for i=1,2,... +nz.
Input Parameters
nz INTEGER. The number of elements of y to be gathered.
indx INTEGER. Specifies indices of elements to be gathered.
Array, DIMENSION at least nz.
y REAL for sgthr
DOUBLE PRECISION for dgthr
COMPLEX for cgthr
DOUBLE COMPLEX for zgthr
Array, DIMENSION at least max(indx(i)).
Output Parameters
x REAL for sgthr
DOUBLE PRECISION for dgthr
COMPLEX for cgthr
DOUBLE COMPLEX for zgthr
Array, DIMENSION at least nz.
Contains the vector converted to the compressed form.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gthr interface are the following:
x Holds the vector with the number of elements nz.
indx Holds the vector with the number of elements nz.
y Holds the vector with the number of elements nz.
?gthrz
Gathers a sparse vector's elements into compressed
form, replacing them by zeros.
Syntax
Fortran 77:
call sgthrz(nz, y, x, indx )
call dgthrz(nz, y, x, indx )
call cgthrz(nz, y, x, indx )
call zgthrz(nz, y, x, indx )
Fortran 95:
res = gthrz(x, indx, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
BLAS and Sparse BLAS Routines 2
147
Description
The ?gthrz routines gather the elements with indices specified by the array indx from a full-storage vector
y into compressed form (nz, x, indx) and overwrite the gathered elements of y by zeros. Other elements of
y are not referenced or modified (see also ?gthr).
Input Parameters
nz INTEGER. The number of elements of y to be gathered.
indx INTEGER. Specifies indices of elements to be gathered.
Array, DIMENSION at least nz.
y REAL for sgthrz
DOUBLE PRECISION for dgthrz
COMPLEX for cgthrz
DOUBLE COMPLEX for zgthrz
Array, DIMENSION at least max(indx(i)).
Output Parameters
x REAL for sgthrz
DOUBLE PRECISION for d gthrz
COMPLEX for cgthrz
DOUBLE COMPLEX for zgthrz
Array, DIMENSION at least nz.
Contains the vector converted to the compressed form.
y The updated vector y.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gthrz interface are the following:
x Holds the vector with the number of elements nz.
indx Holds the vector with the number of elements nz.
y Holds the vector with the number of elements nz.
?roti
Applies Givens rotation to sparse vectors one of which
is in compressed form.
Syntax
Fortran 77:
call sroti(nz, x, indx, y, c, s)
call droti(nz, x, indx, y, c, s)
Fortran 95:
call roti(x, indx, y, c, s)
Include Files
• FORTRAN 77: mkl_blas.fi
2 Intel® Math Kernel Library Reference Manual
148
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?roti routines apply the Givens rotation to elements of two real vectors, x (in compressed form nz, x,
indx) and y (in full storage form):
x(i) = c*x(i) + s*y(indx(i))
y(indx(i)) = c*y(indx(i))- s*x(i)
The routines reference only the elements of y whose indices are listed in the array indx. The values in indx
must be distinct.
Input Parameters
nz INTEGER. The number of elements in x and indx.
x REAL for sroti
DOUBLE PRECISION for droti
Array, DIMENSION at least nz.
indx INTEGER. Specifies the indices for the elements of x.
Array, DIMENSION at least nz.
y REAL for sroti
DOUBLE PRECISION for droti
Array, DIMENSION at least max(indx(i)).
c A scalar: REAL for sroti
DOUBLE PRECISION for droti.
s A scalar: REAL for sroti
DOUBLE PRECISION for droti.
Output Parameters
x and y The updated arrays.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine roti interface are the following:
x Holds the vector with the number of elements nz.
indx Holds the vector with the number of elements nz.
y Holds the vector with the number of elements nz.
?sctr
Converts compressed sparse vectors into full storage
form.
Syntax
Fortran 77:
call ssctr(nz, x, indx, y )
call dsctr(nz, x, indx, y )
BLAS and Sparse BLAS Routines 2
149
call csctr(nz, x, indx, y )
call zsctr(nz, x, indx, y )
Fortran 95:
call sctr(x, indx, y)
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?sctr routines scatter the elements of the compressed sparse vector (nz, x, indx) to a full-storage
vector y. The routines modify only the elements of y whose indices are listed in the array indx:
y(indx(i) = x(i), for i=1,2,... +nz.
Input Parameters
nz INTEGER. The number of elements of x to be scattered.
indx INTEGER. Specifies indices of elements to be scattered.
Array, DIMENSION at least nz.
x REAL for ssctr
DOUBLE PRECISION for dsctr
COMPLEX for csctr
DOUBLE COMPLEX for zsctr
Array, DIMENSION at least nz.
Contains the vector to be converted to full-storage form.
Output Parameters
y REAL for ssctr
DOUBLE PRECISION for dsctr
COMPLEX for csctr
DOUBLE COMPLEX for zsctr
Array, DIMENSION at least max(indx(i)).
Contains the vector y with updated elements.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sctr interface are the following:
x Holds the vector with the number of elements nz.
indx Holds the vector with the number of elements nz.
y Holds the vector with the number of elements nz.
2 Intel® Math Kernel Library Reference Manual
150
Sparse BLAS Level 2 and Level 3 Routines
This section describes Sparse BLAS Level 2 and Level 3 routines included in the Intel® Math Kernel Library
(Intel® MKL) . Sparse BLAS Level 2 is a group of routines and functions that perform operations between a
sparse matrix and dense vectors. Sparse BLAS Level 3 is a group of routines and functions that perform
operations between a sparse matrix and dense matrices.
The terms and concepts required to understand the use of the Intel MKL Sparse BLAS Level 2 and Level 3
routines are discussed in the Linear Solvers Basics appendix.
The Sparse BLAS routines can be useful to implement iterative methods for solving large sparse systems of
equations or eigenvalue problems. For example, these routines can be considered as building blocks for
Iterative Sparse Solvers based on Reverse Communication Interface (RCI ISS) described in the Chapter 8 of
the manual.
Intel MKL provides Sparse BLAS Level 2 and Level 3 routines with typical (or conventional) interface similar
to the interface used in the NIST* Sparse BLAS library [Rem05].
Some software packages and libraries (the PARDISO* Solver used in Intel MKL, Sparskit 2 [Saad94], the
Compaq* Extended Math Library (CXML)[CXML01]) use different (early) variation of the compressed sparse
row (CSR) format and support only Level 2 operations with simplified interfaces. Intel MKL provides an
additional set of Sparse BLAS Level 2 routines with similar simplified interfaces. Each of these routines
operates only on a matrix of the fixed type.
The routines described in this section support both one-based indexing and zero-based indexing of the input
data (see details in the section One-based and Zero-based Indexing).
Naming Conventions in Sparse BLAS Level 2 and Level 3
Each Sparse BLAS Level 2 and Level 3 routine has a six- or eight-character base name preceded by the
prefix mkl_ or mkl_cspblas_ .
The routines with typical (conventional) interface have six-character base names in accordance with the
template:
mkl_ ( )
The routines with simplified interfaces have eight-character base names in accordance with the templates:
mkl_ ( )
for routines with one-based indexing; and
mkl_cspblas_ ( )
for routines with zero-based indexing.
The field indicates the data type:
s real, single precision
c complex, single precision
d real, double precision
z complex, double precision
The field indicates the sparse matrix storage format (see section Sparse Matrix Storage Formats):
coo coordinate format
csr compressed sparse row format and its variations
csc compressed sparse column format and its variations
dia diagonal format
sky skyline storage format
bsr block sparse row format and its variations
The field indicates the type of operation:
BLAS and Sparse BLAS Routines 2
151
mv matrix-vector product (Level 2)
mm matrix-matrix product (Level 3)
sv solving a single triangular system (Level 2)
sm solving triangular systems with multiple right-hand sides (Level 3)
The field indicates the matrix type:
ge sparse representation of a general matrix
sy sparse representation of the upper or lower triangle of a symmetric matrix
tr sparse representation of a triangular matrix
Sparse Matrix Storage Formats
The current version of Intel MKL Sparse BLAS Level 2 and Level 3 routines support the following point entry
[Duff86] storage formats for sparse matrices:
• compressed sparse row format (CSR) and its variations;
• compressed sparse column format (CSC);
• coordinate format;
• diagonal format;
• skyline storage format;
and one block entry storage format:
• block sparse row format (BSR) and its variations.
For more information see "Sparse Matrix Storage Formats" in Appendix A.
Intel MKL provides auxiliary routines - matrix converters - that convert sparse matrix from one storage
format to another.
Routines and Supported Operations
This section describes operations supported by the Intel MKL Sparse BLAS Level 2 and Level 3 routines. The
following notations are used here:
A is a sparse matrix;
B and C are dense matrices;
D is a diagonal scaling matrix;
x and y are dense vectors;
alpha and beta are scalars;
op(A) is one of the possible operations:
op(A) = A;
op(A) = A' - transpose of A;
op(A) = conj(A') - conjugated transpose of A.
inv(op(A)) denotes the inverse of op(A).
The Intel MKL Sparse BLAS Level 2 and Level 3 routines support the following operations:
• computing the vector product between a sparse matrix and a dense vector:
y := alpha*op(A)*x + beta*y
• solving a single triangular system:
y := alpha*inv(op(A))*x
2 Intel® Math Kernel Library Reference Manual
152
• computing a product between sparse matrix and dense matrix:
C := alpha*op(A)*B + beta*C
• solving a sparse triangular system with multiple right-hand sides:
C := alpha*inv(op(A))*B
Intel MKL provides an additional set of the Sparse BLAS Level 2 routines with simplified interfaces. Each of
these routines operates on a matrix of the fixed type. The following operations are supported:
• computing the vector product between a sparse matrix and a dense vector (for general and symmetric
matrices):
y := op(A)*x
• solving a single triangular system (for triangular matrices):
y := inv(op(A))*x
Matrix type is indicated by the field in the routine name (see section Naming Conventions in Sparse
BLAS Level 2 and Level 3).
NOTE The routines with simplified interfaces support only four sparse matrix storage formats,
specifically:
CSR format in the 3-array variation accepted in the direct sparse solvers and in the CXML;
diagonal format accepted in the CXML;
coordinate format;
BSR format in the 3-array variation.
Note that routines with both typical (conventional) and simplified interfaces use the same computational
kernels that work with certain internal data structures.
The Intel MKL Sparse BLAS Level 2 and Level 3 routines do not support in-place operations.
Complete list of all routines is given in the “Sparse BLAS Level 2 and Level 3 Routines”.
Interface Consideration
One-Based and Zero-Based Indexing
The Intel MKL Sparse BLAS Level 2 and Level 3 routines support one-based and zero-based indexing of data
arrays.
Routines with typical interfaces support zero-based indexing for the following sparse data storage formats:
CSR, CSC, BSR, and COO. Routines with simplified interfaces support zero based indexing for the following
sparse data storage formats: CSR, BSR, and COO. See the complete list of Sparse BLAS Level 2 and Level 3
Routines.
The one-based indexing uses the convention of starting array indices at 1. The zero-based indexing uses the
convention of starting array indices at 0. For example, indices of the 5-element array x can be presented in
case of one-based indexing as follows:
Element index: 1 2 3 4 5
Element value: 1.0 5.0 7.0 8.0 9.0
and in case of zero-based indexing as follows:
Element index: 0 1 2 3 4
Element value: 1.0 5.0 7.0 8.0 9.0
The detailed descriptions of the one-based and zero-based variants of the sparse data storage formats are
given in the "Sparse Matrix Storage Formats" in Appendix A.
BLAS and Sparse BLAS Routines 2
153
Most parameters of the routines are identical for both one-based and zero-based indexing, but some of them
have certain differences. The following table lists all these differences.
Parameter One-based Indexing Zero-based Indexing
val Array containing non-zero elements of
the matrix A, its length is pntre(m) -
pntrb(1).
Array containing non-zero elements of
the matrix A, its length is pntre(m—1)
- pntrb(0).
pntrb Array of length m. This array contains
row indices, such that pntrb(i) -
pntrb(1)+1 is the first index of row i
in the arrays val and indx
Array of length m. This array contains
row indices, such that pntrb(i) -
pntrb(0) is the first index of row i in
the arrays val and indx.
pntre Array of length m. This array contains
row indices, such that pntre(I) -
pntrb(1) is the last index of row i in
the arrays val and indx.
Array of length m. This array contains
row indices, such that pntre(i) -
pntrb(0)-1 is the last index of row i
in the arrays val and indx.
ia Array of length m + 1, containing
indices of elements in the array a,
such that ia(i) is the index in the
array a of the first non-zero element
from the row i. The value of the last
element ia(m + 1) is equal to the
number of non-zeros plus one.
Array of length m+1, containing indices
of elements in the array a, such that
ia(i) is the index in the array a of
the first non-zero element from the
row i. The value of the last element
ia(m) is equal to the number of nonzeros.
ldb Specifies the leading dimension of b as
declared in the calling (sub)program.
Specifies the second dimension of b as
declared in the calling (sub)program.
ldc Specifies the leading dimension of c as
declared in the calling (sub)program.
Specifies the second dimension of c as
declared in the calling (sub)program.
Difference Between Fortran and C Interfaces
Intel MKL provides both Fortran and C interfaces to all Sparse BLAS Level 2 and Level 3 routines. Parameter
descriptions are common for both interfaces with the exception of data types that refer to the FORTRAN 77
standard types. Correspondence between data types specific to the Fortran and C interfaces are given below:
Fortran C
REAL*4 float
REAL*8 double
INTEGER*4 int
INTEGER*8 long long int
CHARACTER char
For routines with C interfaces all parameters (including scalars) must be passed by references.
Another difference is how two-dimensional arrays are represented. In Fortran the column-major order is
used, and in C - row-major order. This changes the meaning of the parameters ldb and ldc (see the table
above).
Differences Between Intel MKL and NIST* Interfaces
The Intel MKL Sparse BLAS Level 3 routines have the following conventional interfaces:
2 Intel® Math Kernel Library Reference Manual
154
mkl_xyyymm(transa, m, n, k, alpha, matdescra, arg(A), b, ldb, beta, c, ldc), for matrixmatrix
product;
mkl_xyyysm(transa, m, n, alpha, matdescra, arg(A), b, ldb, c, ldc), for triangular solvers
with multiple right-hand sides.
Here x denotes data type, and yyy - sparse matrix data structure (storage format).
The analogous NIST* Sparse BLAS (NSB) library routines have the following interfaces:
xyyymm(transa, m, n, k, alpha, descra, arg(A), b, ldb, beta, c, ldc, work, lwork), for
matrix-matrix product;
xyyysm(transa, m, n, unitd, dv, alpha, descra, arg(A), b, ldb, beta, c, ldc, work,
lwork), for triangular solvers with multiple right-hand sides.
Some similar arguments are used in both libraries. The argument transa indicates what operation is
performed and is slightly different in the NSB library (see Table “Parameter transa”). The arguments m and
k are the number of rows and column in the matrix A, respectively, n is the number of columns in the matrix
C. The arguments alpha and beta are scalar alpha and beta respectively (beta is not used in the Intel MKL
triangular solvers.) The arguments b and c are rectangular arrays with the leading dimension ldb and ldc,
respectively. arg(A) denotes the list of arguments that describe the sparse representation of A.
Parameter transa
MKL interface NSB interface Operation
data type CHARACTER*1 INTEGER
value N or n 0 op(A) = A
T or t 1 op(A) = A'
C or c 2 op(A) = A'
Parameter matdescra
The parameter matdescra describes the relevant characteristic of the matrix A. This manual describes
matdescra as an array of six elements in line with the NIST* implementation. However, only the first four
elements of the array are used in the current versions of the Intel MKL Sparse BLAS routines. Elements
matdescra(5) and matdescra(6) are reserved for future use. Note that whether matdescra is described in
your application as an array of length 6 or 4 is of no importance because the array is declared as a pointer in
the Intel MKL routines. To learn more about declaration of the matdescra array, see Sparse BLAS examples
located in the following subdirectory of the Intel MKL installation directory: examples/spblas/. The table
below lists elements of the parameter matdescra, their values and meanings. The parameter matdescra
corresponds to the argument descra from NSB library.
Possible Values of the Parameter matdescra (descra)
MKL interface NSB
interface
Matrix characteristics
one-based
indexing
zero-based
indexing
data type CHARACTER Char INTEGER
1st element matdescra(1) matdescra(0) descra(1) matrix structure
value G G 0 general
S S 1 symmetric (A = A')
BLAS and Sparse BLAS Routines 2
155
MKL interface NSB
interface
Matrix characteristics
H H 2 Hermitian (A=conjg(A'))
T T 3 triangular
A A 4 skew(anti)-symmetric (A=-A')
D D 5 diagonal
2nd element matdescra(2) matdescra(1) descra(2) upper/lower triangular indicator
value L L 1 lower
U U 2 upper
3rd element matdescra(3) matdescra(2) descra(3) main diagonal type
value N N 0 non-unit
U U 1 unit
4th element matdescra(4) matdescra(3) type of indexing
value F one-based indexing
C zero-based indexing
In some cases possible element values of the parameter matdescra depend on the values of other elements.
The Table "Possible Combinations of Element Values of the Parameter matdescra" lists all possible
combinations of element values for both multiplication routines and triangular solvers.
Possible Combinations of Element Values of the Parameter matdescra
Routines matdescra(1) matdescra(2) matdescra(3) matdescra(4)
Multiplication
Routines
G ignored ignored F (default) or C
S or H L (default) N (default) F (default) or C
S or H L (default) U F (default) or C
S or H U N (default) F (default) or C
S or H U U F (default) or C
A L (default) ignored F (default) or C
A U ignored F (default) or C
Multiplication
Routines and
Triangular Solvers
T L U F (default) or C
T L N F (default) or C
T U U F (default) or C
T U N F (default) or C
D ignored N (default) F (default) or C
D ignored U F (default) or C
For a matrix in the skyline format with the main diagonal declared to be a unit, diagonal elements must be
stored in the sparse representation even if they are zero. In all other formats, diagonal elements can be
stored (if needed) in the sparse representation if they are not zero.
2 Intel® Math Kernel Library Reference Manual
156
Operations with Partial Matrices
One of the distinctive feature of the Intel MKL Sparse BLAS routines is a possibility to perform operations
only on partial matrices composed of certain parts (triangles and the main diagonal) of the input sparse
matrix. It can be done by setting properly first three elements of the parameter matdescra.
An arbitrary sparse matrix A can be decomposed as
A = L + D + U
where L is the strict lower triangle of A, U is the strict upper triangle of A, D is the main diagonal.
Table "Output Matrices for Multiplication Routines" shows correspondence between the output matrices and
values of the parameter matdescra for the sparse matrix A for multiplication routines.
Output Matrices for Multiplication Routines
matdescra(1) matdescra(2) matdescra(3) Output Matrix
G ignored ignored alpha*op(A)*x + beta*y
alpha*op(A)*B + beta*C
S or H L N alpha*op(L+D+L')*x + beta*y
alpha*op(L+D+L')*B + beta*C
S or H L U alpha*op(L+I+L')*x + beta*y
alpha*op(L+I+L')*B + beta*C
S or H U N alpha*op(U'+D+U)*x + beta*y
alpha*op(U'+D+U)*B + beta*C
S or H U U alpha*op(U'+I+U)*x + beta*y
alpha*op(U'+I+U)*B + beta*C
T L U alpha*op(L+I)*x + beta*y
alpha*op(L+I)*B + beta*C
T L N alpha*op(L+D)*x + beta*y
alpha*op(L+D)*B + beta*C
T U U alpha*op(U+I)*x + beta*y
alpha*op(U+I)*B + beta*C
T U N alpha*op(U+D)*x + beta*y
alpha*op(U+D)*B + beta*C
A L ignored alpha*op(L-L')*x + beta*y
alpha*op(L-L')*B + beta*C
A U ignored alpha*op(U-U')*x + beta*y
alpha*op(U-U')*B + beta*C
D ignored N alpha*D*x + beta*y
alpha*D*B + beta*C
D ignored U alpha*x + beta*y
alpha*B + beta*C
Table “Output Matrices for Triangular Solvers” shows correspondence between the output matrices and
values of the parameter matdescra for the sparse matrix A for triangular solvers.
BLAS and Sparse BLAS Routines 2
157
Output Matrices for Triangular Solvers
matdescra(1) matdescra(2) matdescra(3) Output Matrix
T L N alpha*inv(op(L+L))*x
alpha*inv(op(L+L))*B
T L U alpha*inv(op(L+L))*x
alpha*inv(op(L+L))*B
T U N alpha*inv(op(U+U))*x
alpha*inv(op(U+U))*B
T U U alpha*inv(op(U+U))*x
alpha*inv(op(U+U))*B
D ignored N alpha*inv(D)*x
alpha*inv(D)*B
D ignored U alpha*x
alpha*B
Sparse BLAS Level 2 and Level 3 Routines.
Table “Sparse BLAS Level 2 and Level 3 Routines” lists the sparse BLAS Level 2 and Level 3 routines
described in more detail later in this section.
Sparse BLAS Level 2 and Level 3 Routines
Routine/Function Description
Simplified interface, one-based indexing
mkl_?csrgemv Computes matrix - vector product of a sparse general matrix
in the CSR format (3-array variation)
mkl_?bsrgemv Computes matrix - vector product of a sparse general matrix
in the BSR format (3-array variation).
mkl_?coogemv Computes matrix - vector product of a sparse general matrix
in the coordinate format.
mkl_?diagemv Computes matrix - vector product of a sparse general matrix
in the diagonal format.
mkl_?csrsymv Computes matrix - vector product of a sparse symmetrical
matrix in the CSR format (3-array variation)
mkl_?bsrsymv Computes matrix - vector product of a sparse symmetrical
matrix in the BSR format (3-array variation).
mkl_?coosymv Computes matrix - vector product of a sparse symmetrical
matrix in the coordinate format.
mkl_?diasymv Computes matrix - vector product of a sparse symmetrical
matrix in the diagonal format.
mkl_?csrtrsv Triangular solvers with simplified interface for a sparse matrix
in the CSR format (3-array variation).
2 Intel® Math Kernel Library Reference Manual
158
Routine/Function Description
mkl_?bsrtrsv Triangular solver with simplified interface for a sparse matrix
in the BSR format (3-array variation).
mkl_?cootrsv Triangular solvers with simplified interface for a sparse matrix
in the coordinate format.
mkl_?diatrsv Triangular solvers with simplified interface for a sparse matrix
in the diagonal format.
Simplified interface, zero-based indexing
mkl_cspblas_?csrgemv Computes matrix - vector product of a sparse general matrix
in the CSR format (3-array variation) with zero-based
indexing.
mkl_cspblas_?bsrgemv Computes matrix - vector product of a sparse general matrix
in the BSR format (3-array variation)with zero-based indexing.
mkl_cspblas_?coogemv Computes matrix - vector product of a sparse general matrix
in the coordinate format with zero-based indexing.
mkl_cspblas_?csrsymv Computes matrix - vector product of a sparse symmetrical
matrix in the CSR format (3-array variation) with zero-based
indexing
mkl_cspblas_?bsrsymv Computes matrix - vector product of a sparse symmetrical
matrix in the BSR format (3-array variation) with zero-based
indexing.
mkl_cspblas_?coosymv Computes matrix - vector product of a sparse symmetrical
matrix in the coordinate format with zero-based indexing.
mkl_cspblas_?csrtrsv Triangular solvers with simplified interface for a sparse matrix
in the CSR format (3-array variation) with zero-based
indexing.
mkl_cspblas_?bsrtrsv Triangular solver with simplified interface for a sparse matrix
in the BSR format (3-array variation) with zero-based
indexing.
mkl_cspblas_?cootrsv Triangular solver with simplified interface for a sparse matrix
in the coordinate format with zero-based indexing.
Typical (conventional) interface, one-based and zero-based indexing
mkl_?csrmv Computes matrix - vector product of a sparse matrix in the
CSR format.
mkl_?bsrmv Computes matrix - vector product of a sparse matrix in the
BSR format.
mkl_?cscmv Computes matrix - vector product for a sparse matrix in the
CSC format.
mkl_?coomv Computes matrix - vector product for a sparse matrix in the
coordinate format.
mkl_?csrsv Solves a system of linear equations for a sparse matrix in the
CSR format.
BLAS and Sparse BLAS Routines 2
159
Routine/Function Description
mkl_?bsrsv Solves a system of linear equations for a sparse matrix in the
BSR format.
mkl_?cscsv Solves a system of linear equations for a sparse matrix in the
CSC format.
mkl_?coosv Solves a system of linear equations for a sparse matrix in the
coordinate format.
mkl_?csrmm Computes matrix - matrix product of a sparse matrix in the
CSR format
mkl_?bsrmm Computes matrix - matrix product of a sparse matrix in the
BSR format.
mkl_?cscmm Computes matrix - matrix product of a sparse matrix in the
CSC format
mkl_?coomm Computes matrix - matrix product of a sparse matrix in the
coordinate format.
mkl_?csrsm Solves a system of linear matrix equations for a sparse matrix
in the CSR format.
mkl_?bsrsm Solves a system of linear matrix equations for a sparse matrix
in the BSR format.
mkl_?cscsm Solves a system of linear matrix equations for a sparse matrix
in the CSC format.
mkl_?coosm Solves a system of linear matrix equations for a sparse matrix
in the coordinate format.
Typical (conventional) interface, one-based indexing
mkl_?diamv Computes matrix - vector product of a sparse matrix in the
diagonal format.
mkl_?skymv Computes matrix - vector product for a sparse matrix in the
skyline storage format.
mkl_?diasv Solves a system of linear equations for a sparse matrix in the
diagonal format.
mkl_?skysv Solves a system of linear equations for a sparse matrix in the
skyline format.
mkl_?diamm Computes matrix - matrix product of a sparse matrix in the
diagonal format.
mkl_?skymm Computes matrix - matrix product of a sparse matrix in the
skyline storage format.
mkl_?diasm Solves a system of linear matrix equations for a sparse matrix
in the diagonal format.
mkl_?skysm Solves a system of linear matrix equations for a sparse matrix
in the skyline storage format.
Auxiliary routines
Matrix converters
2 Intel® Math Kernel Library Reference Manual
160
Routine/Function Description
mkl_?dnscsr Converts a sparse matrix in the dense representation to the
CSR format (3-array variation).
mkl_?csrcoo Converts a sparse matrix in the CSR format (3-array variation)
to the coordinate format and vice versa.
mkl_?csrbsr Converts a sparse matrix in the CSR format to the BSR format
(3-array variations) and vice versa.
mkl_?csrcsc Converts a sparse matrix in the CSR format to the CSC and
vice versa (3-array variations).
mkl_?csrdia Converts a sparse matrix in the CSR format (3-array variation)
to the diagonal format and vice versa.
mkl_?csrsky Converts a sparse matrix in the CSR format (3-array variation)
to the sky line format and vice versa.
Operations on sparse matrices
mkl_?csradd Computes the sum of two sparse matrices stored in the CSR
format (3-array variation) with one-based indexing.
mkl_?csrmultcsr Computes the product of two sparse matrices stored in the
CSR format (3-array variation) with one-based indexing.
mkl_?csrmultd Computes product of two sparse matrices stored in the CSR
format (3-array variation) with one-based indexing. The result
is stored in the dense matrix.
mkl_?csrgemv
Computes matrix - vector product of a sparse general
matrix stored in the CSR format (3-array variation)
with one-based indexing.
Syntax
Fortran:
call mkl_scsrgemv(transa, m, a, ia, ja, x, y)
call mkl_dcsrgemv(transa, m, a, ia, ja, x, y)
call mkl_ccsrgemv(transa, m, a, ia, ja, x, y)
call mkl_zcsrgemv(transa, m, a, ia, ja, x, y)
C:
mkl_scsrgemv(&transa, &m, a, ia, ja, x, y);
mkl_dcsrgemv(&transa, &m, a, ia, ja, x, y);
mkl_ccsrgemv(&transa, &m, a, ia, ja, x, y);
mkl_zcsrgemv(&transa, &m, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
BLAS and Sparse BLAS Routines 2
161
Description
The mkl_?csrgemv routine performs a matrix-vector operation defined as
y := A*x
or
y := A'*x,
where:
x and y are vectors,
A is an m-by-m sparse square matrix in the CSR format (3-array variation), A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then as y := A*x
If transa = 'T' or 't' or 'C' or 'c', then y := A'*x,
m INTEGER. Number of rows of the matrix A.
a REAL for mkl_scsrgemv.
DOUBLE PRECISION for mkl_dcsrgemv.
COMPLEX for mkl_ccsrgemv.
DOUBLE COMPLEX for mkl_zcsrgemv.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ia INTEGER. Array of length m + 1, containing indices of elements in the array
a, such that ia(i) is the index in the array a of the first non-zero element
from the row i. The value of the last element ia(m + 1) is equal to the
number of non-zeros plus one. Refer to rowIndex array description in
Sparse Matrix Storage Formats for more details.
ja INTEGER. Array containing the column indices for each non-zero element of
the matrix A.
Its length is equal to the length of the array a. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
x REAL for mkl_scsrgemv.
DOUBLE PRECISION for mkl_dcsrgemv.
COMPLEX for mkl_ccsrgemv.
DOUBLE COMPLEX for mkl_zcsrgemv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_scsrgemv.
DOUBLE PRECISION for mkl_dcsrgemv.
COMPLEX for mkl_ccsrgemv.
2 Intel® Math Kernel Library Reference Manual
162
DOUBLE COMPLEX for mkl_zcsrgemv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrgemv(transa, m, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
SUBROUTINE mkl_dcsrgemv(transa, m, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_ccsrgemv(transa, m, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_zcsrgemv(transa, m, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_scsrgemv(char *transa, int *m, float *a,
int *ia, int *ja, float *x, float *y);
void mkl_dcsrgemv(char *transa, int *m, double *a,
int *ia, int *ja, double *x, double *y);
void mkl_ccsrgemv(char *transa, int *m, MKL_Complex8 *a,
int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zcsrgemv(char *transa, int *m, MKL_Complex16 *a,
int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
BLAS and Sparse BLAS Routines 2
163
mkl_?bsrgemv
Computes matrix - vector product of a sparse general
matrix stored in the BSR format (3-array variation)
with one-based indexing.
Syntax
Fortran:
call mkl_sbsrgemv(transa, m, lb, a, ia, ja, x, y)
call mkl_dbsrgemv(transa, m, lb, a, ia, ja, x, y)
call mkl_cbsrgemv(transa, m, lb, a, ia, ja, x, y)
call mkl_zbsrgemv(transa, m, lb, a, ia, ja, x, y)
C:
mkl_sbsrgemv(&transa, &m, &lb, a, ia, ja, x, y);
mkl_dbsrgemv(&transa, &m, &lb, a, ia, ja, x, y);
mkl_cbsrgemv(&transa, &m, &lb, a, ia, ja, x, y);
mkl_zbsrgemv(&transa, &m, &lb, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?bsrgemv routine performs a matrix-vector operation defined as
y := A*x
or
y := A'*x,
where:
x and y are vectors,
A is an m-by-m block sparse square matrix in the BSR format (3-array variation), A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-vector product is computed as
y := A*x
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as y := A'*x,
m INTEGER. Number of block rows of the matrix A.
2 Intel® Math Kernel Library Reference Manual
164
lb INTEGER. Size of the block in the matrix A.
a REAL for mkl_sbsrgemv.
DOUBLE PRECISION for mkl_dbsrgemv.
COMPLEX for mkl_cbsrgemv.
DOUBLE COMPLEX for mkl_zbsrgemv.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by lb*lb.
Refer to values array description in BSR Format for more details.
ia INTEGER. Array of length (m + 1), containing indices of block in the array
a, such that ia(i) is the index in the array a of the first non-zero element
from the row i. The value of the last element ia(m + 1) is equal to the
number of non-zero blocks plus one. Refer to rowIndex array description in
BSR Format for more details.
ja INTEGER. Array containing the column indices for each non-zero block in
the matrix A.
Its length is equal to the number of non-zero blocks of the matrix A. Refer
to columns array description in BSR Format for more details.
x REAL for mkl_sbsrgemv.
DOUBLE PRECISION for mkl_dbsrgemv.
COMPLEX for mkl_cbsrgemv.
DOUBLE COMPLEX for mkl_zbsrgemv.
Array, DIMENSION (m*lb).
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_sbsrgemv.
DOUBLE PRECISION for mkl_dbsrgemv.
COMPLEX for mkl_cbsrgemv.
DOUBLE COMPLEX for mkl_zbsrgemv.
Array, DIMENSION at least (m*lb).
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sbsrgemv(transa, m, lb, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m, lb
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
SUBROUTINE mkl_dbsrgemv(transa, m, lb, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
BLAS and Sparse BLAS Routines 2
165
SUBROUTINE mkl_cbsrgemv(transa, m, lb, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m, lb
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_zbsrgemv(transa, m, lb, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_dbsrgemv(char *transa, int *m, int *lb, double *a,
int *ia, int *ja, double *x, double *y);
void mkl_sbsrgemv(char *transa, int *m, int *lb, float *a,
int *ia, int *ja, float *x, float *y);
void mkl_cbsrgemv(char *transa, int *m, int *lb, MKL_Complex8 *a,
int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zbsrgemv(char *transa, int *m, int *lb, MKL_Complex16 *a,
int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?coogemv
Computes matrix-vector product of a sparse general
matrix stored in the coordinate format with one-based
indexing.
Syntax
Fortran:
call mkl_scoogemv(transa, m, val, rowind, colind, nnz, x, y)
call mkl_dcoogemv(transa, m, val, rowind, colind, nnz, x, y)
call mkl_ccoogemv(transa, m, val, rowind, colind, nnz, x, y)
call mkl_zcoogemv(transa, m, val, rowind, colind, nnz, x, y)
C:
mkl_scoogemv(&transa, &m, val, rowind, colind, &nnz, x, y);
mkl_dcoogemv(&transa, &m, val, rowind, colind, &nnz, x, y);
mkl_ccoogemv(&transa, &m, val, rowind, colind, &nnz, x, y);
mkl_zcoogemv(&transa, &m, val, rowind, colind, &nnz, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
2 Intel® Math Kernel Library Reference Manual
166
Description
The mkl_?coogemv routine performs a matrix-vector operation defined as
y := A*x
or
y := A'*x,
where:
x and y are vectors,
A is an m-by-m sparse square matrix in the coordinate format, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-vector product is computed as
y := A*x
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as y := A'*x,
m INTEGER. Number of rows of the matrix A.
val REAL for mkl_scoogemv.
DOUBLE PRECISION for mkl_dcoogemv.
COMPLEX for mkl_ccoogemv.
DOUBLE COMPLEX for mkl_zcoogemv.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
x REAL for mkl_scoogemv.
DOUBLE PRECISION for mkl_dcoogemv.
COMPLEX for mkl_ccoogemv.
DOUBLE COMPLEX for mkl_zcoogemv.
Array, DIMENSION is m.
One entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_scoogemv.
DOUBLE PRECISION for mkl_dcoogemv.
BLAS and Sparse BLAS Routines 2
167
COMPLEX for mkl_ccoogemv.
DOUBLE COMPLEX for mkl_zcoogemv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scoogemv(transa, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
INTEGER m, nnz
INTEGER rowind(*), colind(*)
REAL val(*), x(*), y(*)
SUBROUTINE mkl_dcoogemv(transa, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION val(*), x(*), y(*)
SUBROUTINE mkl_ccoogemv(transa, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
INTEGER m, nnz
INTEGER rowind(*), colind(*)
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_zcoogemv(transa, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_scoogemv(char *transa, int *m, float *val, int *rowind,
int *colind, int *nnz, float *x, float *y);
void mkl_dcoogemv(char *transa, int *m, double *val, int *rowind,
int *colind, int *nnz, double *x, double *y);
void mkl_ccoogemv(char *transa, int *m, MKL_Complex8 *val, int *rowind,
int *colind, int *nnz, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zcoogemv(char *transa, int *m, MKL_Complex16 *val, int *rowind,
int *colind, int *nnz, MKL_Complex16 *x, MKL_Complex16 *y);
2 Intel® Math Kernel Library Reference Manual
168
mkl_?diagemv
Computes matrix - vector product of a sparse general
matrix stored in the diagonal format with one-based
indexing.
Syntax
Fortran:
call mkl_sdiagemv(transa, m, val, lval, idiag, ndiag, x, y)
call mkl_ddiagemv(transa, m, val, lval, idiag, ndiag, x, y)
call mkl_cdiagemv(transa, m, val, lval, idiag, ndiag, x, y)
call mkl_zdiagemv(transa, m, val, lval, idiag, ndiag, x, y)
C:
mkl_sdiagemv(&transa, &m, val, &lval, idiag, &ndiag, x, y);
mkl_ddiagemv(&transa, &m, val, &lval, idiag, &ndiag, x, y);
mkl_cdiagemv(&transa, &m, val, &lval, idiag, &ndiag, x, y);
mkl_zdiagemv(&transa, &m, val, &lval, idiag, &ndiag, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?diagemv routine performs a matrix-vector operation defined as
y := A*x
or
y := A'*x,
where:
x and y are vectors,
A is an m-by-m sparse square matrix in the diagonal storage format, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then y := A*x
If transa = 'T' or 't' or 'C' or 'c', then y := A'*x,
m INTEGER. Number of rows of the matrix A.
val REAL for mkl_sdiagemv.
DOUBLE PRECISION for mkl_ddiagemv.
BLAS and Sparse BLAS Routines 2
169
COMPLEX for mkl_ccsrgemv.
DOUBLE COMPLEX for mkl_zdiagemv.
Two-dimensional array of size lval*ndiag, contains non-zero diagonals of
the matrix A. Refer to values array description in Diagonal Storage Scheme
for more details.
lval INTEGER. Leading dimension of val lval=m. Refer to lval description in
Diagonal Storage Scheme for more details.
idiag INTEGER. Array of length ndiag, contains the distances between main
diagonal and each non-zero diagonals in the matrix A.
Refer to distance array description in Diagonal Storage Scheme for more
details.
ndiag INTEGER. Specifies the number of non-zero diagonals of the matrix A.
x REAL for mkl_sdiagemv.
DOUBLE PRECISION for mkl_ddiagemv.
COMPLEX for mkl_ccsrgemv.
DOUBLE COMPLEX for mkl_zdiagemv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_sdiagemv.
DOUBLE PRECISION for mkl_ddiagemv.
COMPLEX for mkl_ccsrgemv.
DOUBLE COMPLEX for mkl_zdiagemv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sdiagemv(transa, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 transa
INTEGER m, lval, ndiag
INTEGER idiag(*)
REAL val(lval,*), x(*), y(*)
SUBROUTINE mkl_ddiagemv(transa, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 transa
INTEGER m, lval, ndiag
INTEGER idiag(*)
DOUBLE PRECISION val(lval,*), x(*), y(*)
SUBROUTINE mkl_cdiagemv(transa, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 transa
INTEGER m, lval, ndiag
INTEGER idiag(*)
COMPLEX val(lval,*), x(*), y(*)
2 Intel® Math Kernel Library Reference Manual
170
SUBROUTINE mkl_zdiagemv(transa, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 transa
INTEGER m, lval, ndiag
INTEGER idiag(*)
DOUBLE COMPLEX val(lval,*), x(*), y(*)
C:
void mkl_sdiagemv(char *transa, int *m, float *val, int *lval,
int *idiag, int *ndiag, float *x, float *y);
void mkl_ddiagemv(char *transa, int *m, double *val, int *lval,
int *idiag, int *ndiag, double *x, double *y);
void mkl_cdiagemv(char *transa, int *m, MKL_Complex8 *val, int *lval,
int *idiag, int *ndiag, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zdiagemv(char *transa, int *m, MKL_Complex16 *val, int *lval,
int *idiag, int *ndiag, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?csrsymv
Computes matrix - vector product of a sparse
symmetrical matrix stored in the CSR format (3-array
variation) with one-based indexing.
Syntax
Fortran:
call mkl_scsrsymv(uplo, m, a, ia, ja, x, y)
call mkl_dcsrsymv(uplo, m, a, ia, ja, x, y)
call mkl_ccsrsymv(uplo, m, a, ia, ja, x, y)
call mkl_zcsrsymv(uplo, m, a, ia, ja, x, y)
C:
mkl_scsrsymv(&uplo, &m, a, ia, ja, x, y);
mkl_dcsrsymv(&uplo, &m, a, ia, ja, x, y);
mkl_ccsrsymv(&uplo, &m, a, ia, ja, x, y);
mkl_zcsrsymv(&uplo, &m, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?csrsymv routine performs a matrix-vector operation defined as
y := A*x
where:
x and y are vectors,
BLAS and Sparse BLAS Routines 2
171
A is an upper or lower triangle of the symmetrical sparse matrix in the CSR format (3-array variation).
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
m INTEGER. Number of rows of the matrix A.
a REAL for mkl_scsrsymv.
DOUBLE PRECISION for mkl_dcsrsymv.
COMPLEX for mkl_ccsrsymv.
DOUBLE COMPLEX for mkl_zcsrsymv.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ia INTEGER. Array of length m + 1, containing indices of elements in the array
a, such that ia(i) is the index in the array a of the first non-zero element
from the row i. The value of the last element ia(m + 1) is equal to the
number of non-zeros plus one. Refer to rowIndex array description in
Sparse Matrix Storage Formats for more details.
ja INTEGER. Array containing the column indices for each non-zero element of
the matrix A.
Its length is equal to the length of the array a. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
x REAL for mkl_scsrsymv.
DOUBLE PRECISION for mkl_dcsrsymv.
COMPLEX for mkl_ccsrsymv.
DOUBLE COMPLEX for mkl_zcsrsymv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_scsrsymv.
DOUBLE PRECISION for mkl_dcsrsymv.
COMPLEX for mkl_ccsrsymv.
DOUBLE COMPLEX for mkl_zcsrsymv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
2 Intel® Math Kernel Library Reference Manual
172
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrsymv(uplo, m, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
SUBROUTINE mkl_dcsrsymv(uplo, m, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_ccsrsymv(uplo, m, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_zcsrsymv(uplo, m, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_scsrsymv(char *uplo, int *m, float *a,
int *ia, int *ja, float *x, float *y);
void mkl_dcsrsymv(char *uplo, int *m, double *a,
int *ia, int *ja, double *x, double *y);
void mkl_ccsrsymv(char *uplo, int *m, MKL_Complex8 *a,
int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zcsrsymv(char *uplo, int *m, MKL_Complex16 *a,
int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?bsrsymv
Computes matrix-vector product of a sparse
symmetrical matrix stored in the BSR format (3-array
variation) with one-based indexing.
BLAS and Sparse BLAS Routines 2
173
Syntax
Fortran:
call mkl_sbsrsymv(uplo, m, lb, a, ia, ja, x, y)
call mkl_dbsrsymv(uplo, m, lb, a, ia, ja, x, y)
call mkl_cbsrsymv(uplo, m, lb, a, ia, ja, x, y)
call mkl_zbsrsymv(uplo, m, lb, a, ia, ja, x, y)
C:
mkl_sbsrsymv(&uplo, &m, &lb, a, ia, ja, x, y);
mkl_dbsrsymv(&uplo, &m, &lb, a, ia, ja, x, y);
mkl_cbsrsymv(&uplo, &m, &lb, a, ia, ja, x, y);
mkl_zbsrsymv(&uplo, &m, &lb, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?bsrsymv routine performs a matrix-vector operation defined as
y := A*x
where:
x and y are vectors,
A is an upper or lower triangle of the symmetrical sparse matrix in the BSR format (3-array variation).
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
considered.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
m INTEGER. Number of block rows of the matrix A.
lb INTEGER. Size of the block in the matrix A.
a REAL for mkl_sbsrsymv.
DOUBLE PRECISION for mkl_dbsrsymv.
COMPLEX for mkl_cbsrsymv.
DOUBLE COMPLEX for mkl_zcsrgemv.
2 Intel® Math Kernel Library Reference Manual
174
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by lb*lb.
Refer to values array description in BSR Format for more details.
ia INTEGER. Array of length (m + 1), containing indices of block in the array
a, such that ia(i) is the index in the array a of the first non-zero element
from the row i. The value of the last element ia(m + 1) is equal to the
number of non-zero blocks plus one. Refer to rowIndex array description in
BSR Format for more details.
ja INTEGER. Array containing the column indices for each non-zero block in
the matrix A.
Its length is equal to the number of non-zero blocks of the matrix A. Refer
to columns array description in BSR Format for more details.
x REAL for mkl_sbsrsymv.
DOUBLE PRECISION for mkl_dbsrsymv.
COMPLEX for mkl_cbsrsymv.
DOUBLE COMPLEX for mkl_zcsrgemv.
Array, DIMENSION (m*lb).
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_sbsrsymv.
DOUBLE PRECISION for mkl_dbsrsymv.
COMPLEX for mkl_cbsrsymv.
DOUBLE COMPLEX for mkl_zcsrgemv.
Array, DIMENSION at least (m*lb).
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sbsrsymv(uplo, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m, lb
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
SUBROUTINE mkl_dbsrsymv(uplo, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_cbsrsymv(uplo, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m, lb
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
BLAS and Sparse BLAS Routines 2
175
SUBROUTINE mkl_zbsrsymv(uplo, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_sbsrsymv(char *uplo, int *m, int *lb,
float *a, int *ia, int *ja, float *x, float *y);
void mkl_dbsrsymv(char *uplo, int *m, int *lb,
double *a, int *ia, int *ja, double *x, double *y);
void mkl_cbsrsymv(char *uplo, int *m, int *lb,
MKL_Complex8 *a, int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zbsrsymv(char *uplo, int *m, int *lb,
MKL_Complex16 *a, int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?coosymv
Computes matrix - vector product of a sparse
symmetrical matrix stored in the coordinate format
with one-based indexing.
Syntax
Fortran:
call mkl_scoosymv(uplo, m, val, rowind, colind, nnz, x, y)
call mkl_dcoosymv(uplo, m, val, rowind, colind, nnz, x, y)
call mkl_ccoosymv(uplo, m, val, rowind, colind, nnz, x, y)
call mkl_zcoosymv(uplo, m, val, rowind, colind, nnz, x, y)
C:
mkl_scoosymv(&uplo, &m, val, rowind, colind, &nnz, x, y);
mkl_dcoosymv(&uplo, &m, val, rowind, colind, &nnz, x, y);
mkl_ccoosymv(&uplo, &m, val, rowind, colind, &nnz, x, y);
mkl_zcoosymv(&uplo, &m, val, rowind, colind, &nnz, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?coosymv routine performs a matrix-vector operation defined as
y := A*x
where:
x and y are vectors,
2 Intel® Math Kernel Library Reference Manual
176
A is an upper or lower triangle of the symmetrical sparse matrix in the coordinate format.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
m INTEGER. Number of rows of the matrix A.
val REAL for mkl_scoosymv.
DOUBLE PRECISION for mkl_dcoosymv.
COMPLEX for mkl_ccoosymv.
DOUBLE COMPLEX for mkl_zcoosymv.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
x REAL for mkl_scoosymv.
DOUBLE PRECISION for mkl_dcoosymv.
COMPLEX for mkl_ccoosymv.
DOUBLE COMPLEX for mkl_zcoosymv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_scoosymv.
DOUBLE PRECISION for mkl_dcoosymv.
COMPLEX for mkl_ccoosymv.
DOUBLE COMPLEX for mkl_zcoosymv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
BLAS and Sparse BLAS Routines 2
177
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scoosymv(uplo, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo
INTEGER m, nnz
INTEGER rowind(*), colind(*)
REAL val(*), x(*), y(*)
SUBROUTINE mkl_dcoosymv(uplo, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION val(*), x(*), y(*)
SUBROUTINE mkl_cdcoosymv(uplo, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo
INTEGER m, nnz
INTEGER rowind(*), colind(*)
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_zcoosymv(uplo, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_scoosymv(char *uplo, int *m, float *val, int *rowind,
int *colind, int *nnz, float *x, float *y);
void mkl_dcoosymv(char *uplo, int *m, double *val, int *rowind,
int *colind, int *nnz, double *x, double *y);
void mkl_ccoosymv(char *uplo, int *m, MKL_Complex8 *val, int *rowind,
int *colind, int *nnz, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zcoosymv(char *uplo, int *m, MKL_Complex16 *val, int *rowind,
int *colind, int *nnz, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?diasymv
Computes matrix - vector product of a sparse
symmetrical matrix stored in the diagonal format with
one-based indexing.
2 Intel® Math Kernel Library Reference Manual
178
Syntax
Fortran:
call mkl_sdiasymv(uplo, m, val, lval, idiag, ndiag, x, y)
call mkl_ddiasymv(uplo, m, val, lval, idiag, ndiag, x, y)
call mkl_cdiasymv(uplo, m, val, lval, idiag, ndiag, x, y)
call mkl_zdiasymv(uplo, m, val, lval, idiag, ndiag, x, y)
C:
mkl_sdiasymv(&uplo, &m, val, &lval, idiag, &ndiag, x, y);
mkl_ddiasymv(&uplo, &m, val, &lval, idiag, &ndiag, x, y);
mkl_cdiasymv(&uplo, &m, val, &lval, idiag, &ndiag, x, y);
mkl_zdiasymv(&uplo, &m, val, &lval, idiag, &ndiag, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?diasymv routine performs a matrix-vector operation defined as
y := A*x
where:
x and y are vectors,
A is an upper or lower triangle of the symmetrical sparse matrix.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
m INTEGER. Number of rows of the matrix A.
val REAL for mkl_sdiasymv.
DOUBLE PRECISION for mkl_ddiasymv.
COMPLEX for mkl_cdiasymv.
DOUBLE COMPLEX for mkl_zdiasymv.
Two-dimensional array of size lval by ndiag, contains non-zero diagonals
of the matrix A. Refer to values array description in Diagonal Storage
Scheme for more details.
lval INTEGER. Leading dimension of val, lval =m. Refer to lval description in
Diagonal Storage Scheme for more details.
BLAS and Sparse BLAS Routines 2
179
idiag INTEGER. Array of length ndiag, contains the distances between main
diagonal and each non-zero diagonals in the matrix A.
Refer to distance array description in Diagonal Storage Scheme for more
details.
ndiag INTEGER. Specifies the number of non-zero diagonals of the matrix A.
x REAL for mkl_sdiasymv.
DOUBLE PRECISION for mkl_ddiasymv.
COMPLEX for mkl_cdiasymv.
DOUBLE COMPLEX for mkl_zdiasymv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_sdiasymv.
DOUBLE PRECISION for mkl_ddiasymv.
COMPLEX for mkl_cdiasymv.
DOUBLE COMPLEX for mkl_zdiasymv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sdiasymv(uplo, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 uplo
INTEGER m, lval, ndiag
INTEGER idiag(*)
REAL val(lval,*), x(*), y(*)
SUBROUTINE mkl_ddiasymv(uplo, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 uplo
INTEGER m, lval, ndiag
INTEGER idiag(*)
DOUBLE PRECISION val(lval,*), x(*), y(*)
SUBROUTINE mkl_cdiasymv(uplo, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 uplo
INTEGER m, lval, ndiag
INTEGER idiag(*)
COMPLEX val(lval,*), x(*), y(*)
SUBROUTINE mkl_zdiasymv(uplo, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 uplo
INTEGER m, lval, ndiag
INTEGER idiag(*)
DOUBLE COMPLEX val(lval,*), x(*), y(*)
2 Intel® Math Kernel Library Reference Manual
180
C:
void mkl_sdiasymv(char *uplo, int *m, float *val, int *lval,
int *idiag, int *ndiag, float *x, float *y);
void mkl_ddiasymv(char *uplo, int *m, double *val, int *lval,
int *idiag, int *ndiag, double *x, double *y);
void mkl_cdiasymv(char *uplo, int *m, MKL_Complex8 *val, int *lval,
int *idiag, int *ndiag, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zdiasymv(char *uplo, int *m, MKL_Complex16 *val, int *lval,
int *idiag, int *ndiag, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?csrtrsv
Triangular solvers with simplified interface for a sparse
matrix in the CSR format (3-array variation) with onebased
indexing.
Syntax
Fortran:
call mkl_scsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
call mkl_dcsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
call mkl_ccsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
call mkl_zcsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
C:
mkl_scsrtrsv(&uplo, &transa, &diag, &m, a, ia, ja, x, y);
mkl_dcsrtrsv(&uplo, &transa, &diag, &m, a, ia, ja, x, y);
mkl_ccsrtrsv(&uplo, &transa, &diag, &m, a, ia, ja, x, y);
mkl_zcsrtrsv(&uplo, &transa, &diag, &m, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?csrtrsv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix stored in the CSR format (3 array variation):
A*y = x
or
A'*y = x,
where:
x and y are vectors,
A is a sparse upper or lower triangular matrix with unit or non-unit main diagonal, A' is the transpose of A.
BLAS and Sparse BLAS Routines 2
181
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then A*y = x
If transa = 'T' or 't' or 'C' or 'c', then A'*y = x,
diag CHARACTER*1. Specifies whether A is unit triangular.
If diag = 'U' or 'u', then A is a unit triangular.
If diag = 'N' or 'n', then A is not unit triangular.
m INTEGER. Number of rows of the matrix A.
a REAL for mkl_scsrtrmv.
DOUBLE PRECISION for mkl_dcsrtrmv.
COMPLEX for mkl_ccsrtrmv.
DOUBLE COMPLEX for mkl_zcsrtrmv.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
ia INTEGER. Array of length m + 1, containing indices of elements in the array
a, such that ia(i) is the index in the array a of the first non-zero element
from the row i. The value of the last element ia(m + 1) is equal to the
number of non-zeros plus one. Refer to rowIndex array description in
Sparse Matrix Storage Formats for more details.
ja INTEGER. Array containing the column indices for each non-zero element of
the matrix A.
Its length is equal to the length of the array a. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
NOTE Column indices must be sorted in increasing order for each row.
x REAL for mkl_scsrtrmv.
DOUBLE PRECISION for mkl_dcsrtrmv.
COMPLEX for mkl_ccsrtrmv.
DOUBLE COMPLEX for mkl_zcsrtrmv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
2 Intel® Math Kernel Library Reference Manual
182
Output Parameters
y REAL for mkl_scsrtrmv.
DOUBLE PRECISION for mkl_dcsrtrmv.
COMPLEX for mkl_ccsrtrmv.
DOUBLE COMPLEX for mkl_zcsrtrmv.
Array, DIMENSION at least m.
Contains the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
SUBROUTINE mkl_dcsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_ccsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_zcsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_scsrtrsv(char *uplo, char *transa, char *diag, int *m,
float *a, int *ia, int *ja, float *x, float *y);
void mkl_dcsrtrsv(char *uplo, char *transa, char *diag, int *m,
double *a, int *ia, int *ja, double *x, double *y);
void mkl_ccsrtrsv(char *uplo, char *transa, char *diag, int *m,
MKL_Complex8 *a, int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zcsrtrsv(char *uplo, char *transa, char *diag, int *m,
MKL_Complex16 *a, int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
BLAS and Sparse BLAS Routines 2
183
mkl_?bsrtrsv
Triangular solver with simplified interface for a sparse
matrix stored in the BSR format (3-array variation)
with one-based indexing.
Syntax
Fortran:
call mkl_sbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
call mkl_dbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
call mkl_cbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
call mkl_zbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
C:
mkl_sbsrtrsv(&uplo, &transa, &diag, &m, &lb, a, ia, ja, x, y);
mkl_dbsrtrsv(&uplo, &transa, &diag, &m, &lb, a, ia, ja, x, y);
mkl_cbsrtrsv(&uplo, &transa, &diag, &m, &lb, a, ia, ja, x, y);
mkl_zbsrtrsv(&uplo, &transa, &diag, &m, &lb, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?bsrtrsv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix stored in the BSR format (3-array variation) :
y := A*x
or
y := A'*x,
where:
x and y are vectors,
A is a sparse upper or lower triangular matrix with unit or non-unit main diagonal, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies the upper or low triangle of the matrix A is used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-vector product is computed as
y := A*x
2 Intel® Math Kernel Library Reference Manual
184
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as y := A'*x.
diag CHARACTER*1. Specifies whether A is a unit triangular matrix.
If diag = 'U' or 'u', then A is a unit triangular.
If diag = 'N' or 'n', then A is not a unit triangular.
m INTEGER. Number of block rows of the matrix A.
lb INTEGER. Size of the block in the matrix A.
a REAL for mkl_sbsrtrsv.
DOUBLE PRECISION for mkl_dbsrtrsv.
COMPLEX for mkl_cbsrtrsv.
DOUBLE COMPLEX for mkl_zbsrtrsv.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by lb*lb.
Refer to values array description in BSR Format for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
ia INTEGER. Array of length (m + 1), containing indices of block in the array
a, such that ia(I) is the index in the array a of the first non-zero element
from the row I. The value of the last element ia(m + 1) is equal to the
number of non-zero blocks plus one. Refer to rowIndex array description in
BSR Format for more details.
ja INTEGER.
Array containing the column indices for each non-zero block in the matrix A.
Its length is equal to the number of non-zero blocks of the matrix A. Refer
to columns array description in BSR Format for more details.
x REAL for mkl_sbsrtrsv.
DOUBLE PRECISION for mkl_dbsrtrsv.
COMPLEX for mkl_cbsrtrsv.
DOUBLE COMPLEX for mkl_zbsrtrsv.
Array, DIMENSION (m*lb).
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_sbsrtrsv.
DOUBLE PRECISION for mkl_dbsrtrsv.
COMPLEX for mkl_cbsrtrsv.
DOUBLE COMPLEX for mkl_zbsrtrsv.
Array, DIMENSION at least (m*lb).
On exit, the array y must contain the vector y.
BLAS and Sparse BLAS Routines 2
185
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lb
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
SUBROUTINE mkl_dbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_cbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lb
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_zbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_sbsrtrsv(char *uplo, char *transa, char *diag, int *m,
int *lb, float *a, int *ia, int *ja, float *x, float *y);
void mkl_dbsrtrsv(char *uplo, char *transa, char *diag, int *m,
int *lb, double *a, int *ia, int *ja, double *x, double *y);
void mkl_cbsrtrsv(char *uplo, char *transa, char *diag, int *m,
int *lb, MKL_Complex8 *a, int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zbsrtrsv(char *uplo, char *transa, char *diag, int *m,
int *lb, MKL_Complex16 *a, int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?cootrsv
Triangular solvers with simplified interface for a sparse
matrix in the coordinate format with one-based
indexing.
2 Intel® Math Kernel Library Reference Manual
186
Syntax
Fortran:
call mkl_scootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
call mkl_dcootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
call mkl_ccootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
call mkl_zcootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
C:
mkl_scootrsv(&uplo, &transa, &diag, &m, val, rowind, colind, &nnz, x, y);
mkl_dcootrsv(&uplo, &transa, &diag, &m, val, rowind, colind, &nnz, x, y);
mkl_ccootrsv(&uplo, &transa, &diag, &m, val, rowind, colind, &nnz, x, y);
mkl_zcootrsv(&uplo, &transa, &diag, &m, val, rowind, colind, &nnz, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?cootrsv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix stored in the coordinate format:
A*y = x
or
A'*y = x,
where:
x and y are vectors,
A is a sparse upper or lower triangular matrix with unit or non-unit main diagonal, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
considered.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then A*y = x
If transa = 'T' or 't' or 'C' or 'c', then A'*y = x,
diag CHARACTER*1. Specifies whether A is unit triangular.
If diag = 'U' or 'u', then A is unit triangular.
If diag = 'N' or 'n', then A is not unit triangular.
BLAS and Sparse BLAS Routines 2
187
m INTEGER. Number of rows of the matrix A.
val REAL for mkl_scootrsv.
DOUBLE PRECISION for mkl_dcootrsv.
COMPLEX for mkl_ccootrsv.
DOUBLE COMPLEX for mkl_zcootrsv.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
x REAL for mkl_scootrsv.
DOUBLE PRECISION for mkl_dcootrsv.
COMPLEX for mkl_ccootrsv.
DOUBLE COMPLEX for mkl_zcootrsv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_scootrsv.
DOUBLE PRECISION for mkl_dcootrsv.
COMPLEX for mkl_ccootrsv.
DOUBLE COMPLEX for mkl_zcootrsv.
Array, DIMENSION at least m.
Contains the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, nnz
INTEGER rowind(*), colind(*)
REAL val(*), x(*), y(*)
SUBROUTINE mkl_dcootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION val(*), x(*), y(*)
2 Intel® Math Kernel Library Reference Manual
188
SUBROUTINE mkl_ccootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, nnz
INTEGER rowind(*), colind(*)
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_zcootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_scootrsv(char *uplo, char *transa, char *diag, int *m,
float *val, int *rowind, int *colind, int *nnz, float *x, double *y);
void mkl_dcootrsv(char *uplo, char *transa, char *diag, int *m,
double *val, int *rowind, int *colind, int *nnz, double *x, double *y);
void mkl_ccootrsv(char *uplo, char *transa, char *diag, int *m,
MKL_Complex8 *val, int *rowind, int *colind, int *nnz, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zcootrsv(char *uplo, char *transa, char *diag, int *m,
MKL_Complex16 *val, int *rowind, int *colind, int *nnz, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?diatrsv
Triangular solvers with simplified interface for a sparse
matrix in the diagonal format with one-based
indexing.
Syntax
Fortran:
call mkl_sdiatrsv(uplo, transa, diag, m, val, lval, idiag, ndiag, x, y)
call mkl_ddiatrsv(uplo, transa, diag, m, val, lval, idiag, ndiag, x, y)
call mkl_cdiatrsv(uplo, transa, diag, m, val, lval, idiag, ndiag, x, y)
call mkl_zdiatrsv(uplo, transa, diag, m, val, lval, idiag, ndiag, x, y)
C:
mkl_sdiatrsv(&uplo, &transa, &diag, &m, val, &lval, idiag, &ndiag, x, y);
mkl_ddiatrsv(&uplo, &transa, &diag, &m, val, &lval, idiag, &ndiag, x, y);
mkl_cdiatrsv(&uplo, &transa, &diag, &m, val, &lval, idiag, &ndiag, x, y);
mkl_zdiatrsv(&uplo, &transa, &diag, &m, val, &lval, idiag, &ndiag, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
BLAS and Sparse BLAS Routines 2
189
Description
The mkl_?diatrsv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix stored in the diagonal format:
A*y = x
or
A'*y = x,
where:
x and y are vectors,
A is a sparse upper or lower triangular matrix with unit or non-unit main diagonal, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then A*y = x
If transa = 'T' or 't' or 'C' or 'c', then A'*y = x,
diag CHARACTER*1. Specifies whether A is unit triangular.
If diag = 'U' or 'u', then A is unit triangular.
If diag = 'N' or 'n', then A is not unit triangular.
m INTEGER. Number of rows of the matrix A.
val REAL for mkl_sdiatrsv.
DOUBLE PRECISION for mkl_ddiatrsv.
COMPLEX for mkl_cdiatrsv.
DOUBLE COMPLEX for mkl_zdiatrsv.
Two-dimensional array of size lval by ndiag, contains non-zero diagonals
of the matrix A. Refer to values array description in Diagonal Storage
Scheme for more details.
lval INTEGER. Leading dimension of val, lval=m. Refer to lval description in
Diagonal Storage Scheme for more details.
idiag INTEGER. Array of length ndiag, contains the distances between main
diagonal and each non-zero diagonals in the matrix A.
NOTE All elements of this array must be sorted in increasing order.
Refer to distance array description in Diagonal Storage Scheme for more
details.
ndiag INTEGER. Specifies the number of non-zero diagonals of the matrix A.
x REAL for mkl_sdiatrsv.
2 Intel® Math Kernel Library Reference Manual
190
DOUBLE PRECISION for mkl_ddiatrsv.
COMPLEX for mkl_cdiatrsv.
DOUBLE COMPLEX for mkl_zdiatrsv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_sdiatrsv.
DOUBLE PRECISION for mkl_ddiatrsv.
COMPLEX for mkl_cdiatrsv.
DOUBLE COMPLEX for mkl_zdiatrsv.
Array, DIMENSION at least m.
Contains the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sdiatrsv(uplo, transa, diag, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lval, ndiag
INTEGER indiag(*)
REAL val(lval,*), x(*), y(*)
SUBROUTINE mkl_ddiatrsv(uplo, transa, diag, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lval, ndiag
INTEGER indiag(*)
DOUBLE PRECISION val(lval,*), x(*), y(*)
SUBROUTINE mkl_cdiatrsv(uplo, transa, diag, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lval, ndiag
INTEGER indiag(*)
COMPLEX val(lval,*), x(*), y(*)
SUBROUTINE mkl_zdiatrsv(uplo, transa, diag, m, val, lval, idiag, ndiag, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lval, ndiag
INTEGER indiag(*)
DOUBLE COMPLEX val(lval,*), x(*), y(*)
C:
void mkl_sdiatrsv(char *uplo, char *transa, char *diag, int *m, float
*val, int *lval, int *idiag, int *ndiag, float *x, float *y);
void mkl_ddiatrsv(char *uplo, char *transa, char *diag, int *m, double
*val, int *lval, int *idiag, int *ndiag, double *x, double *y);
BLAS and Sparse BLAS Routines 2
191
void mkl_cdiatrsv(char *uplo, char *transa, char *diag, int *m, MKL_Complex8
*val, int *lval, int *idiag, int *ndiag, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zdiatrsv(char *uplo, char *transa, char *diag, int *m, MKL_Complex16
*val, int *lval, int *idiag, int *ndiag, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_cspblas_?csrgemv
Computes matrix - vector product of a sparse general
matrix stored in the CSR format (3-array variation)
with zero-based indexing.
Syntax
Fortran:
call mkl_cspblas_scsrgemv(transa, m, a, ia, ja, x, y)
call mkl_cspblas_dcsrgemv(transa, m, a, ia, ja, x, y)
call mkl_cspblas_ccsrgemv(transa, m, a, ia, ja, x, y)
call mkl_cspblas_zcsrgemv(transa, m, a, ia, ja, x, y)
C:
mkl_cspblas_scsrgemv(&transa, &m, a, ia, ja, x, y);
mkl_cspblas_dcsrgemv(&transa, &m, a, ia, ja, x, y);
mkl_cspblas_ccsrgemv(&transa, &m, a, ia, ja, x, y);
mkl_cspblas_zcsrgemv(&transa, &m, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_cspblas_?csrgemv routine performs a matrix-vector operation defined as
y := A*x
or
y := A'*x,
where:
x and y are vectors,
A is an m-by-m sparse square matrix in the CSR format (3-array variation) with zero-based indexing, A' is the
transpose of A.
NOTE This routine supports only zero-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
2 Intel® Math Kernel Library Reference Manual
192
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-vector product is computed as
y := A*x
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as y := A'*x,
m INTEGER. Number of rows of the matrix A.
a REAL for mkl_cspblas_scsrgemv.
DOUBLE PRECISION for mkl_cspblas_dcsrgemv.
COMPLEX for mkl_cspblas_ccsrgemv.
DOUBLE COMPLEX for mkl_cspblas_zcsrgemv.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ia INTEGER. Array of length m + 1, containing indices of elements in the array
a, such that ia(I) is the index in the array a of the first non-zero element
from the row I. The value of the last element ia(m) is equal to the number
of non-zeros. Refer to rowIndex array description in Sparse Matrix Storage
Formats for more details.
ja INTEGER. Array containing the column indices for each non-zero element of
the matrix A.
Its length is equal to the length of the array a. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
x REAL for mkl_cspblas_scsrgemv.
DOUBLE PRECISION for mkl_cspblas_dcsrgemv.
COMPLEX for mkl_cspblas_ccsrgemv.
DOUBLE COMPLEX for mkl_cspblas_zcsrgemv.
Array, DIMENSION is m.
One entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_cspblas_scsrgemv.
DOUBLE PRECISION for mkl_cspblas_dcsrgemv.
COMPLEX for mkl_cspblas_ccsrgemv.
DOUBLE COMPLEX for mkl_cspblas_zcsrgemv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_cspblas_scsrgemv(transa, m, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
BLAS and Sparse BLAS Routines 2
193
SUBROUTINE mkl_cspblas_dcsrgemv(transa, m, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_ccsrgemv(transa, m, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_zcsrgemv(transa, m, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_cspblas_scsrgemv(char *transa, int *m, float *a,
int *ia, int *ja, float *x, float *y);
void mkl_cspblas_dcsrgemv(char *transa, int *m, double *a,
int *ia, int *ja, double *x, double *y);
void mkl_cspblas_ccsrgemv(char *transa, int *m, MKL_Complex8 *a,
int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_cspblas_zcsrgemv(char *transa, int *m, MKL_Complex16 *a,
int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_cspblas_?bsrgemv
Computes matrix - vector product of a sparse general
matrix stored in the BSR format (3-array variation)
with zero-based indexing.
Syntax
Fortran:
call mkl_cspblas_sbsrgemv(transa, m, lb, a, ia, ja, x, y)
call mkl_cspblas_dbsrgemv(transa, m, lb, a, ia, ja, x, y)
call mkl_cspblas_cbsrgemv(transa, m, lb, a, ia, ja, x, y)
call mkl_cspblas_zbsrgemv(transa, m, lb, a, ia, ja, x, y)
C:
mkl_cspblas_sbsrgemv(&transa, &m, &lb, a, ia, ja, x, y);
mkl_cspblas_dbsrgemv(&transa, &m, &lb, a, ia, ja, x, y);
2 Intel® Math Kernel Library Reference Manual
194
mkl_cspblas_cbsrgemv(&transa, &m, &lb, a, ia, ja, x, y);
mkl_cspblas_zbsrgemv(&transa, &m, &lb, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_cspblas_?bsrgemv routine performs a matrix-vector operation defined as
y := A*x
or
y := A'*x,
where:
x and y are vectors,
A is an m-by-m block sparse square matrix in the BSR format (3-array variation) with zero-based indexing, A'
is the transpose of A.
NOTE This routine supports only zero-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-vector product is computed as
y := A*x
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as y := A'*x,
m INTEGER. Number of block rows of the matrix A.
lb INTEGER. Size of the block in the matrix A.
a REAL for mkl_cspblas_sbsrgemv.
DOUBLE PRECISION for mkl_cspblas_dbsrgemv.
COMPLEX for mkl_cspblas_cbsrgemv.
DOUBLE COMPLEX for mkl_cspblas_zbsrgemv.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by lb*lb.
Refer to values array description in BSR Format for more details.
ia INTEGER. Array of length (m + 1), containing indices of block in the array
a, such that ia(i) is the index in the array a of the first non-zero element
from the row i. The value of the last element ia(m + 1) is equal to the
number of non-zero blocks. Refer to rowIndex array description in BSR
Format for more details.
ja INTEGER. Array containing the column indices for each non-zero block in
the matrix A.
Its length is equal to the number of non-zero blocks of the matrix A. Refer
to columns array description in BSR Format for more details.
BLAS and Sparse BLAS Routines 2
195
x REAL for mkl_cspblas_sbsrgemv.
DOUBLE PRECISION for mkl_cspblas_dbsrgemv.
COMPLEX for mkl_cspblas_cbsrgemv.
DOUBLE COMPLEX for mkl_cspblas_zbsrgemv.
Array, DIMENSION (m*lb).
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_cspblas_sbsrgemv.
DOUBLE PRECISION for mkl_cspblas_dbsrgemv.
COMPLEX for mkl_cspblas_cbsrgemv.
DOUBLE COMPLEX for mkl_cspblas_zbsrgemv.
Array, DIMENSION at least (m*lb).
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_cspblas_sbsrgemv(transa, m, lb, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m, lb
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_dbsrgemv(transa, m, lb, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_cbsrgemv(transa, m, lb, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m, lb
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_zbsrgemv(transa, m, lb, a, ia, ja, x, y)
CHARACTER*1 transa
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_cspblas_sbsrgemv(char *transa, int *m, int *lb,
float *a, int *ia, int *ja, float *x, float *y);
2 Intel® Math Kernel Library Reference Manual
196
void mkl_cspblas_dbsrgemv(char *transa, int *m, int *lb,
double *a, int *ia, int *ja, double *x, double *y);
void mkl_cspblas_cbsrgemv(char *transa, int *m, int *lb,
MKL_Complex8 *a, int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_cspblas_zbsrgemv(char *transa, int *m, int *lb,
MKL_Complex16 *a, int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_cspblas_?coogemv
Computes matrix - vector product of a sparse general
matrix stored in the coordinate format with zerobased
indexing.
Syntax
Fortran:
call mkl_cspblas_scoogemv(transa, m, val, rowind, colind, nnz, x, y)
call mkl_cspblas_dcoogemv(transa, m, val, rowind, colind, nnz, x, y)
call mkl_cspblas_ccoogemv(transa, m, val, rowind, colind, nnz, x, y)
call mkl_cspblas_zcoogemv(transa, m, val, rowind, colind, nnz, x, y)
C:
mkl_cspblas_scoogemv(&transa, &m, val, rowind, colind, &nnz, x, y);
mkl_cspblas_dcoogemv(&transa, &m, val, rowind, colind, &nnz, x, y);
mkl_cspblas_ccoogemv(&transa, &m, val, rowind, colind, &nnz, x, y);
mkl_cspblas_zcoogemv(&transa, &m, val, rowind, colind, &nnz, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_cspblas_dcoogemv routine performs a matrix-vector operation defined as
y := A*x
or
y := A'*x,
where:
x and y are vectors,
A is an m-by-m sparse square matrix in the coordinate format with zero-based indexing, A' is the transpose of
A.
NOTE This routine supports only zero-based indexing of the input arrays.
BLAS and Sparse BLAS Routines 2
197
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-vector product is computed as
y := A*x
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as y := A'*x.
m INTEGER. Number of rows of the matrix A.
val REAL for mkl_cspblas_scoogemv.
DOUBLE PRECISION for mkl_cspblas_dcoogemv.
COMPLEX for mkl_cspblas_ccoogemv.
DOUBLE COMPLEX for mkl_cspblas_zcoogemv.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
x REAL for mkl_cspblas_scoogemv.
DOUBLE PRECISION for mkl_cspblas_dcoogemv.
COMPLEX for mkl_cspblas_ccoogemv.
DOUBLE COMPLEX for mkl_cspblas_zcoogemv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_cspblas_scoogemv.
DOUBLE PRECISION for mkl_cspblas_dcoogemv.
COMPLEX for mkl_cspblas_ccoogemv.
DOUBLE COMPLEX for mkl_cspblas_zcoogemv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_cspblas_scoogemv(transa, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
INTEGER m, nnz
INTEGER rowind(*), colind(*)
REAL val(*), x(*), y(*)
2 Intel® Math Kernel Library Reference Manual
198
SUBROUTINE mkl_cspblas_dcoogemv(transa, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION val(*), x(*), y(*)
SUBROUTINE mkl_cspblas_ccoogemv(transa, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
INTEGER m, nnz
INTEGER rowind(*), colind(*)
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_cspblas_zcoogemv(transa, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_cspblas_scoogemv(char *transa, int *m, float *val, int *rowind,
int *colind, int *nnz, float *x, float *y);
void mkl_cspblas_dcoogemv(char *transa, int *m, double *val, int *rowind,
int *colind, int *nnz, double *x, double *y);
void mkl_cspblas_ccoogemv(char *transa, int *m, MKL_Complex8 *val, int *rowind,
int *colind, int *nnz, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_cspblas_zcoogemv(char *transa, int *m, MKL_Complex16 *val, int *rowind,
int *colind, int *nnz, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_cspblas_?csrsymv
Computes matrix-vector product of a sparse
symmetrical matrix stored in the CSR format (3-array
variation) with zero-based indexing.
Syntax
Fortran:
call mkl_cspblas_scsrsymv(uplo, m, a, ia, ja, x, y)
call mkl_cspblas_dcsrsymv(uplo, m, a, ia, ja, x, y)
call mkl_cspblas_ccsrsymv(uplo, m, a, ia, ja, x, y)
call mkl_cspblas_zcsrsymv(uplo, m, a, ia, ja, x, y)
C:
mkl_cspblas_scsrsymv(&uplo, &m, a, ia, ja, x, y);
mkl_cspblas_dcsrsymv(&uplo, &m, a, ia, ja, x, y);
BLAS and Sparse BLAS Routines 2
199
mkl_cspblas_ccsrsymv(&uplo, &m, a, ia, ja, x, y);
mkl_cspblas_zcsrsymv(&uplo, &m, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_cspblas_?csrsymv routine performs a matrix-vector operation defined as
y := A*x
where:
x and y are vectors,
A is an upper or lower triangle of the symmetrical sparse matrix in the CSR format (3-array variation) with
zero-based indexing.
NOTE This routine supports only zero-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
m INTEGER. Number of rows of the matrix A.
a REAL for mkl_cspblas_scsrsymv.
DOUBLE PRECISION for mkl_cspblas_dcsrsymv.
COMPLEX for mkl_cspblas_ccsrsymv.
DOUBLE COMPLEX for mkl_cspblas_zcsrsymv.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ia INTEGER. Array of length m + 1, containing indices of elements in the array
a, such that ia(i) is the index in the array a of the first non-zero element
from the row i. The value of the last element ia(m + 1) is equal to the
number of non-zeros. Refer to rowIndex array description in Sparse Matrix
Storage Formats for more details.
ja INTEGER. Array containing the column indices for each non-zero element of
the matrix A.
Its length is equal to the length of the array a. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
x REAL for mkl_cspblas_scsrsymv.
DOUBLE PRECISION for mkl_cspblas_dcsrsymv.
COMPLEX for mkl_cspblas_ccsrsymv.
2 Intel® Math Kernel Library Reference Manual
200
DOUBLE COMPLEX for mkl_cspblas_zcsrsymv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_cspblas_scsrsymv.
DOUBLE PRECISION for mkl_cspblas_dcsrsymv.
COMPLEX for mkl_cspblas_ccsrsymv.
DOUBLE COMPLEX for mkl_cspblas_zcsrsymv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_cspblas_scsrsymv(uplo, m, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_dcsrsymv(uplo, m, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_ccsrsymv(uplo, m, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_zcsrsymv(uplo, m, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_cspblas_scsrsymv(char *uplo, int *m, float *a,
int *ia, int *ja, float *x, float *y);
void mkl_cspblas_dcsrsymv(char *uplo, int *m, double *a,
int *ia, int *ja, double *x, double *y);
BLAS and Sparse BLAS Routines 2
201
void mkl_cspblas_ccsrsymv(char *uplo, int *m, MKL_Complex8 *a,
int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_cspblas_zcsrsymv(char *uplo, int *m, MKL_Complex16 *a,
int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_cspblas_?bsrsymv
Computes matrix-vector product of a sparse
symmetrical matrix stored in the BSR format (3-arrays
variation) with zero-based indexing.
Syntax
Fortran:
call mkl_cspblas_sbsrsymv(uplo, m, lb, a, ia, ja, x, y)
call mkl_cspblas_dbsrsymv(uplo, m, lb, a, ia, ja, x, y)
call mkl_cspblas_cbsrsymv(uplo, m, lb, a, ia, ja, x, y)
call mkl_cspblas_zbsrsymv(uplo, m, lb, a, ia, ja, x, y)
C:
mkl_cspblas_sbsrsymv(&uplo, &m, &lb, a, ia, ja, x, y);
mkl_cspblas_dbsrsymv(&uplo, &m, &lb, a, ia, ja, x, y);
mkl_cspblas_cbsrsymv(&uplo, &m, &lb, a, ia, ja, x, y);
mkl_cspblas_zbsrsymv(&uplo, &m, &lb, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_cspblas_?bsrsymv routine performs a matrix-vector operation defined as
y := A*x
where:
x and y are vectors,
A is an upper or lower triangle of the symmetrical sparse matrix in the BSR format (3-array variation) with
zero-based indexing.
NOTE This routine supports only zero-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
2 Intel® Math Kernel Library Reference Manual
202
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
m INTEGER. Number of block rows of the matrix A.
lb INTEGER. Size of the block in the matrix A.
a REAL for mkl_cspblas_sbsrsymv.
DOUBLE PRECISION for mkl_cspblas_dbsrsymv.
COMPLEX for mkl_cspblas_cbsrsymv.
DOUBLE COMPLEX for mkl_cspblas_zbsrsymv.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by lb*lb.
Refer to values array description in BSR Format for more details.
ia INTEGER. Array of length (m + 1), containing indices of block in the array
a, such that ia(i) is the index in the array a of the first non-zero element
from the row i. The value of the last element ia(m + 1) is equal to the
number of non-zero blocks plus one. Refer to rowIndex array description in
BSR Format for more details.
ja INTEGER. Array containing the column indices for each non-zero block in
the matrix A.
Its length is equal to the number of non-zero blocks of the matrix A. Refer
to columns array description in BSR Format for more details.
x REAL for mkl_cspblas_sbsrsymv.
DOUBLE PRECISION for mkl_cspblas_dbsrsymv.
COMPLEX for mkl_cspblas_cbsrsymv.
DOUBLE COMPLEX for mkl_cspblas_zbsrsymv.
Array, DIMENSION (m*lb).
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_cspblas_sbsrsymv.
DOUBLE PRECISION for mkl_cspblas_dbsrsymv.
COMPLEX for mkl_cspblas_cbsrsymv.
DOUBLE COMPLEX for mkl_cspblas_zbsrsymv.
Array, DIMENSION at least (m*lb).
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_cspblas_sbsrsymv(uplo, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m, lb
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
BLAS and Sparse BLAS Routines 2
203
SUBROUTINE mkl_cspblas_dbsrsymv(uplo, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_cbsrsymv(uplo, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m, lb
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_zbsrsymv(uplo, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_cspblas_sbsrsymv(char *uplo, int *m, int *lb,
float *a, int *ia, int *ja, float *x, float *y);
void mkl_cspblas_dbsrsymv(char *uplo, int *m, int *lb,
double *a, int *ia, int *ja, double *x, double *y);
void mkl_cspblas_cbsrsymv(char *uplo, int *m, int *lb,
MKL_Complex8 *a, int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_cspblas_zbsrsymv(char *uplo, int *m, int *lb,
MKL_Complex16 *a, int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_cspblas_?coosymv
Computes matrix - vector product of a sparse
symmetrical matrix stored in the coordinate format
with zero-based indexing .
Syntax
Fortran:
call mkl_cspblas_scoosymv(uplo, m, val, rowind, colind, nnz, x, y)
call mkl_cspblas_dcoosymv(uplo, m, val, rowind, colind, nnz, x, y)
call mkl_cspblas_ccoosymv(uplo, m, val, rowind, colind, nnz, x, y)
call mkl_cspblas_zcoosymv(uplo, m, val, rowind, colind, nnz, x, y)
C:
mkl_cspblas_scoosymv(&uplo, &m, val, rowind, colind, &nnz, x, y);
mkl_cspblas_dcoosymv(&uplo, &m, val, rowind, colind, &nnz, x, y);
2 Intel® Math Kernel Library Reference Manual
204
mkl_cspblas_ccoosymv(&uplo, &m, val, rowind, colind, &nnz, x, y);
mkl_cspblas_zcoosymv(&uplo, &m, val, rowind, colind, &nnz, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_cspblas_?coosymv routine performs a matrix-vector operation defined as
y := A*x
where:
x and y are vectors,
A is an upper or lower triangle of the symmetrical sparse matrix in the coordinate format with zero-based
indexing.
NOTE This routine supports only zero-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
m INTEGER. Number of rows of the matrix A.
val REAL for mkl_cspblas_scoosymv.
DOUBLE PRECISION for mkl_cspblas_dcoosymv.
COMPLEX for mkl_cspblas_ccoosymv.
DOUBLE COMPLEX for mkl_cspblas_zcoosymv.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
x REAL for mkl_cspblas_scoosymv.
DOUBLE PRECISION for mkl_cspblas_dcoosymv.
COMPLEX for mkl_cspblas_ccoosymv.
DOUBLE COMPLEX for mkl_cspblas_zcoosymv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
BLAS and Sparse BLAS Routines 2
205
Output Parameters
y REAL for mkl_cspblas_scoosymv.
DOUBLE PRECISION for mkl_cspblas_dcoosymv.
COMPLEX for mkl_cspblas_ccoosymv.
DOUBLE COMPLEX for mkl_cspblas_zcoosymv.
Array, DIMENSION at least m.
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_cspblas_scoosymv(uplo, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo
INTEGER m, nnz
INTEGER rowind(*), colind(*)
REAL val(*), x(*), y(*)
SUBROUTINE mkl_cspblas_dcoosymv(uplo, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION val(*), x(*), y(*)
SUBROUTINE mkl_cspblas_ccoosymv(uplo, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo
INTEGER m, nnz
INTEGER rowind(*), colind(*)
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_cspblas_zcoosymv(uplo, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_cspblas_scoosymv(char *uplo, int *m, float *val, int *rowind,
int *colind, int *nnz, float *x, float *y);
void mkl_cspblas_dcoosymv(char *uplo, int *m, double *val, int *rowind,
int *colind, int *nnz, double *x, double *y);
void mkl_cspblas_ccoosymv(char *uplo, int *m, MKL_Complex8 *val, int *rowind,
int *colind, int *nnz, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_cspblas_zcoosymv(char *uplo, int *m, MKL_Complex16 *val, int *rowind,
int *colind, int *nnz, MKL_Complex16 *x, MKL_Complex16 *y);
2 Intel® Math Kernel Library Reference Manual
206
mkl_cspblas_?csrtrsv
Triangular solvers with simplified interface for a sparse
matrix in the CSR format (3-array variation) with
zero-based indexing.
Syntax
Fortran:
call mkl_cspblas_scsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
call mkl_cspblas_dcsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
call mkl_cspblas_ccsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
call mkl_cspblas_zcsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
C:
mkl_cspblas_scsrtrsv(&uplo, &transa, &diag, &m, a, ia, ja, x, y);
mkl_cspblas_dcsrtrsv(&uplo, &transa, &diag, &m, a, ia, ja, x, y);
mkl_cspblas_ccsrtrsv(&uplo, &transa, &diag, &m, a, ia, ja, x, y);
mkl_cspblas_zcsrtrsv(&uplo, &transa, &diag, &m, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_cspblas_?csrtrsv routine solves a system of linear equations with matrix-vector operations for a
sparse matrix stored in the CSR format (3-array variation) with zero-based indexing:
A*y = x
or
A'*y = x,
where:
x and y are vectors,
A is a sparse upper or lower triangular matrix with unit or non-unit main diagonal, A' is the transpose of A.
NOTE This routine supports only zero-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then A*y = x
BLAS and Sparse BLAS Routines 2
207
If transa = 'T' or 't' or 'C' or 'c', then A'*y = x,
diag CHARACTER*1. Specifies whether matrix A is unit triangular.
If diag = 'U' or 'u', then A is unit triangular.
If diag = 'N' or 'n', then A is not unit triangular.
m INTEGER. Number of rows of the matrix A.
a REAL for mkl_cspblas_scsrtrsv.
DOUBLE PRECISION for mkl_cspblas_dcsrtrsv.
COMPLEX for mkl_cspblas_ccsrtrsv.
DOUBLE COMPLEX for mkl_cspblas_zcsrtrsv.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
ia INTEGER. Array of length m+1, containing indices of elements in the array a,
such that ia(i) is the index in the array a of the first non-zero element
from the row i. The value of the last element ia(m) is equal to the number
of non-zeros. Refer to rowIndex array description in Sparse Matrix Storage
Formats for more details.
ja INTEGER. Array containing the column indices for each non-zero element of
the matrix A.
Its length is equal to the length of the array a. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
NOTE Column indices must be sorted in increasing order for each row.
x REAL for mkl_cspblas_scsrtrsv.
DOUBLE PRECISION for mkl_cspblas_dcsrtrsv.
COMPLEX for mkl_cspblas_ccsrtrsv.
DOUBLE COMPLEX for mkl_cspblas_zcsrtrsv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_cspblas_scsrtrsv.
DOUBLE PRECISION for mkl_cspblas_dcsrtrsv.
COMPLEX for mkl_cspblas_ccsrtrsv.
DOUBLE COMPLEX for mkl_cspblas_zcsrtrsv.
Array, DIMENSION at least m.
Contains the vector y.
2 Intel® Math Kernel Library Reference Manual
208
Interfaces
FORTRAN 77:
SUBROUTINE mkl_cspblas_scsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_dcsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_ccsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_zcsrtrsv(uplo, transa, diag, m, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_cspblas_scsrtrsv(char *uplo, char *transa, char *diag, int *m,
float *a, int *ia, int *ja, float *x, float *y);
void mkl_cspblas_dcsrtrsv(char *uplo, char *transa, char *diag, int *m,
double *a, int *ia, int *ja, double *x, double *y);
void mkl_cspblas_ccsrtrsv(char *uplo, char *transa, char *diag, int *m,
MKL_Complex8 *a, int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_cspblas_zcsrtrsv(char *uplo, char *transa, char *diag, int *m,
MKL_Complex16 *a, int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_cspblas_?bsrtrsv
Triangular solver with simplified interface for a sparse
matrix stored in the BSR format (3-array variation)
with zero-based indexing.
BLAS and Sparse BLAS Routines 2
209
Syntax
Fortran:
call mkl_cspblas_sbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
call mkl_cspblas_dbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
call mkl_cspblas_cbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
call mkl_cspblas_zbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
C:
mkl_cspblas_sbsrtrsv(&uplo, &transa, &diag, &m, &lb, a, ia, ja, x, y);
mkl_cspblas_dbsrtrsv(&uplo, &transa, &diag, &m, &lb, a, ia, ja, x, y);
mkl_cspblas_cbsrtrsv(&uplo, &transa, &diag, &m, &lb, a, ia, ja, x, y);
mkl_cspblas_zbsrtrsv(&uplo, &transa, &diag, &m, &lb, a, ia, ja, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_cspblas_?bsrtrsv routine solves a system of linear equations with matrix-vector operations for a
sparse matrix stored in the BSR format (3-array variation) with zero-based indexing:
y := A*x
or
y := A'*x,
where:
x and y are vectors,
A is a sparse upper or lower triangular matrix with unit or non-unit main diagonal, A' is the transpose of A.
NOTE This routine supports only zero-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies the upper or low triangle of the matrix A is used.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-vector product is computed as
y := A*x
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as y := A'*x.
diag CHARACTER*1. Specifies whether matrix A is unit triangular or not.
If diag = 'U' or 'u', A is unit triangular.
2 Intel® Math Kernel Library Reference Manual
210
If diag = 'N' or 'n', A is not unit triangular.
m INTEGER. Number of block rows of the matrix A.
lb INTEGER. Size of the block in the matrix A.
a REAL for mkl_cspblas_sbsrtrsv.
DOUBLE PRECISION for mkl_cspblas_dbsrtrsv.
COMPLEX for mkl_cspblas_cbsrtrsv.
DOUBLE COMPLEX for mkl_cspblas_zbsrtrsv.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by lb*lb.
Refer to values array description in BSR Format for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
ia INTEGER. Array of length (m + 1), containing indices of block in the array
a, such that ia(I) is the index in the array a of the first non-zero element
from the row I. The value of the last element ia(m + 1) is equal to the
number of non-zero blocks. Refer to rowIndex array description in BSR
Format for more details.
ja INTEGER. Array containing the column indices for each non-zero block in
the matrix A.
Its length is equal to the number of non-zero blocks of the matrix A. Refer
to columns array description in BSR Format for more details.
x REAL for mkl_cspblas_sbsrtrsv.
DOUBLE PRECISION for mkl_cspblas_dbsrtrsv.
COMPLEX for mkl_cspblas_cbsrtrsv.
DOUBLE COMPLEX for mkl_cspblas_zbsrtrsv.
Array, DIMENSION (m*lb).
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_cspblas_sbsrtrsv.
DOUBLE PRECISION for mkl_cspblas_dbsrtrsv.
COMPLEX for mkl_cspblas_cbsrtrsv.
DOUBLE COMPLEX for mkl_cspblas_zbsrtrsv.
Array, DIMENSION at least (m*lb).
On exit, the array y must contain the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_cspblas_sbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lb
INTEGER ia(*), ja(*)
REAL a(*), x(*), y(*)
BLAS and Sparse BLAS Routines 2
211
SUBROUTINE mkl_cspblas_dbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE PRECISION a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_cbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lb
INTEGER ia(*), ja(*)
COMPLEX a(*), x(*), y(*)
SUBROUTINE mkl_cspblas_zbsrtrsv(uplo, transa, diag, m, lb, a, ia, ja, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, lb
INTEGER ia(*), ja(*)
DOUBLE COMPLEX a(*), x(*), y(*)
C:
void mkl_cspblas_sbsrtrsv(char *uplo, char *transa, char *diag, int *m,
int *lb, float *a, int *ia, int *ja, float *x, float *y);
void mkl_cspblas_dbsrtrsv(char *uplo, char *transa, char *diag, int *m,
int *lb, double *a, int *ia, int *ja, double *x, double *y);
void mkl_cspblas_cbsrtrsv(char *uplo, char *transa, char *diag, int *m,
int *lb, MKL_Complex8 *a, int *ia, int *ja, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_cspblas_zbsrtrsv(char *uplo, char *transa, char *diag, int *m,
int *lb, MKL_Complex16 *a, int *ia, int *ja, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_cspblas_?cootrsv
Triangular solvers with simplified interface for a sparse
matrix in the coordinate format with zero-based
indexing .
Syntax
Fortran:
call mkl_cspblas_scootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
call mkl_cspblas_dcootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
call mkl_cspblas_ccootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
call mkl_cspblas_zcootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
C:
mkl_cspblas_scootrsv(&uplo, &transa, &diag, &m, val, rowind, colind, &nnz, x, y);
mkl_cspblas_dcootrsv(&uplo, &transa, &diag, &m, val, rowind, colind, &nnz, x, y);
2 Intel® Math Kernel Library Reference Manual
212
mkl_cspblas_ccootrsv(&uplo, &transa, &diag, &m, val, rowind, colind, &nnz, x, y);
mkl_cspblas_zcootrsv(&uplo, &transa, &diag, &m, val, rowind, colind, &nnz, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_cspblas_?cootrsv routine solves a system of linear equations with matrix-vector operations for a
sparse matrix stored in the coordinate format with zero-based indexing:
A*y = x
or
A'*y = x,
where:
x and y are vectors,
A is a sparse upper or lower triangular matrix with unit or non-unit main diagonal, A' is the transpose of A.
NOTE This routine supports only zero-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
uplo CHARACTER*1. Specifies whether the upper or low triangle of the matrix A is
considered.
If uplo = 'U' or 'u', then the upper triangle of the matrix A is used.
If uplo = 'L' or 'l', then the low triangle of the matrix A is used.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then A*y = x
If transa = 'T' or 't' or 'C' or 'c', then A'*y = x,
diag CHARACTER*1. Specifies whether A is unit triangular.
If diag = 'U' or 'u', then A is unit triangular.
If diag = 'N' or 'n', then A is not unit triangular.
m INTEGER. Number of rows of the matrix A.
val REAL for mkl_cspblas_scootrsv.
DOUBLE PRECISION for mkl_cspblas_dcootrsv.
COMPLEX for mkl_cspblas_ccootrsv.
DOUBLE COMPLEX for mkl_cspblas_zcootrsv.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
BLAS and Sparse BLAS Routines 2
213
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
x REAL for mkl_cspblas_scootrsv.
DOUBLE PRECISION for mkl_cspblas_dcootrsv.
COMPLEX for mkl_cspblas_ccootrsv.
DOUBLE COMPLEX for mkl_cspblas_zcootrsv.
Array, DIMENSION is m.
On entry, the array x must contain the vector x.
Output Parameters
y REAL for mkl_cspblas_scootrsv.
DOUBLE PRECISION for mkl_cspblas_dcootrsv.
COMPLEX for mkl_cspblas_ccootrsv.
DOUBLE COMPLEX for mkl_cspblas_zcootrsv.
Array, DIMENSION at least m.
Contains the vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_cspblas_scootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, nnz
INTEGER rowind(*), colind(*)
REAL val(*), x(*), y(*)
SUBROUTINE mkl_cspblas_dcootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION val(*), x(*), y(*)
SUBROUTINE mkl_cspblas_ccootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, nnz
INTEGER rowind(*), colind(*)
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_cspblas_zcootrsv(uplo, transa, diag, m, val, rowind, colind, nnz, x, y)
CHARACTER*1 uplo, transa, diag
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX val(*), x(*), y(*)
2 Intel® Math Kernel Library Reference Manual
214
C:
void mkl_cspblas_scootrsv(char *uplo, char *transa, char *diag, int *m,
float *val, int *rowind, int *colind, int *nnz, float *x, float *y);
void mkl_cspblas_dcootrsv(char *uplo, char *transa, char *diag, int *m,
double *val, int *rowind, int *colind, int *nnz, double *x, double *y);
void mkl_cspblas_ccootrsv(char *uplo, char *transa, char *diag, int *m,
MKL_Complex8 *val, int *rowind, int *colind, int *nnz, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_cspblas_zcootrsv(char *uplo, char *transa, char *diag, int *m,
MKL_Complex16 *val, int *rowind, int *colind, int *nnz, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?csrmv
Computes matrix - vector product of a sparse matrix
stored in the CSR format.
Syntax
Fortran:
call mkl_scsrmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)
call mkl_dcsrmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)
call mkl_ccsrmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)
call mkl_zcsrmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)
C:
mkl_scsrmv(&transa, &m, &k, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta, y);
mkl_dcsrmv(&transa, &m, &k, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta, y);
mkl_ccsrmv(&transa, &m, &k, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta, y);
mkl_zcsrmv(&transa, &m, &k, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?csrmv routine performs a matrix-vector operation defined as
y := alpha*A*x + beta*y
or
y := alpha*A'*x + beta*y,
where:
alpha and beta are scalars,
x and y are vectors,
A is an m-by-k sparse matrix in the CSR format, A' is the transpose of A.
BLAS and Sparse BLAS Routines 2
215
NOTE This routine supports a CSR format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then y := alpha*A*x + beta*y
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*A'*x + beta*y,
m INTEGER. Number of rows of the matrix A.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_scsrmv.
DOUBLE PRECISION for mkl_dcsrmv.
COMPLEX for mkl_ccsrmv.
DOUBLE COMPLEX for mkl_zcsrmv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scsrmv.
DOUBLE PRECISION for mkl_dcsrmv.
COMPLEX for mkl_ccsrmv.
DOUBLE COMPLEX for mkl_zcsrmv.
Array containing non-zero elements of the matrix A.
For one-based indexing its length is pntre(m) - pntrb(1).
For zero-based indexing its length is pntre(m-1) - pntrb(0).
Refer to values array description in CSR Format for more details.
indx INTEGER. Array containing the column indices for each non-zero element of
the matrix A.Its length is equal to length of the val array.
Refer to columns array description in CSR Format for more details.
pntrb INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntrb(i)
- pntrb(1)+1 is the first index of row i in the arrays val and indx.
For zero-based indexing this array contains row indices, such that
pntrb(i) - pntrb(0) is the first index of row i in the arrays val and
indx. Refer to pointerb array description in CSR Format for more details.
pntre INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntre(i)
- pntrb(1) is the last index of row i in the arrays val and indx.
For zero-based indexing this array contains row indices, such that
pntre(i) - pntrb(0)-1 is the last index of row i in the arrays val and
indx.Refer to pointerE array description in CSR Format for more details.
x REAL for mkl_scsrmv.
DOUBLE PRECISION for mkl_dcsrmv.
COMPLEX for mkl_ccsrmv.
DOUBLE COMPLEX for mkl_zcsrmv.
2 Intel® Math Kernel Library Reference Manual
216
Array, DIMENSION at least k if transa = 'N' or 'n' and at least m
otherwise. On entry, the array x must contain the vector x.
beta REAL for mkl_scsrmv.
DOUBLE PRECISION for mkl_dcsrmv.
COMPLEX for mkl_ccsrmv.
DOUBLE COMPLEX for mkl_zcsrmv.
Specifies the scalar beta.
y REAL for mkl_scsrmv.
DOUBLE PRECISION for mkl_dcsrmv.
COMPLEX for mkl_ccsrmv.
DOUBLE COMPLEX for mkl_zcsrmv.
Array, DIMENSION at least m if transa = 'N' or 'n' and at least k
otherwise. On entry, the array y must contain the vector y.
Output Parameters
y Overwritten by the updated vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrmv(transa, m, k, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha, beta
REAL val(*), x(*), y(*)
SUBROUTINE mkl_dcsrmv(transa, m, k, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), x(*), y(*)
SUBROUTINE mkl_ccsrmv(transa, m, k, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha, beta
COMPLEX val(*), x(*), y(*)
BLAS and Sparse BLAS Routines 2
217
SUBROUTINE mkl_zcsrmv(transa, m, k, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_scsrmv(char *transa, int *m, int *k, float *alpha, char *matdescra,
float *val, int *indx, int *pntrb, int *pntre, float *x, float *beta, float *y);
void mkl_dcsrmv(char *transa, int *m, int *k, double *alpha, char *matdescra,
double *val, int *indx, int *pntrb, int *pntre, double *x, double *beta, double *y);
void mkl_ccsrmv(char *transa, int *m, int *k, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *indx, int *pntrb, int *pntre, MKL_Complex8 *x, MKL_Complex8 *beta, double *y);
void mkl_zcsrmv(char *transa, int *m, int *k, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *indx, int *pntrb, int *pntre, MKL_Complex16 *x, MKL_Complex16 *beta,
MKL_Complex16 *y);
mkl_?bsrmv
Computes matrix - vector product of a sparse matrix
stored in the BSR format.
Syntax
Fortran:
call mkl_sbsrmv(transa, m, k, lb, alpha, matdescra, val, indx, pntrb, pntre, x, beta,
y)
call mkl_dbsrmv(transa, m, k, lb, alpha, matdescra, val, indx, pntrb, pntre, x, beta,
y)
call mkl_cbsrmv(transa, m, k, lb, alpha, matdescra, val, indx, pntrb, pntre, x, beta,
y)
call mkl_zbsrmv(transa, m, k, lb, alpha, matdescra, val, indx, pntrb, pntre, x, beta,
y)
C:
mkl_sbsrmv(&transa, &m, &k, &lb, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta,
y);
mkl_dbsrmv(&transa, &m, &k, &lb, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta,
y);
mkl_cbsrmv(&transa, &m, &k, &lb, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta,
y);
mkl_zbsrmv(&transa, &m, &k, &lb, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta,
y);
2 Intel® Math Kernel Library Reference Manual
218
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?bsrmv routine performs a matrix-vector operation defined as
y := alpha*A*x + beta*y
or
y := alpha*A'*x + beta*y,
where:
alpha and beta are scalars,
x and y are vectors,
A is an m-by-k block sparse matrix in the BSR format, A' is the transpose of A.
NOTE This routine supports a BSR format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-vector product is computed as
y := alpha*A*x + beta*y
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as y := alpha*A'*x + beta*y,
m INTEGER. Number of block rows of the matrix A.
k INTEGER. Number of block columns of the matrix A.
lb INTEGER. Size of the block in the matrix A.
alpha REAL for mkl_sbsrmv.
DOUBLE PRECISION for mkl_dbsrmv.
COMPLEX for mkl_cbsrmv.
DOUBLE COMPLEX for mkl_zbsrmv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_sbsrmv.
DOUBLE PRECISION for mkl_dbsrmv.
COMPLEX for mkl_cbsrmv.
DOUBLE COMPLEX for mkl_zbsrmv.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by lb*lb.
BLAS and Sparse BLAS Routines 2
219
Refer to values array description in BSR Format for more details.
indx INTEGER. Array containing the column indices for each non-zero block in
the matrix A. Its length is equal to the number of non-zero blocks in the
matrix A.
Refer to columns array description in BSR Format for more details.
pntrb INTEGER. Array of length m.
For one-based indexing: this array contains row indices, such that
pntrb(i) - pntrb(1)+1 is the first index of block row i in the array
indx.
For zero-based indexing: this array contains row indices, such that
pntrb(i) - pntrb(0) is the first index of block row i in the array indx
Refer to pointerB array description in BSR Format for more details.
pntre INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntre(i)
- pntrb(1) is the last index of block row i in the array indx.
For zero-based indexing this array contains row indices, such that
pntre(i) - pntrb(0)-1 is the last index of block row i in the array indx.
Refer to pointerE array description in BSR Format for more details.
x REAL for mkl_sbsrmv.
DOUBLE PRECISION for mkl_dbsrmv.
COMPLEX for mkl_cbsrmv.
DOUBLE COMPLEX for mkl_zbsrmv.
Array, DIMENSION at least (k*lb) if transa = 'N' or 'n', and at least
(m*lb) otherwise. On entry, the array x must contain the vector x.
beta REAL for mkl_sbsrmv.
DOUBLE PRECISION for mkl_dbsrmv.
COMPLEX for mkl_cbsrmv.
DOUBLE COMPLEX for mkl_zbsrmv.
Specifies the scalar beta.
y REAL for mkl_sbsrmv.
DOUBLE PRECISION for mkl_dbsrmv.
COMPLEX for mkl_cbsrmv.
DOUBLE COMPLEX for mkl_zbsrmv.
Array, DIMENSION at least (m*lb) if transa = 'N' or 'n', and at least
(k*lb) otherwise. On entry, the array y must contain the vector y.
Output Parameters
y Overwritten by the updated vector y.
2 Intel® Math Kernel Library Reference Manual
220
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sbsrmv(transa, m, k, lb, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, lb
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha, beta
REAL val(*), x(*), y(*)
SUBROUTINE mkl_dbsrmv(transa, m, k, lb, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, lb
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), x(*), y(*)
SUBROUTINE mkl_cbsrmv(transa, m, k, lb, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, lb
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha, beta
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_zbsrmv(transa, m, k, lb, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, lb
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_sbsrmv(char *transa, int *m, int *k, int *lb,
float *alpha, char *matdescra, float *val, int *indx,
int *pntrb, int *pntre, float *x, float *beta, float *y);
BLAS and Sparse BLAS Routines 2
221
void mkl_dbsrmv(char *transa, int *m, int *k, int *lb,
double *alpha, char *matdescra, double *val, int *indx,
int *pntrb, int *pntre, double *x, double *beta, double *y);
void mkl_cbsrmv(char *transa, int *m, int *k, int *lb,
MKL_Complex8 *alpha, char *matdescra, MKL_Complex8 *val, int *indx,
int *pntrb, int *pntre, MKL_Complex8 *x, MKL_Complex8 *beta, MKL_Complex8 *y);
void mkl_zbsrmv(char *transa, int *m, int *k, int *lb,
MKL_Complex16 *alpha, char *matdescra, MKL_Complex16 *val, int *indx,
int *pntrb, int *pntre, MKL_Complex16 *x, MKL_Complex16 *beta, MKL_Complex16 *y);
mkl_?cscmv
Computes matrix-vector product for a sparse matrix in
the CSC format.
Syntax
Fortran:
call mkl_scscmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)
call mkl_dcscmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)
call mkl_ccscmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)
call mkl_zcscmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)
C:
mkl_scscmv(&transa, &m, &k, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta, y);
mkl_dcscmv(&transa, &m, &k, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta, y);
mkl_ccscmv(&transa, &m, &k, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta, y);
mkl_zcscmv(&transa, &m, &k, &alpha, matdescra, val, indx, pntrb, pntre, x, &beta, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?cscmv routine performs a matrix-vector operation defined as
y := alpha*A*x + beta*y
or
y := alpha*A'*x + beta*y,
where:
alpha and beta are scalars,
x and y are vectors,
A is an m-by-k sparse matrix in compressed sparse column (CSC) format, A' is the transpose of A.
2 Intel® Math Kernel Library Reference Manual
222
NOTE This routine supports CSC format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then y := alpha*A*x + beta*y
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*A'*x + beta*y,
m INTEGER. Number of rows of the matrix A.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_scscmv.
DOUBLE PRECISION for mkl_dcscmv.
COMPLEX for mkl_ccscmv.
DOUBLE COMPLEX for mkl_zcscmv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scscmv.
DOUBLE PRECISION for mkl_dcscmv.
COMPLEX for mkl_ccscmv.
DOUBLE COMPLEX for mkl_zcscmv.
Array containing non-zero elements of the matrix A.
For one-based indexing its length is pntre(k) - pntrb(1).
For zero-based indexing its length is pntre(m-1) - pntrb(0).
Refer to values array description in CSC Format for more details.
indx INTEGER. Array containing the row indices for each non-zero element of the
matrix A. Its length is equal to length of the val array.
Refer to rows array description in CSC Format for more details.
pntrb INTEGER. Array of length k.
For one-based indexing this array contains column indices, such that
pntrb(i) - pntrb(1)+1 is the first index of column i in the arrays val
and indx.
For zero-based indexing this array contains column indices, such that
pntrb(i) - pntrb(0) is the first index of column i in the arrays val and
indx.
Refer to pointerb array description in CSC Format for more details.
pntre INTEGER. Array of length k.
For one-based indexing this array contains column indices, such that
pntre(i) - pntrb(1) is the last index of column i in the arrays val and
indx.
For zero-based indexing this array contains column indices, such that
pntre(i) - pntrb(1)-1 is the last index of column i in the arrays val
and indx.
Refer to pointerE array description in CSC Format for more details.
BLAS and Sparse BLAS Routines 2
223
x REAL for mkl_scscmv.
DOUBLE PRECISION for mkl_dcscmv.
COMPLEX for mkl_ccscmv.
DOUBLE COMPLEX for mkl_zcscmv.
Array, DIMENSION at least k if transa = 'N' or 'n' and at least m
otherwise. On entry, the array x must contain the vector x.
beta REAL for mkl_scscmv.
DOUBLE PRECISION for mkl_dcscmv.
COMPLEX for mkl_ccscmv.
DOUBLE COMPLEX for mkl_zcscmv.
Specifies the scalar beta.
y REAL for mkl_scscmv.
DOUBLE PRECISION for mkl_dcscmv.
COMPLEX for mkl_ccscmv.
DOUBLE COMPLEX for mkl_zcscmv.
Array, DIMENSION at least m if transa = 'N' or 'n' and at least k
otherwise. On entry, the array y must contain the vector y.
Output Parameters
y Overwritten by the updated vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scscmv(transa, m, k, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha, beta
REAL val(*), x(*), y(*)
SUBROUTINE mkl_dcscmv(transa, m, k, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), x(*), y(*)
2 Intel® Math Kernel Library Reference Manual
224
SUBROUTINE mkl_ccscmv(transa, m, k, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha, beta
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_zcscmv(transa, m, k, alpha, matdescra, val, indx,
pntrb, pntre, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_scscmv(char *transa, int *m, int *k, float *alpha,
char *matdescra, float *val, int *indx, int *pntrb,
int *pntre, float *x, float *beta, float *y);
void mkl_dcscmv(char *transa, int *m, int *k, double *alpha,
char *matdescra, double *val, int *indx, int *pntrb,
int *pntre, double *x, double *beta, double *y);
void mkl_ccscmv(char *transa, int *m, int *k, MKL_Complex8 *alpha,
char *matdescra, MKL_Complex8 *val, int *indx, int *pntrb,
int *pntre, MKL_Complex8 *x, MKL_Complex8 *beta, MKL_Complex8 *y);
void mkl_zcscmv(char *transa, int *m, int *k, MKL_Complex16 *alpha,
char *matdescra, MKL_Complex16 *val, int *indx, int *pntrb,
int *pntre, MKL_Complex16 *x, MKL_Complex16 *beta, MKL_Complex16 *y);
mkl_?coomv
Computes matrix - vector product for a sparse matrix
in the coordinate format.
Syntax
Fortran:
call mkl_scoomv(transa, m, k, alpha, matdescra, val, rowind, colind, nnz, x, beta, y)
call mkl_dcoomv(transa, m, k, alpha, matdescra, val, rowind, colind, nnz, x, beta, y)
call mkl_ccoomv(transa, m, k, alpha, matdescra, val, rowind, colind, nnz, x, beta, y)
BLAS and Sparse BLAS Routines 2
225
call mkl_zcoomv(transa, m, k, alpha, matdescra, val, rowind, colind, nnz, x, beta, y)
C:
mkl_scoomv(&transa, &m, &k, &alpha, matdescra, val, rowind, colind, &nnz, x, &beta,
y);
mkl_dcoomv(&transa, &m, &k, &alpha, matdescra, val, rowind, colind, &nnz, x, &beta,
y);
mkl_ccoomv(&transa, &m, &k, &alpha, matdescra, val, rowind, colind, &nnz, x, &beta,
y);
mkl_zcoomv(&transa, &m, &k, &alpha, matdescra, val, rowind, colind, &nnz, x, &beta,
y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?coomv routine performs a matrix-vector operation defined as
y := alpha*A*x + beta*y
or
y := alpha*A'*x + beta*y,
where:
alpha and beta are scalars,
x and y are vectors,
A is an m-by-k sparse matrix in compressed coordinate format, A' is the transpose of A.
NOTE This routine supports a coordinate format both with one-based indexing and zero-based
indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then y := alpha*A*x + beta*y
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*A'*x + beta*y,
m INTEGER. Number of rows of the matrix A.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_scoomv.
DOUBLE PRECISION for mkl_dcoomv.
COMPLEX for mkl_ccoomv.
DOUBLE COMPLEX for mkl_zcoomv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
2 Intel® Math Kernel Library Reference Manual
226
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scoomv.
DOUBLE PRECISION for mkl_dcoomv.
COMPLEX for mkl_ccoomv.
DOUBLE COMPLEX for mkl_zcoomv.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
x REAL for mkl_scoomv.
DOUBLE PRECISION for mkl_dcoomv.
COMPLEX for mkl_ccoomv.
DOUBLE COMPLEX for mkl_zcoomv.
Array, DIMENSION at least k if transa = 'N' or 'n' and at least m
otherwise. On entry, the array x must contain the vector x.
beta REAL for mkl_scoomv.
DOUBLE PRECISION for mkl_dcoomv.
COMPLEX for mkl_ccoomv.
DOUBLE COMPLEX for mkl_zcoomv.
Specifies the scalar beta.
y REAL for mkl_scoomv.
DOUBLE PRECISION for mkl_dcoomv.
COMPLEX for mkl_ccoomv.
DOUBLE COMPLEX for mkl_zcoomv.
Array, DIMENSION at least m if transa = 'N' or 'n' and at least k
otherwise. On entry, the array y must contain the vector y.
Output Parameters
y Overwritten by the updated vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scoomv(transa, m, k, alpha, matdescra, val, rowind, colind, nnz, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, nnz
INTEGER rowind(*), colind(*)
REAL alpha, beta
REAL val(*), x(*), y(*)
BLAS and Sparse BLAS Routines 2
227
SUBROUTINE mkl_dcoomv(transa, m, k, alpha, matdescra, val, rowind, colind, nnz, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), x(*), y(*)
SUBROUTINE mkl_ccoomv(transa, m, k, alpha, matdescra, val, rowind, colind, nnz, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, nnz
INTEGER rowind(*), colind(*)
COMPLEX alpha, beta
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_zcoomv(transa, m, k, alpha, matdescra, val, rowind, colind, nnz, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_scoomv(char *transa, int *m, int *k, float *alpha, char *matdescra,
float *val, int *rowind, int *colind, int *nnz, float *x, float *beta, float *y);
void mkl_dcoomv(char *transa, int *m, int *k, double *alpha, char *matdescra,
double *val, int *rowind, int *colind, int *nnz, double *x, double *beta, double *y);
void mkl_ccoomv(char *transa, int *m, int *k, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *rowind, int *colind, int *nnz, MKL_Complex8 *x, MKL_Complex8 *beta,
MKL_Complex8 *y);
void mkl_zcoomv(char *transa, int *m, int *k, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *rowind, int *colind, int *nnz, MKL_Complex16 *x, MKL_Complex16 *beta,
MKL_Complex16 *y);
mkl_?csrsv
Solves a system of linear equations for a sparse
matrix in the CSR format.
Syntax
Fortran:
call mkl_scsrsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
2 Intel® Math Kernel Library Reference Manual
228
call mkl_dcsrsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
call mkl_ccsrsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
call mkl_zcsrsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
C:
mkl_scsrsv(&transa, &m, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
mkl_dcsrsv(&transa, &m, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
mkl_ccsrsv(&transa, &m, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
mkl_zcsrsv(&transa, &m, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?csrsv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix in the CSR format:
y := alpha*inv(A)*x
or
y := alpha*inv(A')*x,
where:
alpha is scalar, x and y are vectors, A is a sparse upper or lower triangular matrix with unit or non-unit main
diagonal, A' is the transpose of A.
NOTE This routine supports a CSR format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then y := alpha*inv(A)*x
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*inv(A')*x,
m INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_scsrsv.
DOUBLE PRECISION for mkl_dcsrsv.
COMPLEX for mkl_ccsrsv.
DOUBLE COMPLEX for mkl_zcsrsv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
BLAS and Sparse BLAS Routines 2
229
val REAL for mkl_scsrsv.
DOUBLE PRECISION for mkl_dcsrsv.
COMPLEX for mkl_ccsrsv.
DOUBLE COMPLEX for mkl_zcsrsv.
Array containing non-zero elements of the matrix A.
For one-based indexing its length is pntre(m) - pntrb(1).
For zero-based indexing its length is pntre(m-1) - pntrb(0).
Refer to values array description in CSR Format for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
indx INTEGER. Array containing the column indices for each non-zero element of
the matrix A. Its length is equal to length of the val array.
Refer to columns array description in CSR Format for more details.
NOTE Column indices must be sorted in increasing order for each row.
pntrb INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntrb(i)
- pntrb(1)+1 is the first index of row i in the arrays val and indx.
For zero-based indexing this array contains row indices, such that
pntrb(i) - pntrb(0) is the first index of row i in the arrays val and
indx. Refer to pointerb array description in CSR Format for more details.
pntre INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntre(i)
- pntrb(1) is the last index of row i in the arrays val and indx.
For zero-based indexing this array contains row indices, such that
pntre(i) - pntrb(0)-1 is the last index of row i in the arrays val and
indx.Refer to pointerE array description in CSR Format for more details.
x REAL for mkl_scsrsv.
DOUBLE PRECISION for mkl_dcsrsv.
COMPLEX for mkl_ccsrsv.
DOUBLE COMPLEX for mkl_zcsrsv.
Array, DIMENSION at least m.
On entry, the array x must contain the vector x. The elements are accessed
with unit increment.
y REAL for mkl_scsrsv.
DOUBLE PRECISION for mkl_dcsrsv.
COMPLEX for mkl_ccsrsv.
DOUBLE COMPLEX for mkl_zcsrsv.
Array, DIMENSION at least m.
On entry, the array y must contain the vector y. The elements are accessed
with unit increment.
Output Parameters
y Contains solution vector x.
2 Intel® Math Kernel Library Reference Manual
230
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha
REAL val(*)
REAL x(*), y(*)
SUBROUTINE mkl_dcsrsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*)
DOUBLE PRECISION x(*), y(*)
SUBROUTINE mkl_ccsrsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha
COMPLEX val(*)
COMPLEX x(*), y(*)
SUBROUTINE mkl_zcsrsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*)
DOUBLE COMPLEX x(*), y(*)
C:
void mkl_scsrsv(char *transa, int *m, float *alpha, char *matdescra,
float *val, int *indx, int *pntrb, int *pntre, float *x, float *y);
BLAS and Sparse BLAS Routines 2
231
void mkl_dcsrsv(char *transa, int *m, double *alpha, char *matdescra,
double *val, int *indx, int *pntrb, int *pntre, double *x, double *y);
void mkl_ccsrsv(char *transa, int *m, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *indx, int *pntrb, int *pntre, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zcsrsv(char *transa, int *m, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *indx, int *pntrb, int *pntre, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?bsrsv
Solves a system of linear equations for a sparse
matrix in the BSR format.
Syntax
Fortran:
call mkl_sbsrsv(transa, m, lb, alpha, matdescra, val, indx, pntrb, pntre, x, y)
call mkl_dbsrsv(transa, m, lb, alpha, matdescra, val, indx, pntrb, pntre, x, y)
call mkl_cbsrsv(transa, m, lb, alpha, matdescra, val, indx, pntrb, pntre, x, y)
call mkl_zbsrsv(transa, m, lb, alpha, matdescra, val, indx, pntrb, pntre, x, y)
C:
mkl_sbsrsv(&transa, &m, &lb, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
mkl_dbsrsv(&transa, &m, &lb, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
mkl_cbsrsv(&transa, &m, &lb, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
mkl_zbsrsv(&transa, &m, &lb, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?bsrsv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix in the BSR format:
y := alpha*inv(A)*x
or
y := alpha*inv(A')* x,
where:
alpha is scalar, x and y are vectors, A is a sparse upper or lower triangular matrix with unit or non-unit main
diagonal, A' is the transpose of A.
NOTE This routine supports a BSR format both with one-based indexing and zero-based indexing.
2 Intel® Math Kernel Library Reference Manual
232
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then y := alpha*inv(A)*x
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*inv(A')* x,
m INTEGER. Number of block columns of the matrix A.
lb INTEGER. Size of the block in the matrix A.
alpha REAL for mkl_sbsrsv.
DOUBLE PRECISION for mkl_dbsrsv.
COMPLEX for mkl_cbsrsv.
DOUBLE COMPLEX for mkl_zbsrsv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_sbsrsv.
DOUBLE PRECISION for mkl_dbsrsv.
COMPLEX for mkl_cbsrsv.
DOUBLE COMPLEX for mkl_zbsrsv.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by lb*lb.
Refer to the values array description in BSR Format for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
indx INTEGER. Array containing the column indices for each non-zero block in
the matrix A. Its length is equal to the number of non-zero blocks in the
matrix A.
Refer to the columns array description in BSR Format for more details.
pntrb INTEGER. Array of length m.
For one-based indexing: this array contains row indices, such that
pntrb(i) - pntrb(1)+1 is the first index of block row i in the array
indx.
For zero-based indexing: this array contains row indices, such that
pntrb(i) - pntrb(0) is the first index of block row i in the array indx
Refer to pointerB array description in BSR Format for more details.
pntre INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntre(i)
- pntrb(1) is the last index of block row i in the array indx.
For zero-based indexing this array contains row indices, such that
pntre(i) - pntrb(0)-1 is the last index of block row i in the array indx.
BLAS and Sparse BLAS Routines 2
233
Refer to pointerE array description in BSR Format for more details.
x REAL for mkl_sbsrsv.
DOUBLE PRECISION for mkl_dbsrsv.
COMPLEX for mkl_cbsrsv.
DOUBLE COMPLEX for mkl_zbsrsv.
Array, DIMENSION at least (m*lb).
On entry, the array x must contain the vector x. The elements are accessed
with unit increment.
y REAL for mkl_sbsrsv.
DOUBLE PRECISION for mkl_dbsrsv.
COMPLEX for mkl_cbsrsv.
DOUBLE COMPLEX for mkl_zbsrsv.
Array, DIMENSION at least (m*lb).
On entry, the array y must contain the vector y. The elements are accessed
with unit increment.
Output Parameters
y Contains solution vector x.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sbsrsv(transa, m, lb, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, lb
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha
REAL val(*)
REAL x(*), y(*)
SUBROUTINE mkl_dbsrsv(transa, m, lb, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, lb
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*)
DOUBLE PRECISION x(*), y(*)
2 Intel® Math Kernel Library Reference Manual
234
SUBROUTINE mkl_cbsrsv(transa, m, lb, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, lb
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha
COMPLEX val(*)
COMPLEX x(*), y(*)
SUBROUTINE mkl_zbsrsv(transa, m, lb, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, lb
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*)
DOUBLE COMPLEX x(*), y(*)
C:
void mkl_sbsrsv(char *transa, int *m, int *lb, float *alpha, char *matdescra,
float *val, int *indx, int *pntrb, int *pntre, float *x, float *y);
void mkl_dbsrsv(char *transa, int *m, int *lb, double *alpha, char *matdescra,
double *val, int *indx, int *pntrb, int *pntre, double *x, double *y);
void mkl_cbsrsv(char *transa, int *m, int *lb, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *indx, int *pntrb, int *pntre, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zbsrsv(char *transa, int *m, int *lb, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *indx, int *pntrb, int *pntre, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?cscsv
Solves a system of linear equations for a sparse
matrix in the CSC format.
Syntax
Fortran:
call mkl_scscsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)call
mkl_dcscsv
call mkl_dcscsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)call
mkl_dcscsv
call mkl_ccscsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)call
mkl_dcscsv
call mkl_zcscsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)call
mkl_dcscsv
BLAS and Sparse BLAS Routines 2
235
C:
mkl_scscsv(&transa, &m, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
mkl_dcscsv(&transa, &m, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
mkl_ccscsv(&transa, &m, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
mkl_zcscsv(&transa, &m, &alpha, matdescra, val, indx, pntrb, pntre, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?cscsv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix in the CSC format:
y := alpha*inv(A)*x
or
y := alpha*inv(A')* x,
where:
alpha is scalar, x and y are vectors, A is a sparse upper or lower triangular matrix with unit or non-unit main
diagonal, A' is the transpose of A.
NOTE This routine supports a CSC format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then y := alpha*inv(A)*x
If transa= 'T' or 't' or 'C' or 'c', then y := alpha*inv(A')* x,
m INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_scscsv.
DOUBLE PRECISION for mkl_dcscsv.
COMPLEX for mkl_ccscsv.
DOUBLE COMPLEX for mkl_zcscsv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scscsv.
DOUBLE PRECISION for mkl_dcscsv.
COMPLEX for mkl_ccscsv.
DOUBLE COMPLEX for mkl_zcscsv.
2 Intel® Math Kernel Library Reference Manual
236
Array containing non-zero elements of the matrix A.
For one-based indexing its length is pntre(m) - pntrb(1).
For zero-based indexing its length is pntre(m-1) - pntrb(0).
Refer to values array description in CSC Format for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
indx INTEGER. Array containing the row indices for each non-zero element of the
matrix A. Its length is equal to length of the val array.
Refer to columns array description in CSC Format for more details.
NOTE Row indices must be sorted in increasing order for each column.
pntrb INTEGER. Array of length m.
For one-based indexing this array contains column indices, such that
pntrb(i) - pntrb(1)+1 is the first index of column i in the arrays val
and indx.
For zero-based indexing this array contains column indices, such that
pntrb(i) - pntrb(0) is the first index of column i in the arrays val and
indx.
Refer to pointerb array description in CSC Format for more details.
pntre INTEGER. Array of length m.
For one-based indexing this array contains column indices, such that
pntre(i) - pntrb(1) is the last index of column i in the arrays val and
indx.
For zero-based indexing this array contains column indices, such that
pntre(i) - pntrb(1)-1 is the last index of column i in the arrays val
and indx.
Refer to pointerE array description in CSC Format for more details.
x REAL for mkl_scscsv.
DOUBLE PRECISION for mkl_dcscsv.
COMPLEX for mkl_ccscsv.
DOUBLE COMPLEX for mkl_zcscsv.
Array, DIMENSION at least m.
On entry, the array x must contain the vector x. The elements are accessed
with unit increment.
y REAL for mkl_scscsv.
DOUBLE PRECISION for mkl_dcscsv.
COMPLEX for mkl_ccscsv.
DOUBLE COMPLEX for mkl_zcscsv.
Array, DIMENSION at least m.
On entry, the array y must contain the vector y. The elements are accessed
with unit increment.
Output Parameters
y Contains the solution vector x.
BLAS and Sparse BLAS Routines 2
237
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scscsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha
REAL val(*)
REAL x(*), y(*)
SUBROUTINE mkl_dcscsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*)
DOUBLE PRECISION x(*), y(*)
SUBROUTINE mkl_ccscsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha
COMPLEX val(*)
COMPLEX x(*), y(*)
SUBROUTINE mkl_zcscsv(transa, m, alpha, matdescra, val, indx, pntrb, pntre, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*)
DOUBLE COMPLEX x(*), y(*)
C:
void mkl_scscsv(char *transa, int *m, float *alpha, char *matdescra,
float *val, int *indx, int *pntrb, int *pntre, float *x, float *y);
2 Intel® Math Kernel Library Reference Manual
238
void mkl_dcscsv(char *transa, int *m, double *alpha, char *matdescra,
double *val, int *indx, int *pntrb, int *pntre, double *x, double *y);
void mkl_ccscsv(char *transa, int *m, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *indx, int *pntrb, int *pntre, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zcscsv(char *transa, int *m, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *indx, int *pntrb, int *pntre, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?coosv
Solves a system of linear equations for a sparse
matrix in the coordinate format.
Syntax
Fortran:
call mkl_scoosv(transa, m, alpha, matdescra, val, rowind, colind, nnz, x, y)
call mkl_dcoosv(transa, m, alpha, matdescra, val, rowind, colind, nnz, x, y)
call mkl_ccoosv(transa, m, alpha, matdescra, val, rowind, colind, nnz, x, y)
call mkl_zcoosv(transa, m, alpha, matdescra, val, rowind, colind, nnz, x, y)
C:
mkl_scoosv(&transa, &m, &alpha, matdescra, val, rowind, colind, &nnz, x, y);
mkl_dcoosv(&transa, &m, &alpha, matdescra, val, rowind, colind, &nnz, x, y);
mkl_ccoosv(&transa, &m, &alpha, matdescra, val, rowind, colind, &nnz, x, y);
mkl_zcoosv(&transa, &m, &alpha, matdescra, val, rowind, colind, &nnz, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?coosv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix in the coordinate format:
y := alpha*inv(A)*x
or
y := alpha*inv(A')*x,
where:
alpha is scalar, x and y are vectors, A is a sparse upper or lower triangular matrix with unit or non-unit main
diagonal, A' is the transpose of A.
NOTE This routine supports a coordinate format both with one-based indexing and zero-based
indexing.
BLAS and Sparse BLAS Routines 2
239
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then y := alpha*inv(A)*x
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*inv(A')* x,
m INTEGER. Number of rows of the matrix A.
alpha REAL for mkl_scoosv.
DOUBLE PRECISION for mkl_dcoosv.
COMPLEX for mkl_ccoosv.
DOUBLE COMPLEX for mkl_zcoosv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scoosv.
DOUBLE PRECISION for mkl_dcoosv.
COMPLEX for mkl_ccoosv.
DOUBLE COMPLEX for mkl_zcoosv.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
x REAL for mkl_scoosv.
DOUBLE PRECISION for mkl_dcoosv.
COMPLEX for mkl_ccoosv.
DOUBLE COMPLEX for mkl_zcoosv.
Array, DIMENSION at least m.
On entry, the array x must contain the vector x. The elements are accessed
with unit increment.
y REAL for mkl_scoosv.
DOUBLE PRECISION for mkl_dcoosv.
COMPLEX for mkl_ccoosv.
DOUBLE COMPLEX for mkl_zcoosv.
Array, DIMENSION at least m.
On entry, the array y must contain the vector y. The elements are accessed
with unit increment.
2 Intel® Math Kernel Library Reference Manual
240
Output Parameters
y Contains solution vector x.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scoosv(transa, m, alpha, matdescra, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, nnz
INTEGER rowind(*), colind(*)
REAL alpha
REAL val(*)
REAL x(*), y(*)
SUBROUTINE mkl_dcoosv(transa, m, alpha, matdescra, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*)
DOUBLE PRECISION x(*), y(*)
SUBROUTINE mkl_ccoosv(transa, m, alpha, matdescra, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, nnz
INTEGER rowind(*), colind(*)
COMPLEX alpha
COMPLEX val(*)
COMPLEX x(*), y(*)
SUBROUTINE mkl_zcoosv(transa, m, alpha, matdescra, val, rowind, colind, nnz, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*)
DOUBLE COMPLEX x(*), y(*)
BLAS and Sparse BLAS Routines 2
241
C:
void mkl_scoosv(char *transa, int *m, float *alpha, char *matdescra,
float *val, int *rowind, int *colind, int *nnz,
float *x, float *y);
void mkl_dcoosv(char *transa, int *m, double *alpha, char *matdescra,
double *val, int *rowind, int *colind, int *nnz,
double *x, double *y);
void mkl_ccoosv(char *transa, int *m, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *rowind, int *colind, int *nnz,
MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zcoosv(char *transa, int *m, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *rowind, int *colind, int *nnz,
MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?csrmm
Computes matrix - matrix product of a sparse matrix
stored in the CSR format.
Syntax
Fortran:
call mkl_scsrmm(transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
beta, c, ldc)
call mkl_dcsrmm(transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
beta, c, ldc)
call mkl_ccsrmm(transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
beta, c, ldc)
call mkl_zcsrmm(transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
beta, c, ldc)
C:
mkl_scsrmm(&transa, &m, &n, &k, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
&beta, c, &ldc);
mkl_dcsrmm(&transa, &m, &n, &k, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
&beta, c, &ldc);
mkl_ccsrmm(&transa, &m, &n, &k, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
&beta, c, &ldc);
mkl_zcsrmm(&transa, &m, &n, &k, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
&beta, c, &ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?csrmm routine performs a matrix-matrix operation defined as
C := alpha*A*B + beta*C
2 Intel® Math Kernel Library Reference Manual
242
or
C := alpha*A'*B + beta*C,
where:
alpha and beta are scalars,
B and C are dense matrices, A is an m-by-k sparse matrix in compressed sparse row (CSR) format, A' is the
transpose of A.
NOTE This routine supports a CSR format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then C := alpha*A*B + beta*C
If transa = 'T' or 't' or 'C' or 'c', then C := alpha*A'*B + beta*C,
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix C.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_scsrmm.
DOUBLE PRECISION for mkl_dcsrmm.
COMPLEX for mkl_ccsrmm.
DOUBLE COMPLEX for mkl_zcsrmm.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scsrmm.
DOUBLE PRECISION for mkl_dcsrmm.
COMPLEX for mkl_ccsrmm.
DOUBLE COMPLEX for mkl_zcsrmm.
Array containing non-zero elements of the matrix A.
For one-based indexing its length is pntre(m) - pntrb(1).
For zero-based indexing its length is pntre(—1) - pntrb(0).
Refer to values array description in CSR Format for more details.
indx INTEGER. Array containing the column indices for each non-zero element of
the matrix A. Its length is equal to length of the val array.
Refer to columns array description in CSR Format for more details.
pntrb INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntrb(I)
- pntrb(1)+1 is the first index of row I in the arrays val and indx.
For zero-based indexing this array contains row indices, such that
pntrb(I) - pntrb(0) is the first index of row I in the arrays val and
indx.
Refer to pointerb array description in CSR Format for more details.
BLAS and Sparse BLAS Routines 2
243
pntre INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntre(I)
- pntrb(1) is the last index of row I in the arrays val and indx.
For zero-based indexing this array contains row indices, such that
pntre(I) - pntrb(0)-1 is the last index of row I in the arrays val and
indx.
Refer to pointerE array description in CSR Format for more details.
b REAL for mkl_scsrmm.
DOUBLE PRECISION for mkl_dcsrmm.
COMPLEX for mkl_ccsrmm.
DOUBLE COMPLEX for mkl_zcsrmm.
Array, DIMENSION (ldb, at least n for non-transposed matrix A and at least
m for transposed) for one-based indexing, and (at least k for nontransposed
matrix A and at least m for transposed, ldb) for zero-based
indexing.
On entry with transa= 'N' or 'n', the leading k-by-n part of the array b
must contain the matrix B, otherwise the leading m-by-n part of the array b
must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b for one-based indexing, and
the second dimension of b for zero-based indexing, as declared in the
calling (sub)program.
beta REAL for mkl_scsrmm.
DOUBLE PRECISION for mkl_dcsrmm.
COMPLEX for mkl_ccsrmm.
DOUBLE COMPLEX for mkl_zcsrmm.
Specifies the scalar beta.
c REAL for mkl_scsrmm.
DOUBLE PRECISION for mkl_dcsrmm.
COMPLEX for mkl_ccsrmm.
DOUBLE COMPLEX for mkl_zcsrmm.
Array, DIMENSION (ldc, n) for one-based indexing, and (m, ldc) for zerobased
indexing.
On entry, the leading m-by-n part of the array c must contain the matrix C,
otherwise the leading k-by-n part of the array c must contain the matrix C.
ldc INTEGER. Specifies the leading dimension of c for one-based indexing, and
the second dimension of c for zero-based indexing, as declared in the
calling (sub)program.
Output Parameters
c Overwritten by the matrix (alpha*A*B + beta* C) or (alpha*A'*B +
beta*C).
2 Intel® Math Kernel Library Reference Manual
244
Interfaces
FORTRAN 77:
SUBROUTINE mkl_dcsrmm(transa, m, n, k, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha, beta
REAL val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dcsrmm(transa, m, n, k, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dcsrmm(transa, m, n, k, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha, beta
COMPLEX val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dcsrmm(transa, m, n, k, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
C:
void mkl_scsrmm(char *transa, int *m, int *n, int *k, float *alpha,
char *matdescra, float *val, int *indx, int *pntrb, int *pntre,
float *b, int *ldb, float *beta, float *c, int *ldc,);
BLAS and Sparse BLAS Routines 2
245
void mkl_dcsrmm(char *transa, int *m, int *n, int *k, double *alpha,
char *matdescra, double *val, int *indx, int *pntrb, int *pntre,
double *b, int *ldb, double *beta, double *c, int *ldc,);
void mkl_ccsrmm(char *transa, int *m, int *n, int *k, double *alpha,
char *matdescra, double *val, int *indx, int *pntrb, int *pntre,
double *b, int *ldb, double *beta, double *c, int *ldc,);
void mkl_zcsrmm(char *transa, int *m, int *n, int *k, double *alpha,
char *matdescra, double *val, int *indx, int *pntrb, int *pntre,
double *b, int *ldb, double *beta, double *c, int *ldc,);
mkl_?bsrmm
Computes matrix - matrix product of a sparse matrix
stored in the BSR format.
Syntax
Fortran:
call mkl_sbsrmm(transa, m, n, k, lb, alpha, matdescra, val, indx, pntrb, pntre, b,
ldb, beta, c, ldc)
call mkl_dbsrmm(transa, m, n, k, lb, alpha, matdescra, val, indx, pntrb, pntre, b,
ldb, beta, c, ldc)
call mkl_cbsrmm(transa, m, n, k, lb, alpha, matdescra, val, indx, pntrb, pntre, b,
ldb, beta, c, ldc)
call mkl_zbsrmm(transa, m, n, k, lb, alpha, matdescra, val, indx, pntrb, pntre, b,
ldb, beta, c, ldc)
C:
mkl_sbsrmm(&transa, &m, &n, &k, &lb, &alpha, matdescra, val, indx, pntrb, pntre, b,
&ldb, &beta, c, &ldc);
mkl_dbsrmm(&transa, &m, &n, &k, &lb, &alpha, matdescra, val, indx, pntrb, pntre, b,
&ldb, &beta, c, &ldc);
mkl_cbsrmm(&transa, &m, &n, &k, &lb, &alpha, matdescra, val, indx, pntrb, pntre, b,
&ldb, &beta, c, &ldc);
mkl_zbsrmm(&transa, &m, &n, &k, &lb, &alpha, matdescra, val, indx, pntrb, pntre, b,
&ldb, &beta, c, &ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?bsrmm routine performs a matrix-matrix operation defined as
C := alpha*A*B + beta*C
or
C := alpha*A'*B + beta*C,
2 Intel® Math Kernel Library Reference Manual
246
where:
alpha and beta are scalars,
B and C are dense matrices, A is an m-by-k sparse matrix in block sparse row (BSR) format, A' is the
transpose of A.
NOTE This routine supports a BSR format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-matrix product is computed as
C := alpha*A*B + beta*C
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as C := alpha*A'*B + beta*C,
m INTEGER. Number of block rows of the matrix A.
n INTEGER. Number of columns of the matrix C.
k INTEGER. Number of block columns of the matrix A.
lb INTEGER. Size of the block in the matrix A.
alpha REAL for mkl_sbsrmm.
DOUBLE PRECISION for mkl_dbsrmm.
COMPLEX for mkl_cbsrmm.
DOUBLE COMPLEX for mkl_zbsrmm.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_sbsrmm.
DOUBLE PRECISION for mkl_dbsrmm.
COMPLEX for mkl_cbsrmm.
DOUBLE COMPLEX for mkl_zbsrmm.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by lb*lb.
Refer to the values array description in BSR Format for more details.
indx INTEGER. Array containing the column indices for each non-zero block in
the matrix A. Its length is equal to the number of non-zero blocks in the
matrix A. Refer to the columns array description in BSR Format for more
details.
pntrb INTEGER. Array of length m.
For one-based indexing: this array contains row indices, such that
pntrb(I) - pntrb(1)+1 is the first index of block row I in the array
indx.
For zero-based indexing: this array contains row indices, such that
pntrb(I) - pntrb(0) is the first index of block row I in the array indx.
BLAS and Sparse BLAS Routines 2
247
Refer to pointerB array description in BSR Format for more details.
pntre INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntre(I)
- pntrb(1) is the last index of block row I in the array indx.
For zero-based indexing this array contains row indices, such that
pntre(I) - pntrb(0)-1 is the last index of block row I in the array indx.
Refer to pointerE array description in BSR Format for more details.
b REAL for mkl_sbsrmm.
DOUBLE PRECISION for mkl_dbsrmm.
COMPLEX for mkl_cbsrmm.
DOUBLE COMPLEX for mkl_zbsrmm.
Array, DIMENSION (ldb, at least n for non-transposed matrix A and at least
m for transposed) for one-based indexing, and (at least k for nontransposed
matrix A and at least m for transposed, ldb) for zero-based
indexing.
On entry with transa= 'N' or 'n', the leading n-by-k block part of the
array b must contain the matrix B, otherwise the leading m-by-n block part
of the array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension (in blocks) of b as declared in the
calling (sub)program.
beta REAL for mkl_sbsrmm.
DOUBLE PRECISION for mkl_dbsrmm.
COMPLEX for mkl_cbsrmm.
DOUBLE COMPLEX for mkl_zbsrmm.
Specifies the scalar beta.
c REAL for mkl_sbsrmm.
DOUBLE PRECISION for mkl_dbsrmm.
COMPLEX for mkl_cbsrmm.
DOUBLE COMPLEX for mkl_zbsrmm.
Array, DIMENSION (ldc, n) for one-based indexing, DIMENSION (k, ldc)
for zero-based indexing.
On entry, the leading m-by-n block part of the array c must contain the
matrix C, otherwise the leading n-by-k block part of the array c must
contain the matrix C.
ldc INTEGER. Specifies the leading dimension (in blocks) of c as declared in the
calling (sub)program.
Output Parameters
c Overwritten by the matrix (alpha*A*B + beta*C) or (alpha*A'*B +
beta*C).
2 Intel® Math Kernel Library Reference Manual
248
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sbsrmm(transa, m, n, k, lb, alpha, matdescra, val,
indx, pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ld, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha, beta
REAL val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dbsrmm(transa, m, n, k, lb, alpha, matdescra, val,
indx, pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ld, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_cbsrmm(transa, m, n, k, lb, alpha, matdescra, val,
indx, pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ld, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha, beta
COMPLEX val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zbsrmm(transa, m, n, k, lb, alpha, matdescra, val,
indx, pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ld, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
C:
void mkl_sbsrmm(char *transa, int *m, int *n, int *k, int *lb,
float *alpha, char *matdescra, float *val, int *indx, int *pntrb,
int *pntre, float *b, int *ldb, float *beta, float *c, int *ldc,);
BLAS and Sparse BLAS Routines 2
249
void mkl_dbsrmm(char *transa, int *m, int *n, int *k, int *lb,
double *alpha, char *matdescra, double *val, int *indx, int *pntrb,
int *pntre, double *b, int *ldb, double *beta, double *c, int *ldc,);
void mkl_cbsrmm(char *transa, int *m, int *n, int *k, int *lb,
MKL_Complex8 *alpha, char *matdescra, MKL_Complex8 *val, int *indx, int *pntrb,
int *pntre, MKL_Complex8 *b, int *ldb, MKL_Complex8 *beta, MKL_Complex8 *c, int *ldc,);
void mkl_zbsrmm(char *transa, int *m, int *n, int *k, int *lb,
MKL_Complex16 *alpha, char *matdescra, MKL_Complex16 *val, int *indx, int *pntrb,
int *pntre, MKL_Complex16 *b, int *ldb, MKL_Complex16 *beta, MKL_Complex16 *c, int *ldc,);
mkl_?cscmm
Computes matrix-matrix product of a sparse matrix
stored in the CSC format.
Syntax
Fortran:
call mkl_scscmm(transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
beta, c, ldc)
call mkl_dcscmm(transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
beta, c, ldc)
call mkl_ccscmm(transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
beta, c, ldc)
call mkl_zcscmm(transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
beta, c, ldc)
C:
mkl_scscmm(&transa, &m, &n, &k, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
&beta, c, &ldc);
mkl_dcscmm(&transa, &m, &n, &k, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
&beta, c, &ldc);
mkl_ccscmm(&transa, &m, &n, &k, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
&beta, c, &ldc);
mkl_zcscmm(&transa, &m, &n, &k, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
&beta, c, &ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?cscmm routine performs a matrix-matrix operation defined as
C := alpha*A*B + beta*C
or
C := alpha*A'*B + beta*C,
2 Intel® Math Kernel Library Reference Manual
250
where:
alpha and beta are scalars,
B and C are dense matrices, A is an m-by-k sparse matrix in compressed sparse column (CSC) format, A' is
the transpose of A.
NOTE This routine supports CSC format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then C := alpha*A* B + beta*C
If transa = 'T' or 't' or 'C' or 'c', then C := alpha*A'*B + beta*C,
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix C.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_scscmm.
DOUBLE PRECISION for mkl_dcscmm.
COMPLEX for mkl_ccscmm.
DOUBLE COMPLEX for mkl_zcscmm.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scscmm.
DOUBLE PRECISION for mkl_dcscmm.
COMPLEX for mkl_ccscmm.
DOUBLE COMPLEX for mkl_zcscmm.
Array containing non-zero elements of the matrix A.
For one-based indexing its length is pntre(k) - pntrb(1).
For zero-based indexing its length is pntre(m-1) - pntrb(0).
Refer to values array description in CSC Format for more details.
indx INTEGER. Array containing the row indices for each non-zero element of the
matrix A.Its length is equal to length of the val array.
Refer to rows array description in CSC Format for more details.
pntrb INTEGER. Array of length k.
For one-based indexing this array contains column indices, such that
pntrb(i) - pntrb(1)+1 is the first index of column i in the arrays val
and indx.
For zero-based indexing this array contains column indices, such that
pntrb(i) - pntrb(0) is the first index of column i in the arrays val and
indx.
Refer to pointerb array description in CSC Format for more details.
pntre INTEGER. Array of length k.
BLAS and Sparse BLAS Routines 2
251
For one-based indexing this array contains column indices, such that
pntre(i) - pntrb(1) is the last index of column i in the arrays val and
indx.
For zero-based indexing this array contains column indices, such that
pntre(i) - pntrb(1)-1 is the last index of column i in the arrays val
and indx.
Refer to pointerE array description in CSC Format for more details.
b REAL for mkl_scscmm.
DOUBLE PRECISION for mkl_dcscmm.
COMPLEX for mkl_ccscmm.
DOUBLE COMPLEX for mkl_zcscmm.
Array, DIMENSION (ldb, at least n for non-transposed matrix A and at least
m for transposed) for one-based indexing, and (at least k for nontransposed
matrix A and at least m for transposed, ldb) for zero-based
indexing.
On entry with transa = 'N' or 'n', the leading k-by-n part of the array b
must contain the matrix B, otherwise the leading m-by-n part of the array b
must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b for one-based indexing, and
the second dimension of b for zero-based indexing, as declared in the
calling (sub)program.
beta REAL*8. Specifies the scalar beta.
c REAL for mkl_scscmm.
DOUBLE PRECISION for mkl_dcscmm.
COMPLEX for mkl_ccscmm.
DOUBLE COMPLEX for mkl_zcscmm.
Array, DIMENSION (ldc, n) for one-based indexing, and (m, ldc) for zerobased
indexing.
On entry, the leading m-by-n part of the array c must contain the matrix C,
otherwise the leading k-by-n part of the array c must contain the matrix C.
ldc INTEGER. Specifies the leading dimension of c for one-based indexing, and
the second dimension of c for zero-based indexing, as declared in the
calling (sub)program.
Output Parameters
c Overwritten by the matrix (alpha*A*B + beta* C) or (alpha*A'*B +
beta*C).
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scscmm(transa, m, n, k, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER indx(*), pntrb(k), pntre(k)
REAL alpha, beta
REAL val(*), b(ldb,*), c(ldc,*)
2 Intel® Math Kernel Library Reference Manual
252
SUBROUTINE mkl_dcscmm(transa, m, n, k, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER indx(*), pntrb(k), pntre(k)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_ccscmm(transa, m, n, k, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER indx(*), pntrb(k), pntre(k)
COMPLEX alpha, beta
COMPLEX val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zcscmm(transa, m, n, k, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER indx(*), pntrb(k), pntre(k)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
C:
void mkl_scscmm(char *transa, int *m, int *n, int *k,
float *alpha, char *matdescra, float *val, int *indx,
int *pntrb, int *pntre, float *b, int *ldb,
float *beta, float *c, int *ldc);
void mkl_dcscmm(char *transa, int *m, int *n, int *k,
double *alpha, char *matdescra, double *val, int *indx,
int *pntrb, int *pntre, double *b, int *ldb,
double *beta, double *c, int *ldc);
void mkl_ccscmm(char *transa, int *m, int *n, int *k,
MKL_Complex8 *alpha, char *matdescra, MKL_Complex8 *val, int *indx,
int *pntrb, int *pntre, MKL_Complex8 *b, int *ldb,
MKL_Complex8 *beta, MKL_Complex8 *c, int *ldc);
BLAS and Sparse BLAS Routines 2
253
void mkl_zcscmm(char *transa, int *m, int *n, int *k,
MKL_Complex16 *alpha, char *matdescra, MKL_Complex16 *val, int *indx,
int *pntrb, int *pntre, MKL_Complex16 *b, int *ldb,
MKL_Complex16 *beta, MKL_Complex16 *c, int *ldc);
mkl_?coomm
Computes matrix-matrix product of a sparse matrix
stored in the coordinate format.
Syntax
Fortran:
call mkl_scoomm(transa, m, n, k, alpha, matdescra, val, rowind, colind, nnz, b, ldb,
beta, c, ldc)
call mkl_dcoomm(transa, m, n, k, alpha, matdescra, val, rowind, colind, nnz, b, ldb,
beta, c, ldc)
call mkl_ccoomm(transa, m, n, k, alpha, matdescra, val, rowind, colind, nnz, b, ldb,
beta, c, ldc)
call mkl_zcoomm(transa, m, n, k, alpha, matdescra, val, rowind, colind, nnz, b, ldb,
beta, c, ldc)
C:
mkl_scoomm(&transa, &m, &n, &k, &alpha, matdescra, val, rowind, colind, &nnz, b, &ldb,
&beta, c, &ldc);
mkl_dcoomm(&transa, &m, &n, &k, &alpha, matdescra, val, rowind, colind, &nnz, b, &ldb,
&beta, c, &ldc);
mkl_ccoomm(&transa, &m, &n, &k, &alpha, matdescra, val, rowind, colind, &nnz, b, &ldb,
&beta, c, &ldc);
mkl_zcoomm(&transa, &m, &n, &k, &alpha, matdescra, val, rowind, colind, &nnz, b, &ldb,
&beta, c, &ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?coomm routine performs a matrix-matrix operation defined as
C := alpha*A*B + beta*C
or
C := alpha*A'*B + beta*C,
where:
alpha and beta are scalars,
B and C are dense matrices, A is an m-by-k sparse matrix in the coordinate format, A' is the transpose of A.
2 Intel® Math Kernel Library Reference Manual
254
NOTE This routine supports a coordinate format both with one-based indexing and zero-based
indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then C := alpha*A*B + beta*C
If transa = 'T' or 't' or 'C' or 'c', then C := alpha*A'*B + beta*C,
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix C.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_scoomm.
DOUBLE PRECISION for mkl_dcoomm.
COMPLEX for mkl_ccoomm.
DOUBLE COMPLEX for mkl_zcoomm.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scoomm.
DOUBLE PRECISION for mkl_dcoomm.
COMPLEX for mkl_ccoomm.
DOUBLE COMPLEX for mkl_zcoomm.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
b REAL for mkl_scoomm.
DOUBLE PRECISION for mkl_dcoomm.
COMPLEX for mkl_ccoomm.
DOUBLE COMPLEX for mkl_zcoomm.
Array, DIMENSION (ldb, at least n for non-transposed matrix A and at least
m for transposed) for one-based indexing, and (at least k for nontransposed
matrix A and at least m for transposed, ldb) for zero-based
indexing.
BLAS and Sparse BLAS Routines 2
255
On entry with transa = 'N' or 'n', the leading k-by-n part of the array b
must contain the matrix B, otherwise the leading m-by-n part of the array b
must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b for one-based indexing, and
the second dimension of b for zero-based indexing, as declared in the
calling (sub)program.
beta REAL for mkl_scoomm.
DOUBLE PRECISION for mkl_dcoomm.
COMPLEX for mkl_ccoomm.
DOUBLE COMPLEX for mkl_zcoomm.
Specifies the scalar beta.
c REAL for mkl_scoomm.
DOUBLE PRECISION for mkl_dcoomm.
COMPLEX for mkl_ccoomm.
DOUBLE COMPLEX for mkl_zcoomm.
Array, DIMENSION (ldc, n) for one-based indexing, and (m, ldc) for zerobased
indexing.
On entry, the leading m-by-n part of the array c must contain the matrix C,
otherwise the leading k-by-n part of the array c must contain the matrix C.
ldc INTEGER. Specifies the leading dimension of c for one-based indexing, and
the second dimension of c for zero-based indexing, as declared in the
calling (sub)program.
Output Parameters
c Overwritten by the matrix (alpha*A*B + beta*C) or (alpha*A'*B +
beta*C).
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scoomm(transa, m, n, k, alpha, matdescra, val,
rowind, colind, nnz, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc, nnz
INTEGER rowind(*), colind(*)
REAL alpha, beta
REAL val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dcoomm(transa, m, n, k, alpha, matdescra, val,
rowind, colind, nnz, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
2 Intel® Math Kernel Library Reference Manual
256
SUBROUTINE mkl_ccoomm(transa, m, n, k, alpha, matdescra, val,
rowind, colind, nnz, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc, nnz
INTEGER rowind(*), colind(*)
COMPLEX alpha, beta
COMPLEX val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zcoomm(transa, m, n, k, alpha, matdescra, val,
rowind, colind, nnz, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
C:
void mkl_scoomm(char *transa, int *m, int *n, int *k, float *alpha,
char *matdescra, float *val, int *rowind, int *colind, int *nnz,
float *b, int *ldb, float *beta, float *c, int *ldc);
void mkl_dcoomm(char *transa, int *m, int *n, int *k, double *alpha,
char *matdescra, double *val, int *rowind, int *colind, int *nnz,
double *b, int *ldb, double *beta, double *c, int *ldc);
void mkl_ccoomm(char *transa, int *m, int *n, int *k, MKL_Complex8 *alpha,
char *matdescra, MKL_Complex8 *val, int *rowind, int *colind, int *nnz,
MKL_Complex8 *b, int *ldb, MKL_Complex8 *beta, MKL_Complex8 *c, int *ldc);
void mkl_zcoomm(char *transa, int *m, int *n, int *k, MKL_Complex16 *alpha,
char *matdescra, MKL_Complex16 *val, int *rowind, int *colind, int *nnz,
MKL_Complex16 *b, int *ldb, MKL_Complex16 *beta, MKL_Complex16 *c, int *ldc);
mkl_?csrsm
Solves a system of linear matrix equations for a
sparse matrix in the CSR format.
Syntax
Fortran:
call mkl_scsrsm(transa, m, n, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c,
ldc)
call mkl_dcsrsm(transa, m, n, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c,
ldc)
BLAS and Sparse BLAS Routines 2
257
call mkl_ccsrsm(transa, m, n, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c,
ldc)
call mkl_zcsrsm(transa, m, n, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c,
ldc)
C:
mkl_scsrsm(&transa, &m, &n, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb, c,
&ldc);
mkl_dcsrsm(&transa, &m, &n, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb, c,
&ldc);
mkl_ccsrsm(&transa, &m, &n, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb, c,
&ldc);
mkl_zcsrsm(&transa, &m, &n, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb, c,
&ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?csrsm routine solves a system of linear equations with matrix-matrix operations for a sparse
matrix in the CSR format:
C := alpha*inv(A)*B
or
C := alpha*inv(A')*B,
where:
alpha is scalar, B and C are dense matrices, A is a sparse upper or lower triangular matrix with unit or nonunit
main diagonal, A' is the transpose of A.
NOTE This routine supports a CSR format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then C := alpha*inv(A)*B
If transa = 'T' or 't' or 'C' or 'c', then C := alpha*inv(A')*B,
m INTEGER. Number of columns of the matrix A.
n INTEGER. Number of columns of the matrix C.
alpha REAL for mkl_scsrsm.
DOUBLE PRECISION for mkl_dcsrsm.
COMPLEX for mkl_ccsrsm.
DOUBLE COMPLEX for mkl_zcsrsm.
Specifies the scalar alpha.
2 Intel® Math Kernel Library Reference Manual
258
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scsrsm.
DOUBLE PRECISION for mkl_dcsrsm.
COMPLEX for mkl_ccsrsm.
DOUBLE COMPLEX for mkl_zcsrsm.
Array containing non-zero elements of the matrix A.
For one-based indexing its length is pntre(m) - pntrb(1).
For zero-based indexing its length is pntre(m-1) - pntrb(0).
Refer to values array description in CSR Format for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
indx INTEGER. Array containing the column indices for each non-zero element of
the matrix A. Its length is equal to length of the val array.
Refer to columns array description in CSR Format for more details.
NOTE Column indices must be sorted in increasing order for each row.
pntrb INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntrb(i)
- pntrb(1)+1 is the first index of row i in the arrays val and indx.
For zero-based indexing this array contains row indices, such that
pntrb(i) - pntrb(0) is the first index of row i in the arrays val and
indx. Refer to pointerb array description in CSR Format for more details.
pntre INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntre(i)
- pntrb(1) is the last index of row i in the arrays val and indx.
For zero-based indexing this array contains row indices, such that
pntre(i) - pntrb(0)-1 is the last index of row i in the arrays val and
indx.Refer to pointerE array description in CSR Format for more details.
b REAL for mkl_scsrsm.
DOUBLE PRECISION for mkl_dcsrsm.
COMPLEX for mkl_ccsrsm.
DOUBLE COMPLEX for mkl_zcsrsm.
Array, DIMENSION (ldb, n)for one-based indexing, and (m, ldb) for
zero-based indexing.
On entry the leading m-by-n part of the array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b for one-based indexing, and
the second dimension of b for zero-based indexing, as declared in the
calling (sub)program.
BLAS and Sparse BLAS Routines 2
259
ldc INTEGER. Specifies the leading dimension of c for one-based indexing, and
the second dimension of c for zero-based indexing, as declared in the
calling (sub)program.
Output Parameters
c REAL*8.
Array, DIMENSION (ldc, n) for one-based indexing, and (m, ldc) for zerobased
indexing.
The leading m-by-n part of the array c contains the output matrix C.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrsm(transa, m, n, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha
REAL val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dcsrsm(transa, m, n, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_ccsrsm(transa, m, n, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha
COMPLEX val(*), b(ldb,*), c(ldc,*)
2 Intel® Math Kernel Library Reference Manual
260
SUBROUTINE mkl_zcsrsm(transa, m, n, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
C:
void mkl_scsrsm(char *transa, int *m, int *n, float *alpha,
char *matdescra, float *val, int *indx, int *pntrb,
int *pntre, float *b, int *ldb, float *c, int *ldc);
void mkl_dcsrsm(char *transa, int *m, int *n, double *alpha,
char *matdescra, double *val, int *indx, int *pntrb,
int *pntre, double *b, int *ldb, double *c, int *ldc);
void mkl_ccsrsm(char *transa, int *m, int *n, MKL_Complex8 *alpha,
char *matdescra, MKL_Complex8 *val, int *indx, int *pntrb,
int *pntre, MKL_Complex8 *b, int *ldb, MKL_Complex8 *c, int *ldc);
void mkl_zcsrsm(char *transa, int *m, int *n, MKL_Complex16 *alpha,
char *matdescra, MKL_Complex16 *val, int *indx, int *pntrb,
int *pntre, MKL_Complex16 *b, int *ldb, MKL_Complex16 *c, int *ldc);
mkl_?cscsm
Solves a system of linear matrix equations for a
sparse matrix in the CSC format.
Syntax
Fortran:
call mkl_scscsm(transa, m, n, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c,
ldc)
call mkl_dcscsm(transa, m, n, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c,
ldc)
call mkl_ccscsm(transa, m, n, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c,
ldc)
call mkl_zcscsm(transa, m, n, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c,
ldc)
C:
mkl_scscsm(&transa, &m, &n, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb, c,
&ldc);
BLAS and Sparse BLAS Routines 2
261
mkl_dcscsm(&transa, &m, &n, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb, c,
&ldc);
mkl_ccscsm(&transa, &m, &n, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb, c,
&ldc);
mkl_zcscsm(&transa, &m, &n, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb, c,
&ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?cscsm routine solves a system of linear equations with matrix-matrix operations for a sparse
matrix in the CSC format:
C := alpha*inv(A)*B
or
C := alpha*inv(A')*B,
where:
alpha is scalar, B and C are dense matrices, A is a sparse upper or lower triangular matrix with unit or nonunit
main diagonal, A' is the transpose of A.
NOTE This routine supports a CSC format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the system of equations.
If transa = 'N' or 'n', then C := alpha*inv(A)*B
If transa = 'T' or 't' or 'C' or 'c', then C := alpha*inv(A')*B,
m INTEGER. Number of columns of the matrix A.
n INTEGER. Number of columns of the matrix C.
alpha REAL for mkl_scscsm.
DOUBLE PRECISION for mkl_dcscsm.
COMPLEX for mkl_ccscsm.
DOUBLE COMPLEX for mkl_zcscsm.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scscsm.
DOUBLE PRECISION for mkl_dcscsm.
COMPLEX for mkl_ccscsm.
2 Intel® Math Kernel Library Reference Manual
262
DOUBLE COMPLEX for mkl_zcscsm.
Array containing non-zero elements of the matrix A.
For one-based indexing its length is pntre(k) - pntrb(1).
For zero-based indexing its length is pntre(m-1) - pntrb(0).
Refer to values array description in CSC Format for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
indx INTEGER. Array containing the row indices for each non-zero element of the
matrix A. Its length is equal to length of the val array.
Refer to rows array description in CSC Format for more details.
NOTE Row indices must be sorted in increasing order for each column.
pntrb INTEGER. Array of length m.
For one-based indexing this array contains column indices, such that
pntrb(I) - pntrb(1)+1 is the first index of column I in the arrays val
and indx.
For zero-based indexing this array contains column indices, such that
pntrb(I) - pntrb(0) is the first index of column I in the arrays val and
indx.
Refer to pointerb array description in CSC Format for more details.
pntre INTEGER. Array of length m.
For one-based indexing this array contains column indices, such that
pntre(I) - pntrb(1) is the last index of column I in the arrays val and
indx.
For zero-based indexing this array contains column indices, such that
pntre(I) - pntrb(1)-1 is the last index of column I in the arrays val
and indx.
Refer to pointerE array description in CSC Format for more details.
b REAL for mkl_scscsm.
DOUBLE PRECISION for mkl_dcscsm.
COMPLEX for mkl_ccscsm.
DOUBLE COMPLEX for mkl_zcscsm.
Array, DIMENSION (ldb, n) for one-based indexing, and (m, ldb) for zerobased
indexing.
On entry the leading m-by-n part of the array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b for one-based indexing, and
the second dimension of b for zero-based indexing, as declared in the
calling (sub)program.
ldc INTEGER. Specifies the leading dimension of c for one-based indexing, and
the second dimension of c for zero-based indexing, as declared in the
calling (sub)program.
Output Parameters
c REAL for mkl_scscsm.
BLAS and Sparse BLAS Routines 2
263
DOUBLE PRECISION for mkl_dcscsm.
COMPLEX for mkl_ccscsm.
DOUBLE COMPLEX for mkl_zcscsm.
Array, DIMENSION (ldc, n) for one-based indexing, and (m, ldc) for zerobased
indexing.
The leading m-by-n part of the array c contains the output matrix C.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scscsm(transa, m, n, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha
REAL val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dcscsm(transa, m, n, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_ccscsm(transa, m, n, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha
COMPLEX val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zcscsm(transa, m, n, alpha, matdescra, val, indx,
pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
2 Intel® Math Kernel Library Reference Manual
264
C:
void mkl_scscsm(char *transa, int *m, int *n, float *alpha,
char *matdescra, float *val, int *indx, int *pntrb,
int *pntre, float *b, int *ldb, float *c, int *ldc);
void mkl_dcscsm(char *transa, int *m, int *n, double *alpha,
char *matdescra, double *val, int *indx, int *pntrb,
int *pntre, double *b, int *ldb, double *c, int *ldc);
void mkl_ccscsm(char *transa, int *m, int *n, MKL_Complex8 *alpha,
char *matdescra, MKL_Complex8 *val, int *indx, int *pntrb,
int *pntre, MKL_Complex8 *b, int *ldb, MKL_Complex8 *c, int *ldc);
void mkl_zcscsm(char *transa, int *m, int *n, MKL_Complex16 *alpha,
char *matdescra, MKL_Complex16 *val, int *indx, int *pntrb,
int *pntre, MKL_Complex16 *b, int *ldb, MKL_Complex16 *c, int *ldc);
mkl_?coosm
Solves a system of linear matrix equations for a
sparse matrix in the coordinate format.
Syntax
Fortran:
call mkl_scoosm(transa, m, n, alpha, matdescra, val, rowind, colind, nnz, b, ldb, c,
ldc)
call mkl_dcoosm(transa, m, n, alpha, matdescra, val, rowind, colind, nnz, b, ldb, c,
ldc)
call mkl_ccoosm(transa, m, n, alpha, matdescra, val, rowind, colind, nnz, b, ldb, c,
ldc)
call mkl_zcoosm(transa, m, n, alpha, matdescra, val, rowind, colind, nnz, b, ldb, c,
ldc)
C:
mkl_scoosm(&transa, &m, &n, &alpha, matdescra, val, rowind, colind, &nnz, b, &ldb, c,
&ldc);
mkl_dcoosm(&transa, &m, &n, &alpha, matdescra, val, rowind, colind, &nnz, b, &ldb, c,
&ldc);
mkl_ccoosm(&transa, &m, &n, &alpha, matdescra, val, rowind, colind, &nnz, b, &ldb, c,
&ldc);
mkl_zcoosm(&transa, &m, &n, &alpha, matdescra, val, rowind, colind, &nnz, b, &ldb, c,
&ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
BLAS and Sparse BLAS Routines 2
265
Description
The mkl_?coosm routine solves a system of linear equations with matrix-matrix operations for a sparse
matrix in the coordinate format:
C := alpha*inv(A)*B
or
C := alpha*inv(A')*B,
where:
alpha is scalar, B and C are dense matrices, A is a sparse upper or lower triangular matrix with unit or nonunit
main diagonal, A' is the transpose of A.
NOTE This routine supports a coordinate format both with one-based indexing and zero-based
indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then the matrix-matrix product is computed as
C := alpha*inv(A)*B
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as C := alpha*inv(A')*B,
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix C.
alpha REAL for mkl_scoosm.
DOUBLE PRECISION for mkl_dcoosm.
COMPLEX for mkl_ccoosm.
DOUBLE COMPLEX for mkl_zcoosm.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_scoosm.
DOUBLE PRECISION for mkl_dcoosm.
COMPLEX for mkl_ccoosm.
DOUBLE COMPLEX for mkl_zcoosm.
Array of length nnz, contains non-zero elements of the matrix A in the
arbitrary order.
Refer to values array description in Coordinate Format for more details.
rowind INTEGER. Array of length nnz, contains the row indices for each non-zero
element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
2 Intel® Math Kernel Library Reference Manual
266
colind INTEGER. Array of length nnz, contains the column indices for each nonzero
element of the matrix A. Refer to columns array description in
Coordinate Format for more details.
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
b REAL for mkl_scoosm.
DOUBLE PRECISION for mkl_dcoosm.
COMPLEX for mkl_ccoosm.
DOUBLE COMPLEX for mkl_zcoosm.
Array, DIMENSION (ldb, n) for one-based indexing, and (m, ldb) for zerobased
indexing.
Before entry the leading m-by-n part of the array b must contain the matrix
B.
ldb INTEGER. Specifies the leading dimension of b for one-based indexing, and
the second dimension of b for zero-based indexing, as declared in the
calling (sub)program.
ldc INTEGER. Specifies the leading dimension of c for one-based indexing, and
the second dimension of c for zero-based indexing, as declared in the
calling (sub)program.
Output Parameters
c REAL for mkl_scoosm.
DOUBLE PRECISION for mkl_dcoosm.
COMPLEX for mkl_ccoosm.
DOUBLE COMPLEX for mkl_zcoosm.
Array, DIMENSION (ldc, n) for one-based indexing, and (m, ldc) for zerobased
indexing.
The leading m-by-n part of the array c contains the output matrix C.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scoosm(transa, m, n, alpha, matdescra, val, rowind, colind, nnz, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc, nnz
INTEGER rowind(*), colind(*)
REAL alpha
REAL val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dcoosm(transa, m, n, alpha, matdescra, val, rowind, colind, nnz, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc, nnz
INTEGER rowind(*), colind(*)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
BLAS and Sparse BLAS Routines 2
267
SUBROUTINE mkl_ccoosm(transa, m, n, alpha, matdescra, val, rowind, colind, nnz, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc, nnz
INTEGER rowind(*), colind(*)
COMPLEX alpha
COMPLEX val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zcoosm(transa, m, n, alpha, matdescra, val, rowind, colind, nnz, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc, nnz
INTEGER rowind(*), colind(*)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
C:
void mkl_scoosm(char *transa, int *m, int *n, float *alpha, char *matdescra,
float *val, int *rowind, int *colind, int *nnz, float *b, int *ldb, float *c, int *ldc);
void mkl_dcoosm(char *transa, int *m, int *n, double *alpha, char *matdescra,
double *val, int *rowind, int *colind, int *nnz, double *b, int *ldb, double *c, int *ldc);
void mkl_ccoosm(char *transa, int *m, int *n, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *rowind, int *colind, int *nnz, MKL_Complex8 *b, int *ldb, MKL_Complex8 *c, int *ldc);
void mkl_zcoosm(char *transa, int *m, int *n, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *rowind, int *colind, int *nnz, MKL_Complex16 *b, int *ldb, MKL_Complex16 *c,
int *ldc);
mkl_?bsrsm
Solves a system of linear matrix equations for a
sparse matrix in the BSR format.
Syntax
Fortran:
call mkl_scsrsm(transa, m, n, lb, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
c, ldc)
call mkl_dcsrsm(transa, m, n, lb, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
c, ldc)
call mkl_ccsrsm(transa, m, n, lb, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
c, ldc)
call mkl_zcsrsm(transa, m, n, lb, alpha, matdescra, val, indx, pntrb, pntre, b, ldb,
c, ldc)
2 Intel® Math Kernel Library Reference Manual
268
C:
mkl_scsrsm(&transa, &m, &n, &lb, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
c, &ldc);
mkl_dcsrsm(&transa, &m, &n, &lb, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
c, &ldc);
mkl_ccsrsm(&transa, &m, &n, &lb, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
c, &ldc);
mkl_zcsrsm(&transa, &m, &n, &lb, &alpha, matdescra, val, indx, pntrb, pntre, b, &ldb,
c, &ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?bsrsm routine solves a system of linear equations with matrix-matrix operations for a sparse
matrix in the BSR format:
C := alpha*inv(A)*B
or
C := alpha*inv(A')*B,
where:
alpha is scalar, B and C are dense matrices, A is a sparse upper or lower triangular matrix with unit or nonunit
main diagonal, A' is the transpose of A.
NOTE This routine supports a BSR format both with one-based indexing and zero-based indexing.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then the matrix-matrix product is computed as
C := alpha*inv(A)*B.
If transa = 'T' or 't' or 'C' or 'c', then the matrix-vector product is
computed as C := alpha*inv(A')*B.
m INTEGER. Number of block columns of the matrix A.
n INTEGER. Number of columns of the matrix C.
lb INTEGER. Size of the block in the matrix A.
alpha REAL for mkl_sbsrsm.
DOUBLE PRECISION for mkl_dbsrsm.
COMPLEX for mkl_cbsrsm.
DOUBLE COMPLEX for mkl_zbsrsm.
Specifies the scalar alpha.
BLAS and Sparse BLAS Routines 2
269
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_sbsrsm.
DOUBLE PRECISION for mkl_dbsrsm.
COMPLEX for mkl_cbsrsm.
DOUBLE COMPLEX for mkl_zbsrsm.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the ABAB number ABAB of non-zero blocks in the matrix A
multiplied by lb*lb. Refer to the values array description in BSR Format
for more details.
NOTE The non-zero elements of the given row of the matrix must be
stored in the same order as they appear in the row (from left to right).
No diagonal element can be omitted from a sparse storage if the solver
is called with the non-unit indicator.
indx INTEGER. Array containing the column indices for each non-zero block in
the matrix A. Its length is equal to the number of non-zero blocks in the
matrix A. Refer to the columns array description in BSR Format for more
details.
pntrb INTEGER. Array of length m.
For one-based indexing: this array contains row indices, such that
pntrb(i) - pntrb(1)+1 is the first index of block row i in the array
indx.
For zero-based indexing: this array contains row indices, such that
pntrb(i) - pntrb(0) is the first index of block row i in the array indx.
Refer to pointerB array description in BSR Format for more details.
pntre INTEGER. Array of length m.
For one-based indexing this array contains row indices, such that pntre(i)
- pntrb(1) is the last index of block row i in the array indx.
For zero-based indexing this array contains row indices, such that
pntre(i) - pntrb(0)-1 is the last index of block row i in the array indx.
Refer to pointerE array description in BSR Format for more details.
b REAL for mkl_sbsrsm.
DOUBLE PRECISION for mkl_dbsrsm.
COMPLEX for mkl_cbsrsm.
DOUBLE COMPLEX for mkl_zbsrsm.
Array, DIMENSION (ldb, n) for one-based indexing, DIMENSION (m, ldb)
for zero-based indexing.
On entry the leading m-by-n part of the array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension (in blocks) of b as declared in the
calling (sub)program.
ldc INTEGER. Specifies the leading dimension (in blocks) of c as declared in the
calling (sub)program.
2 Intel® Math Kernel Library Reference Manual
270
Output Parameters
c REAL for mkl_sbsrsm.
DOUBLE PRECISION for mkl_dbsrsm.
COMPLEX for mkl_cbsrsm.
DOUBLE COMPLEX for mkl_zbsrsm.
Array, DIMENSION (ldc, n) for one-based indexing, DIMENSION (m, ldc)
for zero-based indexing.
The leading m-by-n part of the array c contains the output matrix C.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sbsrsm(transa, m, n, lb, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, lb, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
REAL alpha
REAL val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dbsrsm(transa, m, n, lb, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, lb, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_cbsrsm(transa, m, n, lb, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, lb, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
COMPLEX alpha
COMPLEX val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zbsrsm(transa, m, n, lb, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, lb, ldb, ldc
INTEGER indx(*), pntrb(m), pntre(m)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
BLAS and Sparse BLAS Routines 2
271
C:
void mkl_sbsrsm(char *transa, int *m, int *n, int *lb, float *alpha, char *matdescra,
float *val, int *indx, int *pntrb, int *pntre, float *b, int *ldb, float *c, int *ldc);
void mkl_dbsrsm(char *transa, int *m, int *n, int *lb, double *alpha, char *matdescra,
double *val, int *indx, int *pntrb, int *pntre, double *b, int *ldb, double *c, int *ldc);
void mkl_cbsrsm(char *transa, int *m, int *n, int *lb, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *indx, int *pntrb, int *pntre, MKL_Complex8 *b, int *ldb, MKL_Complex8 *c, int *ldc);
void mkl_zbsrsm(char *transa, int *m, int *n, int *lb, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *indx, int *pntrb, int *pntre, MKL_Complex16 *b, int *ldb, MKL_Complex16 *c,
int *ldc);
mkl_?diamv
Computes matrix - vector product for a sparse matrix
in the diagonal format with one-based indexing.
Syntax
Fortran:
call mkl_sdiamv(transa, m, k, alpha, matdescra, val, lval, idiag, ndiag, x, beta, y)
call mkl_ddiamv(transa, m, k, alpha, matdescra, val, lval, idiag, ndiag, x, beta, y)
call mkl_cdiamv(transa, m, k, alpha, matdescra, val, lval, idiag, ndiag, x, beta, y)
call mkl_zdiamv(transa, m, k, alpha, matdescra, val, lval, idiag, ndiag, x, beta, y)
C:
mkl_sdiamv(&transa, &m, &k, &alpha, matdescra, val, &lval, idiag, &ndiag, x, &beta,
y);
mkl_ddiamv(&transa, &m, &k, &alpha, matdescra, val, &lval, idiag, &ndiag, x, &beta,
y);
mkl_cdiamv(&transa, &m, &k, &alpha, matdescra, val, &lval, idiag, &ndiag, x, &beta,
y);
mkl_zdiamv(&transa, &m, &k, &alpha, matdescra, val, &lval, idiag, &ndiag, x, &beta,
y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?diamv routine performs a matrix-vector operation defined as
y := alpha*A*x + beta*y
or
y := alpha*A'*x + beta*y,
where:
alpha and beta are scalars,
2 Intel® Math Kernel Library Reference Manual
272
x and y are vectors,
A is an m-by-k sparse matrix stored in the diagonal format, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then y := alpha*A*x + beta*y,
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*A'*x + beta*y.
m INTEGER. Number of rows of the matrix A.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_sdiamv.
DOUBLE PRECISION for mkl_ddiamv.
COMPLEX for mkl_cdiamv.
DOUBLE COMPLEX for mkl_zdiamv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_sdiamv.
DOUBLE PRECISION for mkl_ddiamv.
COMPLEX for mkl_cdiamv.
DOUBLE COMPLEX for mkl_zdiamv.
Two-dimensional array of size lval by ndiag, contains non-zero diagonals
of the matrix A. Refer to values array description in Diagonal Storage
Scheme for more details.
lval INTEGER. Leading dimension of val, lval =m. Refer to lval description in
Diagonal Storage Scheme for more details.
idiag INTEGER. Array of length ndiag, contains the distances between main
diagonal and each non-zero diagonals in the matrix A.
Refer to distance array description in Diagonal Storage Scheme for more
details.
ndiag INTEGER. Specifies the number of non-zero diagonals of the matrix A.
x REAL for mkl_sdiamv.
DOUBLE PRECISION for mkl_ddiamv.
COMPLEX for mkl_cdiamv.
DOUBLE COMPLEX for mkl_zdiamv.
Array, DIMENSION at least k if transa = 'N' or 'n', and at least m
otherwise. On entry, the array x must contain the vector x.
beta REAL for mkl_sdiamv.
DOUBLE PRECISION for mkl_ddiamv.
COMPLEX for mkl_cdiamv.
BLAS and Sparse BLAS Routines 2
273
DOUBLE COMPLEX for mkl_zdiamv.
Specifies the scalar beta.
y REAL for mkl_sdiamv.
DOUBLE PRECISION for mkl_ddiamv.
COMPLEX for mkl_cdiamv.
DOUBLE COMPLEX for mkl_zdiamv.
Array, DIMENSION at least m if transa = 'N' or 'n', and at least k
otherwise. On entry, the array y must contain the vector y.
Output Parameters
y Overwritten by the updated vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sdiamv(transa, m, k, alpha, matdescra, val, lval, idiag,
ndiag, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, lval, ndiag
INTEGER idiag(*)
REAL alpha, beta
REAL val(lval,*), x(*), y(*)
SUBROUTINE mkl_ddiamv(transa, m, k, alpha, matdescra, val, lval, idiag,
ndiag, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, lval, ndiag
INTEGER idiag(*)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(lval,*), x(*), y(*)
SUBROUTINE mkl_cdiamv(transa, m, k, alpha, matdescra, val, lval, idiag,
ndiag, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, lval, ndiag
INTEGER idiag(*)
COMPLEX alpha, beta
COMPLEX val(lval,*), x(*), y(*)
2 Intel® Math Kernel Library Reference Manual
274
SUBROUTINE mkl_zdiamv(transa, m, k, alpha, matdescra, val, lval, idiag,
ndiag, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k, lval, ndiag
INTEGER idiag(*)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(lval,*), x(*), y(*)
C:
void mkl_sdiamv(char *transa, int *m, int *k, float *alpha,
char *matdescra, float *val, int *lval, int *idiag,
int *ndiag, float *x, float *beta, float *y);
void mkl_ddiamv(char *transa, int *m, int *k, double *alpha,
char *matdescra, double *val, int *lval, int *idiag,
int *ndiag, double *x, double *beta, double *y);
void mkl_cdiamv(char *transa, int *m, int *k, MKL_Complex8 *alpha,
char *matdescra, MKL_Complex8 *val, int *lval, int *idiag,
int *ndiag, MKL_Complex8 *x, MKL_Complex8 *beta, MKL_Complex8 *y);
void mkl_zdiamv(char *transa, int *m, int *k, MKL_Complex16 *alpha,
char *matdescra, MKL_Complex16 *val, int *lval, int *idiag,
int *ndiag, MKL_Complex16 *x, MKL_Complex16 *beta, MKL_Complex16 *y);
mkl_?skymv
Computes matrix - vector product for a sparse matrix
in the skyline storage format with one-based indexing.
Syntax
Fortran:
call mkl_sskymv(transa, m, k, alpha, matdescra, val, pntr, x, beta, y)
call mkl_dskymv(transa, m, k, alpha, matdescra, val, pntr, x, beta, y)
call mkl_cskymv(transa, m, k, alpha, matdescra, val, pntr, x, beta, y)
call mkl_zskymv(transa, m, k, alpha, matdescra, val, pntr, x, beta, y)
C:
mkl_sskymv(&transa, &m, &k, &alpha, matdescra, val, pntr, x, &beta, y);
mkl_dskymv(&transa, &m, &k, &alpha, matdescra, val, pntr, x, &beta, y);
mkl_cskymv(&transa, &m, &k, &alpha, matdescra, val, pntr, x, &beta, y);
mkl_zskymv(&transa, &m, &k, &alpha, matdescra, val, pntr, x, &beta, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
BLAS and Sparse BLAS Routines 2
275
• C: mkl_spblas.h
Description
The mkl_?skymv routine performs a matrix-vector operation defined as
y := alpha*A*x + beta*y
or
y := alpha*A'*x + beta*y,
where:
alpha and beta are scalars,
x and y are vectors,
A is an m-by-k sparse matrix stored using the skyline storage scheme, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then y := alpha*A*x + beta*y
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*A'*x + beta*y,
m INTEGER. Number of rows of the matrix A.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_sskymv.
DOUBLE PRECISION for mkl_dskymv.
COMPLEX for mkl_cskymv.
DOUBLE COMPLEX for mkl_zskymv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
NOTE General matrices (matdescra (1)='G') is not supported.
val REAL for mkl_sskymv.
DOUBLE PRECISION for mkl_dskymv.
COMPLEX for mkl_cskymv.
DOUBLE COMPLEX for mkl_zskymv.
Array containing the set of elements of the matrix A in the skyline profile
form.
If matdescrsa(2)= 'L', then val contains elements from the low triangle
of the matrix A.
2 Intel® Math Kernel Library Reference Manual
276
If matdescrsa(2)= 'U', then val contains elements from the upper
triangle of the matrix A.
Refer to values array description in Skyline Storage Scheme for more
details.
pntr INTEGER. Array of length (m+m) for lower triangle, and (k+k) for upper
triangle.
It contains the indices specifying in the val the positions of the first
element in each row (column) of the matrix A. Refer to pointers array
description in Skyline Storage Scheme for more details.
x REAL for mkl_sskymv.
DOUBLE PRECISION for mkl_dskymv.
COMPLEX for mkl_cskymv.
DOUBLE COMPLEX for mkl_zskymv.
Array, DIMENSION at least k if transa = 'N' or 'n' and at least m
otherwise. On entry, the array x must contain the vector x.
beta REAL for mkl_sskymv.
DOUBLE PRECISION for mkl_dskymv.
COMPLEX for mkl_cskymv.
DOUBLE COMPLEX for mkl_zskymv.
Specifies the scalar beta.
y REAL for mkl_sskymv.
DOUBLE PRECISION for mkl_dskymv.
COMPLEX for mkl_cskymv.
DOUBLE COMPLEX for mkl_zskymv.
Array, DIMENSION at least m if transa = 'N' or 'n' and at least k
otherwise. On entry, the array y must contain the vector y.
Output Parameters
y Overwritten by the updated vector y.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sskymv(transa, m, k, alpha, matdescra, val, pntr, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k
INTEGER pntr(*)
REAL alpha, beta
REAL val(*), x(*), y(*)
SUBROUTINE mkl_dskymv(transa, m, k, alpha, matdescra, val, pntr, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k
INTEGER pntr(*)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), x(*), y(*)
BLAS and Sparse BLAS Routines 2
277
SUBROUTINE mkl_cdskymv(transa, m, k, alpha, matdescra, val, pntr, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k
INTEGER pntr(*)
COMPLEX alpha, beta
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_zskymv(transa, m, k, alpha, matdescra, val, pntr, x, beta, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, k
INTEGER pntr(*)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_sskymv (char *transa, int *m, int *k, float *alpha, char *matdescra,
float *val, int *pntr, float *x, float *beta, float *y);
void mkl_dskymv (char *transa, int *m, int *k, double *alpha, char *matdescra,
double *val, int *pntr, double *x, double *beta, double *y);
void mkl_cskymv (char *transa, int *m, int *k, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *pntr, MKL_Complex8 *x, MKL_Complex8 *beta, MKL_Complex8 *y);
void mkl_zskymv (char *transa, int *m, int *k, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *pntr, MKL_Complex16 *x, MKL_Complex16 *beta, MKL_Complex16 *y);
mkl_?diasv
Solves a system of linear equations for a sparse
matrix in the diagonal format with one-based
indexing.
Syntax
Fortran:
call mkl_sdiasv(transa, m, alpha, matdescra, val, lval, idiag, ndiag, x, y)
call mkl_ddiasv(transa, m, alpha, matdescra, val, lval, idiag, ndiag, x, y)
call mkl_cdiasv(transa, m, alpha, matdescra, val, lval, idiag, ndiag, x, y)
call mkl_zdiasv(transa, m, alpha, matdescra, val, lval, idiag, ndiag, x, y)
C:
mkl_sdiasv(&transa, &m, &alpha, matdescra, val, &lval, idiag, &ndiag, x, y);
mkl_ddiasv(&transa, &m, &alpha, matdescra, val, &lval, idiag, &ndiag, x, y);
mkl_cdiasv(&transa, &m, &alpha, matdescra, val, &lval, idiag, &ndiag, x, y);
2 Intel® Math Kernel Library Reference Manual
278
mkl_zdiasv(&transa, &m, &alpha, matdescra, val, &lval, idiag, &ndiag, x, y);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?diasv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix stored in the diagonal format:
y := alpha*inv(A)*x
or
y := alpha*inv(A')* x,
where:
alpha is scalar, x and y are vectors, A is a sparse upper or lower triangular matrix with unit or non-unit main
diagonal, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then y := alpha*inv(A)*x
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*inv(A')*x,
m INTEGER. Number of rows of the matrix A.
alpha REAL for mkl_sdiasv.
DOUBLE PRECISION for mkl_ddiasv.
COMPLEX for mkl_cdiasv.
DOUBLE COMPLEX for mkl_zdiasv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_sdiasv.
DOUBLE PRECISION for mkl_ddiasv.
COMPLEX for mkl_cdiasv.
DOUBLE COMPLEX for mkl_zdiasv.
Two-dimensional array of size lval by ndiag, contains non-zero diagonals
of the matrix A. Refer to values array description in Diagonal Storage
Scheme for more details.
lval INTEGER. Leading dimension of val, lval=m. Refer to lval description in
Diagonal Storage Scheme for more details.
BLAS and Sparse BLAS Routines 2
279
idiag INTEGER. Array of length ndiag, contains the distances between main
diagonal and each non-zero diagonals in the matrix A.
NOTE All elements of this array must be sorted in increasing order.
Refer to distance array description in Diagonal Storage Scheme for more
details.
ndiag INTEGER. Specifies the number of non-zero diagonals of the matrix A.
x REAL for mkl_sdiasv.
DOUBLE PRECISION for mkl_ddiasv.
COMPLEX for mkl_cdiasv.
DOUBLE COMPLEX for mkl_zdiasv.
Array, DIMENSION at least m.
On entry, the array x must contain the vector x. The elements are accessed
with unit increment.
y REAL for mkl_sdiasv.
DOUBLE PRECISION for mkl_ddiasv.
COMPLEX for mkl_cdiasv.
DOUBLE COMPLEX for mkl_zdiasv.
Array, DIMENSION at least m.
On entry, the array y must contain the vector y. The elements are accessed
with unit increment.
Output Parameters
y Contains solution vector x.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sdiasv(transa, m, alpha, matdescra, val, lval, idiag, ndiag, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, lval, ndiag
INTEGER indiag(*)
REAL alpha
REAL val(lval,*), x(*), y(*)
SUBROUTINE mkl_ddiasv(transa, m, alpha, matdescra, val, lval, idiag, ndiag, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, lval, ndiag
INTEGER indiag(*)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(lval,*), x(*), y(*)
2 Intel® Math Kernel Library Reference Manual
280
SUBROUTINE mkl_cdiasv(transa, m, alpha, matdescra, val, lval, idiag, ndiag, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, lval, ndiag
INTEGER indiag(*)
COMPLEX alpha
COMPLEX val(lval,*), x(*), y(*)
SUBROUTINE mkl_zdiasv(transa, m, alpha, matdescra, val, lval, idiag, ndiag, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, lval, ndiag
INTEGER indiag(*)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(lval,*), x(*), y(*)
C:
void mkl_sdiasv(char *transa, int *m, float *alpha, char *matdescra,
float *val, int *lval, int *idiag, int *ndiag, float *x, float *y);
void mkl_ddiasv(char *transa, int *m, double *alpha, char *matdescra,
double *val, int *lval, int *idiag, int *ndiag, double *x, double *y);
void mkl_cdiasv(char *transa, int *m, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *lval, int *idiag, int *ndiag, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zdiasv(char *transa, int *m, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *lval, int *idiag, int *ndiag, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?skysv
Solves a system of linear equations for a sparse
matrix in the skyline format with one-based indexing.
Syntax
Fortran:
call mkl_sskysv(transa, m, alpha, matdescra, val, pntr, x, y)
call mkl_dskysv(transa, m, alpha, matdescra, val, pntr, x, y)
call mkl_cskysv(transa, m, alpha, matdescra, val, pntr, x, y)
call mkl_zskysv(transa, m, alpha, matdescra, val, pntr, x, y)
C:
mkl_sskysv(&transa, &m, &alpha, matdescra, val, pntr, x, y);
mkl_dskysv(&transa, &m, &alpha, matdescra, val, pntr, x, y);
mkl_cskysv(&transa, &m, &alpha, matdescra, val, pntr, x, y);
mkl_zskysv(&transa, &m, &alpha, matdescra, val, pntr, x, y);
BLAS and Sparse BLAS Routines 2
281
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?skysv routine solves a system of linear equations with matrix-vector operations for a sparse
matrix in the skyline storage format:
y := alpha*inv(A)*x
or
y := alpha*inv(A')*x,
where:
alpha is scalar, x and y are vectors, A is a sparse upper or lower triangular matrix with unit or non-unit main
diagonal, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then y := alpha*inv(A)*x
If transa = 'T' or 't' or 'C' or 'c', then y := alpha*inv(A')* x,
m INTEGER. Number of rows of the matrix A.
alpha REAL for mkl_sskysv.
DOUBLE PRECISION for mkl_dskysv.
COMPLEX for mkl_cskysv.
DOUBLE COMPLEX for mkl_zskysv.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
NOTE General matrices (matdescra (1)='G') is not supported.
val REAL for mkl_sskysv.
DOUBLE PRECISION for mkl_dskysv.
COMPLEX for mkl_cskysv.
DOUBLE COMPLEX for mkl_zskysv.
Array containing the set of elements of the matrix A in the skyline profile
form.
If matdescrsa(2)= 'L', then val contains elements from the low triangle
of the matrix A.
2 Intel® Math Kernel Library Reference Manual
282
If matdescrsa(2)= 'U', then val contains elements from the upper
triangle of the matrix A.
Refer to values array description in Skyline Storage Scheme for more
details.
pntr INTEGER. Array of length (m+m) for lower triangle, and (k+k) for upper
triangle.
It contains the indices specifying in the val the positions of the first
element in each row (column) of the matrix A. Refer to pointers array
description in Skyline Storage Scheme for more details.
x REAL for mkl_sskysv.
DOUBLE PRECISION for mkl_dskysv.
COMPLEX for mkl_cskysv.
DOUBLE COMPLEX for mkl_zskysv.
Array, DIMENSION at least m.
On entry, the array x must contain the vector x. The elements are accessed
with unit increment.
y REAL for mkl_sskysv.
DOUBLE PRECISION for mkl_dskysv.
COMPLEX for mkl_cskysv.
DOUBLE COMPLEX for mkl_zskysv.
Array, DIMENSION at least m.
On entry, the array y must contain the vector y. The elements are accessed
with unit increment.
Output Parameters
y Contains solution vector x.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sskysv(transa, m, alpha, matdescra, val, pntr, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER pntr(*)
REAL alpha
REAL val(*), x(*), y(*)
SUBROUTINE mkl_dskysv(transa, m, alpha, matdescra, val, pntr, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER pntr(*)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*), x(*), y(*)
BLAS and Sparse BLAS Routines 2
283
SUBROUTINE mkl_cskysv(transa, m, alpha, matdescra, val, pntr, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER pntr(*)
COMPLEX alpha
COMPLEX val(*), x(*), y(*)
SUBROUTINE mkl_zskysv(transa, m, alpha, matdescra, val, pntr, x, y)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m
INTEGER pntr(*)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*), x(*), y(*)
C:
void mkl_sskysv(char *transa, int *m, float *alpha, char *matdescra,
float *val, int *pntr, float *x, float *y);
void mkl_dskysv(char *transa, int *m, double *alpha, char *matdescra,
double *val, int *pntr, double *x, double *y);
void mkl_cskysv(char *transa, int *m, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *pntr, MKL_Complex8 *x, MKL_Complex8 *y);
void mkl_zskysv(char *transa, int *m, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *pntr, MKL_Complex16 *x, MKL_Complex16 *y);
mkl_?diamm
Computes matrix-matrix product of a sparse matrix
stored in the diagonal format with one-based
indexing.
Syntax
Fortran:
call mkl_sdiamm(transa, m, n, k, alpha, matdescra, val, lval, idiag, ndiag, b, ldb,
beta, c, ldc)
call mkl_ddiamm(transa, m, n, k, alpha, matdescra, val, lval, idiag, ndiag, b, ldb,
beta, c, ldc)
call mkl_cdiamm(transa, m, n, k, alpha, matdescra, val, lval, idiag, ndiag, b, ldb,
beta, c, ldc)
call mkl_zdiamm(transa, m, n, k, alpha, matdescra, val, lval, idiag, ndiag, b, ldb,
beta, c, ldc)
2 Intel® Math Kernel Library Reference Manual
284
C:
mkl_sdiamm(&transa, &m, &n, &k, &alpha, matdescra, val, &lval, idiag, &ndiag, b, &ldb,
&beta, c, &ldc);
mkl_ddiamm(&transa, &m, &n, &k, &alpha, matdescra, val, &lval, idiag, &ndiag, b, &ldb,
&beta, c, &ldc);
mkl_cdiamm(&transa, &m, &n, &k, &alpha, matdescra, val, &lval, idiag, &ndiag, b, &ldb,
&beta, c, &ldc);
mkl_zdiamm(&transa, &m, &n, &k, &alpha, matdescra, val, &lval, idiag, &ndiag, b, &ldb,
&beta, c, &ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?diamm routine performs a matrix-matrix operation defined as
C := alpha*A*B + beta*C
or
C := alpha*A'*B + beta*C,
where:
alpha and beta are scalars,
B and C are dense matrices, A is an m-by-k sparse matrix in the diagonal format, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then C := alpha*A*B + beta*C,
If transa = 'T' or 't' or 'C' or 'c', then C := alpha*A'*B + beta*C.
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix C.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_sdiamm.
DOUBLE PRECISION for mkl_ddiamm.
COMPLEX for mkl_cdiamm.
DOUBLE COMPLEX for mkl_zdiamm.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
BLAS and Sparse BLAS Routines 2
285
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_sdiamm.
DOUBLE PRECISION for mkl_ddiamm.
COMPLEX for mkl_cdiamm.
DOUBLE COMPLEX for mkl_zdiamm.
Two-dimensional array of size lval by ndiag, contains non-zero diagonals
of the matrix A. Refer to values array description in Diagonal Storage
Scheme for more details.
lval INTEGER. Leading dimension of val, lval=m. Refer to lval description in
Diagonal Storage Scheme for more details.
idiag INTEGER. Array of length ndiag, contains the distances between main
diagonal and each non-zero diagonals in the matrix A.
Refer to distance array description in Diagonal Storage Scheme for more
details.
ndiag INTEGER. Specifies the number of non-zero diagonals of the matrix A.
b REAL for mkl_sdiamm.
DOUBLE PRECISION for mkl_ddiamm.
COMPLEX for mkl_cdiamm.
DOUBLE COMPLEX for mkl_zdiamm.
Array, DIMENSION (ldb, n).
On entry with transa = 'N' or 'n', the leading k-by-n part of the array b
must contain the matrix B, otherwise the leading m-by-n part of the array b
must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program.
beta REAL for mkl_sdiamm.
DOUBLE PRECISION for mkl_ddiamm.
COMPLEX for mkl_cdiamm.
DOUBLE COMPLEX for mkl_zdiamm.
Specifies the scalar beta.
c REAL for mkl_sdiamm.
DOUBLE PRECISION for mkl_ddiamm.
COMPLEX for mkl_cdiamm.
DOUBLE COMPLEX for mkl_zdiamm.
Array, DIMENSION (ldc, n).
On entry, the leading m-by-n part of the array c must contain the matrix C,
otherwise the leading k-by-n part of the array c must contain the matrix C.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program.
Output Parameters
c Overwritten by the matrix (alpha*A*B + beta*C) or (alpha*A'*B +
beta*C).
2 Intel® Math Kernel Library Reference Manual
286
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sdiamm(transa, m, n, k, alpha, matdescra, val, lval,
idiag, ndiag, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc, lval, ndiag
INTEGER idiag(*)
REAL alpha, beta
REAL val(lval,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_ddiamm(transa, m, n, k, alpha, matdescra, val, lval,
idiag, ndiag, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc, lval, ndiag
INTEGER idiag(*)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(lval,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_cdiamm(transa, m, n, k, alpha, matdescra, val, lval,
idiag, ndiag, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc, lval, ndiag
INTEGER idiag(*)
COMPLEX alpha, beta
COMPLEX val(lval,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zdiamm(transa, m, n, k, alpha, matdescra, val, lval,
idiag, ndiag, b, ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc, lval, ndiag
INTEGER idiag(*)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(lval,*), b(ldb,*), c(ldc,*)
C:
void mkl_sdiamm(char *transa, int *m, int *n, int *k, float *alpha,
char *matdescra, float *val, int *lval, int *idiag, int *ndiag,
float *b, int *ldb, float *beta, float *c, int *ldc);
BLAS and Sparse BLAS Routines 2
287
void mkl_ddiamm(char *transa, int *m, int *n, int *k, double *alpha,
char *matdescra, double *val, int *lval, int *idiag, int *ndiag,
double *b, int *ldb, double *beta, double *c, int *ldc);
void mkl_cdiamm(char *transa, int *m, int *n, int *k, MKL_Complex8 *alpha,
char *matdescra, MKL_Complex8 *val, int *lval, int *idiag, int *ndiag,
MKL_Complex8 *b, int *ldb, MKL_Complex8 *beta, MKL_Complex8 *c, int *ldc);
void mkl_zdiamm(char *transa, int *m, int *n, int *k, MKL_Complex16 *alpha,
char *matdescra, MKL_Complex16 *val, int *lval, int *idiag, int *ndiag,
MKL_Complex16 *b, int *ldb, MKL_Complex16 *beta, MKL_Complex16 *c, int *ldc);
mkl_?skymm
Computes matrix-matrix product of a sparse matrix
stored using the skyline storage scheme with onebased
indexing.
Syntax
Fortran:
call mkl_sskymm(transa, m, n, k, alpha, matdescra, val, pntr, b, ldb, beta, c, ldc)
call mkl_dskymm(transa, m, n, k, alpha, matdescra, val, pntr, b, ldb, beta, c, ldc)
call mkl_cskymm(transa, m, n, k, alpha, matdescra, val, pntr, b, ldb, beta, c, ldc)
call mkl_zskymm(transa, m, n, k, alpha, matdescra, val, pntr, b, ldb, beta, c, ldc)
C:
mkl_sskymm(&transa, &m, &n, &k, &alpha, matdescra, val, pntr, b, &ldb, &beta, c,
&ldc);
mkl_dskymm(&transa, &m, &n, &k, &alpha, matdescra, val, pntr, b, &ldb, &beta, c,
&ldc);
mkl_cskymm(&transa, &m, &n, &k, &alpha, matdescra, val, pntr, b, &ldb, &beta, c,
&ldc);
mkl_zskymm(&transa, &m, &n, &k, &alpha, matdescra, val, pntr, b, &ldb, &beta, c,
&ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?skymm routine performs a matrix-matrix operation defined as
C := alpha*A*B + beta*C
or
C := alpha*A'*B + beta*C,
where:
alpha and beta are scalars,
2 Intel® Math Kernel Library Reference Manual
288
B and C are dense matrices, A is an m-by-k sparse matrix in the skyline storage format, A' is the transpose of
A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the operation.
If transa = 'N' or 'n', then C := alpha*A*B + beta*C,
If transa = 'T' or 't' or 'C' or 'c', then C := alpha*A'*B + beta*C,
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix C.
k INTEGER. Number of columns of the matrix A.
alpha REAL for mkl_sskymm.
DOUBLE PRECISION for mkl_dskymm.
COMPLEX for mkl_cskymm.
DOUBLE COMPLEX for mkl_zskymm.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
NOTE General matrices (matdescra (1)='G') is not supported.
val REAL for mkl_sskymm.
DOUBLE PRECISION for mkl_dskymm.
COMPLEX for mkl_cskymm.
DOUBLE COMPLEX for mkl_zskymm.
Array containing the set of elements of the matrix A in the skyline profile
form.
If matdescrsa(2)= 'L', then val contains elements from the low triangle
of the matrix A.
If matdescrsa(2)= 'U', then val contains elements from the upper
triangle of the matrix A.
Refer to values array description in Skyline Storage Scheme for more
details.
pntr INTEGER. Array of length (m+m) for lower triangle, and (k+k) for upper
triangle.
It contains the indices specifying in the val the positions of the first
element in each row (column) of the matrix A. Refer to pointers array
description in Skyline Storage Scheme for more details.
b REAL for mkl_sskymm.
DOUBLE PRECISION for mkl_dskymm.
BLAS and Sparse BLAS Routines 2
289
COMPLEX for mkl_cskymm.
DOUBLE COMPLEX for mkl_zskymm.
Array, DIMENSION (ldb, n).
On entry with transa = 'N' or 'n', the leading k-by-n part of the array b
must contain the matrix B, otherwise the leading m-by-n part of the array b
must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program.
beta REAL for mkl_sskymm.
DOUBLE PRECISION for mkl_dskymm.
COMPLEX for mkl_cskymm.
DOUBLE COMPLEX for mkl_zskymm.
Specifies the scalar beta.
c REAL for mkl_sskymm.
DOUBLE PRECISION for mkl_dskymm.
COMPLEX for mkl_cskymm.
DOUBLE COMPLEX for mkl_zskymm.
Array, DIMENSION (ldc, n).
On entry, the leading m-by-n part of the array c must contain the matrix C,
otherwise the leading k-by-n part of the array c must contain the matrix C.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program.
Output Parameters
c Overwritten by the matrix (alpha*A*B + beta*C) or (alpha*A'*B +
beta*C).
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sskymm(transa, m, n, k, alpha, matdescra, val, pntr, b,
ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER pntr(*)
REAL alpha, beta
REAL val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dskymm(transa, m, n, k, alpha, matdescra, val, pntr, b,
ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER pntr(*)
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
2 Intel® Math Kernel Library Reference Manual
290
SUBROUTINE mkl_cskymm(transa, m, n, k, alpha, matdescra, val, pntr, b,
ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER pntr(*)
COMPLEX alpha, beta
COMPLEX val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zskymm(transa, m, n, k, alpha, matdescra, val, pntr, b,
ldb, beta, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, k, ldb, ldc
INTEGER pntr(*)
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
C:
void mkl_sskymm(char *transa, int *m, int *n, int *k, float *alpha,
char *matdescra, float *val, int *pntr, float *b, int *ldb,
float *beta, float *c, int *ldc);
void mkl_dskymm(char *transa, int *m, int *n, int *k, double *alpha,
char *matdescra, double *val, int *pntr, double *b, int *ldb,
double *beta, double *c, int *ldc);
void mkl_cskymm(char *transa, int *m, int *n, int *k, MKL_Complex8 *alpha,
char *matdescra, MKL_Complex8 *val, int *pntr, MKL_Complex8 *b, int *ldb,
MKL_Complex8 *beta, MKL_Complex8 *c, int *ldc);
void mkl_zskymm(char *transa, int *m, int *n, int *k, MKL_Complex16 *alpha,
char *matdescra, MKL_Complex16 *val, int *pntr, MKL_Complex16 *b, int *ldb,
MKL_Complex16 *beta, MKL_Complex16 *c, int *ldc);
mkl_?diasm
Solves a system of linear matrix equations for a
sparse matrix in the diagonal format with one-based
indexing.
Syntax
Fortran:
call mkl_sdiasm(transa, m, n, alpha, matdescra, val, lval, idiag, ndiag, b, ldb, c,
ldc)
BLAS and Sparse BLAS Routines 2
291
call mkl_ddiasm(transa, m, n, alpha, matdescra, val, lval, idiag, ndiag, b, ldb, c,
ldc)
call mkl_cdiasm(transa, m, n, alpha, matdescra, val, lval, idiag, ndiag, b, ldb, c,
ldc)
call mkl_zdiasm(transa, m, n, alpha, matdescra, val, lval, idiag, ndiag, b, ldb, c,
ldc)
C:
mkl_sdiasm(&transa, &m, &n, &alpha, matdescra, val, &lval, idiag, &ndiag, b, &ldb, c,
&ldc);
mkl_ddiasm(&transa, &m, &n, &alpha, matdescra, val, &lval, idiag, &ndiag, b, &ldb, c,
&ldc);
mkl_cdiasm(&transa, &m, &n, &alpha, matdescra, val, &lval, idiag, &ndiag, b, &ldb, c,
&ldc);
mkl_zdiasm(&transa, &m, &n, &alpha, matdescra, val, &lval, idiag, &ndiag, b, &ldb, c,
&ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?diasm routine solves a system of linear equations with matrix-matrix operations for a sparse
matrix in the diagonal format:
C := alpha*inv(A)*B
or
C := alpha*inv(A')*B,
where:
alpha is scalar, B and C are dense matrices, A is a sparse upper or lower triangular matrix with unit or nonunit
main diagonal, A' is the transpose of A.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then C := alpha*inv(A)*B,
If transa = 'T' or 't' or 'C' or 'c', then C := alpha*inv(A')*B.
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix C.
alpha REAL for mkl_sdiasm.
DOUBLE PRECISION for mkl_ddiasm.
COMPLEX for mkl_cdiasm.
DOUBLE COMPLEX for mkl_zdiasm.
2 Intel® Math Kernel Library Reference Manual
292
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
val REAL for mkl_sdiasm.
DOUBLE PRECISION for mkl_ddiasm.
COMPLEX for mkl_cdiasm.
DOUBLE COMPLEX for mkl_zdiasm.
Two-dimensional array of size lval by ndiag, contains non-zero diagonals
of the matrix A. Refer to values array description in Diagonal Storage
Scheme for more details.
lval INTEGER. Leading dimension of val, lval=m. Refer to lval description in
Diagonal Storage Scheme for more details.
idiag INTEGER. Array of length ndiag, contains the distances between main
diagonal and each non-zero diagonals in the matrix A.
NOTE All elements of this array must be sorted in increasing order.
Refer to distance array description in Diagonal Storage Scheme for more
details.
ndiag INTEGER. Specifies the number of non-zero diagonals of the matrix A.
b REAL for mkl_sdiasm.
DOUBLE PRECISION for mkl_ddiasm.
COMPLEX for mkl_cdiasm.
DOUBLE COMPLEX for mkl_zdiasm.
Array, DIMENSION (ldb, n).
On entry the leading m-by-n part of the array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program.
Output Parameters
c REAL for mkl_sdiasm.
DOUBLE PRECISION for mkl_ddiasm.
COMPLEX for mkl_cdiasm.
DOUBLE COMPLEX for mkl_zdiasm.
Array, DIMENSION (ldc, n).
The leading m-by-n part of the array c contains the matrix C.
BLAS and Sparse BLAS Routines 2
293
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sdiasm(transa, m, n, alpha, matdescra, val, lval, idiag,
ndiag, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc, lval, ndiag
INTEGER idiag(*)
REAL alpha
REAL val(lval,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_ddiasm(transa, m, n, alpha, matdescra, val, lval, idiag,
ndiag, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc, lval, ndiag
INTEGER idiag(*)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(lval,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_cdiasm(transa, m, n, alpha, matdescra, val, lval, idiag,
ndiag, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc, lval, ndiag
INTEGER idiag(*)
COMPLEX alpha
COMPLEX val(lval,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zdiasm(transa, m, n, alpha, matdescra, val, lval, idiag,
ndiag, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc, lval, ndiag
INTEGER idiag(*)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(lval,*), b(ldb,*), c(ldc,*)
C:
void mkl_sdiasm(char *transa, int *m, int *n, float *alpha,
char *matdescra, float *val, int *lval, int *idiag, int *ndiag,
float *b, int *ldb, float *c, int *ldc);
2 Intel® Math Kernel Library Reference Manual
294
void mkl_ddiasm(char *transa, int *m, int *n, double *alpha,
char *matdescra, double *val, int *lval, int *idiag, int *ndiag,
double *b, int *ldb, double *c, int *ldc);
void mkl_cdiasm(char *transa, int *m, int *n, MKL_Complex8 *alpha,
char *matdescra, MKL_Complex8 *val, int *lval, int *idiag, int *ndiag,
MKL_Complex8 *b, int *ldb, MKL_Complex8 *c, int *ldc);
void mkl_zdiasm(char *transa, int *m, int *n, MKL_Complex16 *alpha,
char *matdescra, MKL_Complex16 *val, int *lval, int *idiag, int *ndiag,
MKL_Complex16 *b, int *ldb, MKL_Complex16 *c, int *ldc);
mkl_?skysm
Solves a system of linear matrix equations for a
sparse matrix stored using the skyline storage scheme
with one-based indexing.
Syntax
Fortran:
call mkl_sskysm(transa, m, n, alpha, matdescra, val, pntr, b, ldb, c, ldc)
call mkl_dskysm(transa, m, n, alpha, matdescra, val, pntr, b, ldb, c, ldc)
call mkl_cskysm(transa, m, n, alpha, matdescra, val, pntr, b, ldb, c, ldc)
call mkl_zskysm(transa, m, n, alpha, matdescra, val, pntr, b, ldb, c, ldc)
C:
mkl_sskysm(&transa, &m, &n, &alpha, matdescra, val, pntr, b, &ldb, c, &ldc);
mkl_dskysm(&transa, &m, &n, &alpha, matdescra, val, pntr, b, &ldb, c, &ldc);
mkl_cskysm(&transa, &m, &n, &alpha, matdescra, val, pntr, b, &ldb, c, &ldc);
mkl_zskysm(&transa, &m, &n, &alpha, matdescra, val, pntr, b, &ldb, c, &ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?skysm routine solves a system of linear equations with matrix-matrix operations for a sparse
matrix in the skyline storage format:
C := alpha*inv(A)*B
or
C := alpha*inv(A')*B,
where:
alpha is scalar, B and C are dense matrices, A is a sparse upper or lower triangular matrix with unit or nonunit
main diagonal, A' is the transpose of A.
BLAS and Sparse BLAS Routines 2
295
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
transa CHARACTER*1. Specifies the system of linear equations.
If transa = 'N' or 'n', then C := alpha*inv(A)*B,
If transa = 'T' or 't' or 'C' or 'c', then C := alpha*inv(A')*B,
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix C.
alpha REAL for mkl_sskysm.
DOUBLE PRECISION for mkl_dskysm.
COMPLEX for mkl_cskysm.
DOUBLE COMPLEX for mkl_zskysm.
Specifies the scalar alpha.
matdescra CHARACTER. Array of six elements, specifies properties of the matrix used
for operation. Only first four array elements are used, their possible values
are given in Table “Possible Values of the Parameter matdescra (descra)”.
Possible combinations of element values of this parameter are given in
Table “Possible Combinations of Element Values of the Parameter
matdescra”.
NOTE General matrices (matdescra (1)='G') is not supported.
val REAL for mkl_sskysm.
DOUBLE PRECISION for mkl_dskysm.
COMPLEX for mkl_cskysm.
DOUBLE COMPLEX for mkl_zskysm.
Array containing the set of elements of the matrix A in the skyline profile
form.
If matdescrsa(2)= 'L', then val contains elements from the low triangle
of the matrix A.
If matdescrsa(2)= 'U', then val contains elements from the upper
triangle of the matrix A.
Refer to values array description in Skyline Storage Scheme for more
details.
pntr INTEGER. Array of length (m+m). It contains the indices specifying in the
val the positions of the first non-zero element of each i-row (column) of
the matrix A such that pointers(i)- pointers(1)+1. Refer to pointers
array description in Skyline Storage Scheme for more details.
b REAL for mkl_sskysm.
DOUBLE PRECISION for mkl_dskysm.
COMPLEX for mkl_cskysm.
DOUBLE COMPLEX for mkl_zskysm.
Array, DIMENSION (ldb, n).
On entry the leading m-by-n part of the array b must contain the matrix B.
2 Intel® Math Kernel Library Reference Manual
296
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program.
Output Parameters
c REAL for mkl_sskysm.
DOUBLE PRECISION for mkl_dskysm.
COMPLEX for mkl_cskysm.
DOUBLE COMPLEX for mkl_zskysm.
Array, DIMENSION (ldc, n).
The leading m-by-n part of the array c contains the matrix C.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sskysm(transa, m, n, alpha, matdescra, val, pntr, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER pntr(*)
REAL alpha
REAL val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_dskysm(transa, m, n, alpha, matdescra, val, pntr, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER pntr(*)
DOUBLE PRECISION alpha
DOUBLE PRECISION val(*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_cskysm(transa, m, n, alpha, matdescra, val, pntr, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER pntr(*)
COMPLEX alpha
COMPLEX val(*), b(ldb,*), c(ldc,*)
BLAS and Sparse BLAS Routines 2
297
SUBROUTINE mkl_zskysm(transa, m, n, alpha, matdescra, val, pntr, b, ldb, c, ldc)
CHARACTER*1 transa
CHARACTER matdescra(*)
INTEGER m, n, ldb, ldc
INTEGER pntr(*)
DOUBLE COMPLEX alpha
DOUBLE COMPLEX val(*), b(ldb,*), c(ldc,*)
C:
void mkl_sskysm(char *transa, int *m, int *n, float *alpha, char *matdescra,
float *val, int *pntr, float *b, int *ldb, float *c, int *ldc);
void mkl_dskysm(char *transa, int *m, int *n, double *alpha, char *matdescra,
double *val, int *pntr, double *b, int *ldb, double *c, int *ldc);
void mkl_cskysm(char *transa, int *m, int *n, MKL_Complex8 *alpha, char *matdescra,
MKL_Complex8 *val, int *pntr, MKL_Complex8 *b, int *ldb, MKL_Complex8 *c, int *ldc);
void mkl_zskysm(char *transa, int *m, int *n, MKL_Complex16 *alpha, char *matdescra,
MKL_Complex16 *val, int *pntr, MKL_Complex16 *b, int *ldb, MKL_Complex16 *c, int *ldc);
mkl_?dnscsr
Convert a sparse matrix in dense representation to
the CSR format and vice versa.
Syntax
Fortran:
call mkl_sdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
call mkl_ddnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
call mkl_cdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
call mkl_zdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
C:
mkl_sdnscsr(job, &m, &n, adns, &lda, acsr, ja, ia, &info);
mkl_ddnscsr(job, &m, &n, adns, &lda, acsr, ja, ia, &info);
mkl_cdnscsr(job, &m, &n, adns, &lda, acsr, ja, ia, &info);
mkl_zdnscsr(job, &m, &n, adns, &lda, acsr, ja, ia, &info);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
This routine converts an sparse matrix stored as a rectangular m-by-n matrix A (dense representation) to the
compressed sparse row (CSR) format (3-array variation) and vice versa.
2 Intel® Math Kernel Library Reference Manual
298
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
job INTEGER
Array, contains the following conversion parameters:
job(1)
If job(1)=0, the rectangular matrix A is converted to the CSR format;
if job(1)=1, the rectangular matrix A is restored from the CSR format.
job(2)
If job(2)=0, zero-based indexing for the rectangular matrix A is used;
if job(2)=1, one-based indexing for the rectangular matrix A is used.
job(3)
If job(3)=0, zero-based indexing for the matrix in CSR format is used;
if job(3)=1, one-based indexing for the matrix in CSR format is used.
job(4)
If job(4)=0, adns is a lower triangular part of matrix A;
If job(4)=1, adns is an upper triangular part of matrix A;
If job(4)=2, adns is a whole matrix A.
job(5)
job(5)=nzmax - maximum number of the non-zero elements allowed if
job(1)=0.
job(6) - job indicator for conversion to CSR format.
If job(6)=0, only array ia is generated for the output storage.
If job(6)>0, arrays acsr, ia, ja are generated for the output storage.
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix A.
adns (input/output)
REAL for mkl_sdnscsr.
DOUBLE PRECISION for mkl_ddnscsr.
COMPLEX for mkl_cdnscsr.
DOUBLE COMPLEX for mkl_zdnscsr.
Array containing non-zero elements of the matrix A.
lda (input/output)INTEGER. Specifies the leading dimension of adns as declared
in the calling (sub)program, must be at least max(1, m).
acsr (input/output)
REAL for mkl_sdnscsr.
DOUBLE PRECISION for mkl_ddnscsr.
COMPLEX for mkl_cdnscsr.
DOUBLE COMPLEX for mkl_zdnscsr.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ja (input/output)INTEGER. Array containing the column indices for each nonzero
element of the matrix A.
Its length is equal to the length of the array acsr. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
ia (input/output)INTEGER. Array of length m + 1, containing indices of
elements in the array acsr, such that ia(I) is the index in the array acsr
of the first non-zero element from the row I. The value of the last element
BLAS and Sparse BLAS Routines 2
299
ia(m + 1) is equal to the number of non-zeros plus one. Refer to
rowIndex array description in Sparse Matrix Storage Formats for more
details.
Output Parameters
info INTEGER. Integer info indicator only for restoring the matrix A from the CSR
format.
If info=0, the execution is successful.
If info=i, the routine is interrupted processing the i-th row because there
is no space in the arrays adns and ja according to the value nzmax.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_sdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
INTEGER job(8)
INTEGER m, n, lda, info
INTEGER ja(*), ia(m+1)
REAL adns(*), acsr(*)
SUBROUTINE mkl_ddnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
INTEGER job(8)
INTEGER m, n, lda, info
INTEGER ja(*), ia(m+1)
DOUBLE PRECISION adns(*), acsr(*)
SUBROUTINE mkl_cdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
INTEGER job(8)
INTEGER m, n, lda, info
INTEGER ja(*), ia(m+1)
COMPLEX adns(*), acsr(*)
SUBROUTINE mkl_zdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
INTEGER job(8)
INTEGER m, n, lda, info
INTEGER ja(*), ia(m+1)
DOUBLE COMPLEX adns(*), acsr(*)
C:
void mkl_sdnscsr(int *job, int *m, int *n, float *adns,
int *lda, float *acsr, int *ja, int *ia, int *info);
void mkl_ddnscsr(int *job, int *m, int *n, double *adns,
int *lda, double *acsr, int *ja, int *ia, int *info);
void mkl_cdnscsr(int *job, int *m, int *n, MKL_Complex8 *adns,
int *lda, MKL_Complex8 *acsr, int *ja, int *ia, int *info);
2 Intel® Math Kernel Library Reference Manual
300
void mkl_zdnscsr(int *job, int *m, int *n, MKL_Complex16 *adns,
int *lda, MKL_Complex16 *acsr, int *ja, int *ia, int *info);
mkl_?csrcoo
Converts a sparse matrix in the CSR format to the
coordinate format and vice versa.
Syntax
Fortran:
call mkl_scsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
call mkl_dcsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
call mkl_ccsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
call mkl_zcsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
C:
mkl_scsrcoo(job, &n, acsr, ja, ia, &nnz, acoo, rowind, colind, &info);
mkl_dcsrcoo(job, &n, acsr, ja, ia, &nnz, acoo, rowind, colind, &info);
mkl_ccsrcoo(job, &n, acsr, ja, ia, &nnz, acoo, rowind, colind, &info);
mkl_zcsrcoo(job, &n, acsr, ja, ia, &nnz, acoo, rowind, colind, &info);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
This routine converts a sparse matrix A stored in the compressed sparse row (CSR) format (3-array
variation) to coordinate format and vice versa.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
job INTEGER
Array, contains the following conversion parameters:
job(1)
If job(1)=0, the matrix in the CSR format is converted to the coordinate
format;
if job(1)=1, the matrix in the coordinate format is converted to the CSR
format.
if job(1)=2, the matrix in the coordinate format is converted to the CSR
format, and the column indices in CSR representation are sorted in the
increasing order within each row.
job(2)
If job(2)=0, zero-based indexing for the matrix in CSR format is used;
if job(2)=1, one-based indexing for the matrix in CSR format is used.
job(3)
BLAS and Sparse BLAS Routines 2
301
If job(3)=0, zero-based indexing for the matrix in coordinate format is
used;
if job(3)=1, one-based indexing for the matrix in coordinate format is
used.
job(5)
job(5)=nzmax - maximum number of the non-zero elements allowed if
job(1)=0.
job(5)=nnz - sets number of the non-zero elements of the matrix A if
job(1)=1.
job(6) - job indicator.
For conversion to the coordinate format:
If job(6)=1, only array rowind is filled in for the output storage.
If job(6)=2, arrays rowind, colind are filled in for the output storage.
If job(6)=3, all arrays rowind, colind, acoo are filled in for the output
storage.
For conversion to the CSR format:
If job(6)=0, all arrays acsr, ja, ia are filled in for the output storage.
If job(6)=1, only array ia is filled in for the output storage.
If job(6)=2, then it is assumed that the routine already has been called
with the job(6)=1, and the user allocated the required space for storing
the output arrays acsr and ja.
n INTEGER. Dimension of the matrix A.
acsr (input/output)
REAL for mkl_scsrcoo.
DOUBLE PRECISION for mkl_dcsrcoo.
COMPLEX for mkl_ccsrcoo.
DOUBLE COMPLEX for mkl_zcsrcoo.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ja (input/output) INTEGER. Array containing the column indices for each nonzero
element of the matrix A.
Its length is equal to the length of the array acsr. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
ia (input/output) INTEGER. Array of length n + 1, containing indices of
elements in the array acsr, such that ia(I) is the index in the array acsr
of the first non-zero element from the row I. The value of the last element
ia(n + 1) is equal to the number of non-zeros plus one. Refer to
rowIndex array description in Sparse Matrix Storage Formats for more
details.
acoo (input/output)
REAL for mkl_scsrcoo.
DOUBLE PRECISION for mkl_dcsrcoo.
COMPLEX for mkl_ccsrcoo.
DOUBLE COMPLEX for mkl_zcsrcoo.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
rowind (input/output)INTEGER. Array of length nnz, contains the row indices for
each non-zero element of the matrix A.
Refer to rows array description in Coordinate Format for more details.
2 Intel® Math Kernel Library Reference Manual
302
colind (input/output) INTEGER. Array of length nnz, contains the column indices
for each non-zero element of the matrix A. Refer to columns array
description in Coordinate Format for more details.
Output Parameters
nnz INTEGER. Specifies the number of non-zero element of the matrix A.
Refer to nnz description in Coordinate Format for more details.
info INTEGER. Integer info indicator only for converting the matrix A from the
CSR format.
If info=0, the execution is successful.
If info=1, the routine is interrupted because there is no space in the arrays
acoo, rowind, colind according to the value nzmax.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
INTEGER job(8)
INTEGER n, nnz, info
INTEGER ja(*), ia(n+1), rowind(*), colind(*)
REAL acsr(*), acoo(*)
SUBROUTINE mkl_dcsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
INTEGER job(8)
INTEGER n, nnz, info
INTEGER ja(*), ia(n+1), rowind(*), colind(*)
DOUBLE PRECISION acsr(*), acoo(*)
SUBROUTINE mkl_ccsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
INTEGER job(8)
INTEGER n, nnz, info
INTEGER ja(*), ia(n+1), rowind(*), colind(*)
COMPLEX acsr(*), acoo(*)
SUBROUTINE mkl_zcsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
INTEGER job(8)
INTEGER n, nnz, info
INTEGER ja(*), ia(n+1), rowind(*), colind(*)
DOUBLE COMPLEX acsr(*), acoo(*)
C:
void mkl_scsrcoo(int *job, int *n, float *acsr, int *ja,
int *ia, int *nnz, float *acoo, int *rowind, int *colind, int *info);
void mkl_dcsrcoo(int *job, int *n, double *acsr, int *ja,
int *ia, int *nnz, double *acoo, int *rowind, int *colind, int *info);
BLAS and Sparse BLAS Routines 2
303
void mkl_ccsrcoo(int *job, int *n, MKL_Complex8 *acsr, int *ja,
int *ia, int *nnz, MKL_Complex8 *acoo, int *rowind, int *colind, int *info);
void mkl_zcsrcoo(int *job, int *n, MKL_Complex16 *acsr, int *ja,
int *ia, int *nnz, MKL_Complex16 *acoo, int *rowind, int *colind, int *info);
mkl_?csrbsr
Converts a sparse matrix in the CSR format to the
BSR format and vice versa.
Syntax
Fortran:
call mkl_scsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)
call mkl_dcsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)
call mkl_ccsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)
call mkl_zcsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)
C:
mkl_scsrbsr(job, &m, &mblk, &ldabsr, acsr, ja, ia, absr, jab, iab, &info);
mkl_dcsrbsr(job, &m, &mblk, &ldabsr, acsr, ja, ia, absr, jab, iab, &info);
mkl_ccsrbsr(job, &m, &mblk, &ldabsr, acsr, ja, ia, absr, jab, iab, &info);
mkl_zcsrbsr(job, &m, &mblk, &ldabsr, acsr, ja, ia, absr, jab, iab, &info);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
This routine converts a sparse matrix A stored in the compressed sparse row (CSR) format (3-array
variation) to the block sparse row (BSR) format and vice versa.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
job INTEGER
Array, contains the following conversion parameters:
job(1)
If job(1)=0, the matrix in the CSR format is converted to the BSR format;
if job(1)=1, the matrix in the BSR format is converted to the CSR format.
job(2)
If job(2)=0, zero-based indexing for the matrix in CSR format is used;
if job(2)=1, one-based indexing for the matrix in CSR format is used.
job(3)
If job(3)=0, zero-based indexing for the matrix in the BSR format is used;
if job(3)=1, one-based indexing for the matrix in the BSR format is used.
2 Intel® Math Kernel Library Reference Manual
304
job(4) is only used for conversion to CSR format. By default, the converter
saves the blocks without checking whether an element is zero or not. If
job(4)=1, then the converter only saves non-zero elements in blocks.
job(6) - job indicator.
For conversion to the BSR format:
If job(6)=0, only arrays jab, iab are generated for the output storage.
If job(6)>0, all output arrays absr, jab, and iab are filled in for the
output storage.
If job(6)=-1, iab(1) returns the number of non-zero blocks.
For conversion to the CSR format:
If job(6)=0, only arrays ja, ia are generated for the output storage.
m INTEGER. Actual row dimension of the matrix A for convert to the BSR
format; block row dimension of the matrix A for convert to the CSR format.
mblk INTEGER. Size of the block in the matrix A.
ldabsr INTEGER. Leading dimension of the array absr as declared in the calling
program. ldabsr must be greater than or equal to mblk*mblk.
acsr (input/output)
REAL for mkl_scsrbsr.
DOUBLE PRECISION for mkl_dcsrbsr.
COMPLEX for mkl_ccsrbsr.
DOUBLE COMPLEX for mkl_zcsrbsr.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ja (input/output) INTEGER. Array containing the column indices for each nonzero
element of the matrix A.
Its length is equal to the length of the array acsr. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
ia (input/output) INTEGER. Array of length m + 1, containing indices of
elements in the array acsr, such that ia(I) is the index in the array acsr
of the first non-zero element from the row I. The value of the last element
ia(m + 1) is equal to the number of non-zeros plus one. Refer to
rowIndex array description in Sparse Matrix Storage Formats for more
details.
absr (input/output)
REAL for mkl_scsrbsr.
DOUBLE PRECISION for mkl_dcsrbsr.
COMPLEX for mkl_ccsrbsr.
DOUBLE COMPLEX for mkl_zcsrbsr.
Array containing elements of non-zero blocks of the matrix A. Its length is
equal to the number of non-zero blocks in the matrix A multiplied by
mblk*mblk. Refer to values array description in BSR Format for more
details.
jab (input/output) INTEGER. Array containing the column indices for each nonzero
block of the matrix A.
Its length is equal to the number of non-zero blocks of the matrix A. Refer
to columns array description in BSR Format for more details.
BLAS and Sparse BLAS Routines 2
305
iab (input/output) INTEGER. Array of length (m + 1), containing indices of
blocks in the array absr, such that iab(i) is the index in the array absr of
the first non-zero element from the i-th row . The value of the last element
iab(m + 1) is equal to the number of non-zero blocks plus one. Refer to
rowIndex array description in BSR Format for more details.
Output Parameters
info INTEGER. Integer info indicator only for converting the matrix A from the
CSR format.
If info=0, the execution is successful.
If info=1, it means that mblk is equal to 0.
If info=2, it means that ldabsr is less than mblk*mblk and there is no
space for all blocks.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)
INTEGER job(8)
INTEGER m, mblk, ldabsr, info
INTEGER ja(*), ia(m+1), jab(*), iab(*)
REAL acsr(*), absr(ldabsr,*)
SUBROUTINE mkl_dcsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)
INTEGER job(8)
INTEGER m, mblk, ldabsr, info
INTEGER ja(*), ia(m+1), jab(*), iab(*)
DOUBLE PRECISION acsr(*), absr(ldabsr,*)
SUBROUTINE mkl_ccsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)
INTEGER job(8)
INTEGER m, mblk, ldabsr, info
INTEGER ja(*), ia(m+1), jab(*), iab(*)
COMPLEX acsr(*), absr(ldabsr,*)
SUBROUTINE mkl_zcsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)
INTEGER job(8)
INTEGER m, mblk, ldabsr, info
INTEGER ja(*), ia(m+1), jab(*), iab(*)
DOUBLE COMPLEX acsr(*), absr(ldabsr,*)
C:
void mkl_scsrbsr(int *job, int *m, int *mblk, int *ldabsr, float *acsr, int *ja,
int *ia, float *absr, int *jab, int *iab, int *info);
void mkl_dcsrbsr(int *job, int *m, int *mblk, int *ldabsr, double *acsr, int *ja,
int *ia, double *absr, int *jab, int *iab, int *info);
2 Intel® Math Kernel Library Reference Manual
306
void mkl_ccsrbsr(int *job, int *m, int *mblk, int *ldabsr, MKL_Complex8 *acsr, int *ja,
int *ia, MKL_Complex8 *absr, int *jab, int *iab, int *info);
void mkl_zcsrbsr(int *job, int *m, int *mblk, int *ldabsr, MKL_Complex16 *acsr, int *ja,
int *ia, MKL_Complex16 *absr, int *jab, int *iab, int *info);
mkl_?csrcsc
Converts a square sparse matrix in the CSR format to
the CSC format and vice versa.
Syntax
Fortran:
call mkl_scsrcsc(job, m, acsr, ja, ia, acsc, ja1, ia1, info)
call mkl_dcsrcsc(job, m, acsr, ja, ia, acsc, ja1, ia1, info)
call mkl_ccsrcsc(job, m, acsr, ja, ia, acsc, ja1, ia1, info)
call mkl_zcsrcsc(job, m, acsr, ja, ia, acsc, ja1, ia1, info)
C:
mkl_scsrcsc(job, &m, acsr, ja, ia, acsc, ja1, ia1, &info);
mkl_dcsrcsc(job, &m, acsr, ja, ia, acsc, ja1, ia1, &info);
mkl_ccsrcsc(job, &m, acsr, ja, ia, acsc, ja1, ia1, &info);
mkl_zcsrcsc(job, &m, acsr, ja, ia, acsc, ja1, ia1, &info);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
This routine converts a square sparse matrix A stored in the compressed sparse row (CSR) format (3-array
variation) to the compressed sparse column (CSC) format and vice versa.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
job INTEGER
Array, contains the following conversion parameters:
job(1)
If job(1)=0, the matrix in the CSR format is converted to the CSC format;
if job(1)=1, the matrix in the CSC format is converted to the CSR format.
job(2)
If job(2)=0, zero-based indexing for the matrix in CSR format is used;
if job(2)=1, one-based indexing for the matrix in CSR format is used.
job(3)
If job(3)=0, zero-based indexing for the matrix in the CSC format is used;
if job(3)=1, one-based indexing for the matrix in the CSC format is used.
job(6) - job indicator.
BLAS and Sparse BLAS Routines 2
307
For conversion to the CSC format:
If job(6)=0, only arrays ja1, ia1 are filled in for the output storage.
If job(6)?0, all output arrays acsc, ja1, and ia1 are filled in for the
output storage.
For conversion to the CSR format:
If job(6)=0, only arrays ja, ia are filled in for the output storage.
If job(6)?0, all output arrays acsr, ja, and ia are filled in for the output
storage.
m INTEGER. Dimension of the square matrix A.
acsr (input/output)
REAL for mkl_scsrcsc.
DOUBLE PRECISION for mkl_dcsrcsc.
COMPLEX for mkl_ccsrcsc.
DOUBLE COMPLEX for mkl_zcsrcsc.
Array containing non-zero elements of the square matrix A. Its length is
equal to the number of non-zero elements in the matrix A. Refer to values
array description in Sparse Matrix Storage Formats for more details.
ja (input/output) INTEGER. Array containing the column indices for each nonzero
element of the matrix A.
Its length is equal to the length of the array acsr. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
ia (input/output) INTEGER. Array of length m + 1, containing indices of
elements in the array acsr, such that ia(I) is the index in the array acsr
of the first non-zero element from the row I. The value of the last element
ia(m + 1) is equal to the number of non-zeros plus one. Refer to
rowIndex array description in Sparse Matrix Storage Formats for more
details.
acsc (input/output)
REAL for mkl_scsrcsc.
DOUBLE PRECISION for mkl_dcsrcsc.
COMPLEX for mkl_ccsrcsc.
DOUBLE COMPLEX for mkl_zcsrcsc.
Array containing non-zero elements of the square matrix A. Its length is
equal to the number of non-zero elements in the matrix A. Refer to values
array description in Sparse Matrix Storage Formats for more details.
ja1 (input/output) INTEGER. Array containing the row indices for each non-zero
element of the matrix A.
Its length is equal to the length of the array acsc. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
ia1 (input/output) INTEGER. Array of length m + 1, containing indices of
elements in the array acsc, such that ia1(I) is the index in the array acsc
of the first non-zero element from the column I. The value of the last
element ia1(m + 1) is equal to the number of non-zeros plus one. Refer to
rowIndex array description in Sparse Matrix Storage Formats for more
details.
Output Parameters
info INTEGER. This parameter is not used now.
2 Intel® Math Kernel Library Reference Manual
308
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrcsc(job, m, acsr, ja, ia, acsc, ja1, ia1, info)
INTEGER job(8)
INTEGER m, info
INTEGER ja(*), ia(m+1), ja1(*), ia1(m+1)
REAL acsr(*), acsc(*)
SUBROUTINE mkl_dcsrcsc(job, m, acsr, ja, ia, acsc, ja1, ia1, info)
INTEGER job(8)
INTEGER m, info
INTEGER ja(*), ia(m+1), ja1(*), ia1(m+1)
DOUBLE PRECISION acsr(*), acsc(*)
SUBROUTINE mkl_ccsrcsc(job, m, acsr, ja, ia, acsc, ja1, ia1, info)
INTEGER job(8)
INTEGER m, info
INTEGER ja(*), ia(m+1), ja1(*), ia1(m+1)
COMPLEX acsr(*), acsc(*)
SUBROUTINE mkl_zcsrcsc(job, m, acsr, ja, ia, acsc, ja1, ia1, info)
INTEGER job(8)
INTEGER m, info
INTEGER ja(*), ia(m+1), ja1(*), ia1(m+1)
DOUBLE COMPLEX acsr(*), acsc(*)
C:
void mkl_scsrcsc(int *job, int *m, float *acsr, int *ja,
int *ia, float *acsc, int *ja1, int *ia1, int *info);
void mkl_dcsrcsc(int *job, int *m, double *acsr, int *ja,
int *ia, double *acsc, int *ja1, int *ia1, int *info);
void mkl_ccsrcsc(int *job, int *m, MKL_Complex8 *acsr, int *ja,
int *ia, MKL_Complex8 *acsc, int *ja1, int *ia1, int *info);
void mkl_zcsrcsc(int *job, int *m, MKL_Complex16 *acsr, int *ja,
int *ia, MKL_Complex16 *acsc, int *ja1, int *ia1, int *info);
mkl_?csrdia
Converts a sparse matrix in the CSR format to the
diagonal format and vice versa.
BLAS and Sparse BLAS Routines 2
309
Syntax
Fortran:
call mkl_scsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem,
ia_rem, info)
call mkl_dcsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem,
ia_rem, info)
call mkl_ccsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem,
ia_rem, info)
call mkl_zcsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem,
ia_rem, info)
C:
mkl_scsrdia(job, &m, acsr, ja, ia, adia, &ngiag, distance, &idiag, acsr_rem, ja_rem,
ia_rem, &info);
mkl_dcsrdia(job, &m, acsr, ja, ia, adia, &ngiag, distance, &idiag, acsr_rem, ja_rem,
ia_rem, &info);
mkl_ccsrdia(job, &m, acsr, ja, ia, adia, &ngiag, distance, &idiag, acsr_rem, ja_rem,
ia_rem, &info);
mkl_zcsrdia(job, &m, acsr, ja, ia, adia, &ngiag, distance, &idiag, acsr_rem, ja_rem,
ia_rem, &info);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
This routine converts a sparse matrix A stored in the compressed sparse row (CSR) format (3-array
variation) to the diagonal format and vice versa.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
job INTEGER
Array, contains the following conversion parameters:
job(1)
If job(1)=0, the matrix in the CSR format is converted to the diagonal
format;
if job(1)=1, the matrix in the diagonal format is converted to the CSR
format.
job(2)
If job(2)=0, zero-based indexing for the matrix in CSR format is used;
if job(2)=1, one-based indexing for the matrix in CSR format is used.
job(3)
If job(3)=0, zero-based indexing for the matrix in the diagonal format is
used;
if job(3)=1, one-based indexing for the matrix in the diagonal format is
used.
2 Intel® Math Kernel Library Reference Manual
310
job(6) - job indicator.
For conversion to the diagonal format:
If job(6)=0, diagonals are not selected internally, and acsr_rem, ja_rem,
ia_rem are not filled in for the output storage.
If job(6)=1, diagonals are not selected internally, and acsr_rem, ja_rem,
ia_rem are filled in for the output storage.
If job(6)=10, diagonals are selected internally, and acsr_rem, ja_rem,
ia_rem are not filled in for the output storage.
If job(6)=11, diagonals are selected internally, and csr_rem, ja_rem,
ia_rem are filled in for the output storage.
For conversion to the CSR format:
If job(6)=0, each entry in the array adia is checked whether it is zero.
Zero entries are not included in the array acsr.
If job(6)?0, each entry in the array adia is not checked whether it is zero.
m INTEGER. Dimension of the matrix A.
acsr (input/output)
REAL for mkl_scsrdia.
DOUBLE PRECISION for mkl_dcsrdia.
COMPLEX for mkl_ccsrdia.
DOUBLE COMPLEX for mkl_zcsrdia.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ja (input/output) INTEGER. Array containing the column indices for each nonzero
element of the matrix A.
Its length is equal to the length of the array acsr. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
ia (input/output) INTEGER. Array of length m + 1, containing indices of
elements in the array acsr, such that ia(I) is the index in the array acsr
of the first non-zero element from the row I. The value of the last element
ia(m + 1) is equal to the number of non-zeros plus one. Refer to
rowIndex array description in Sparse Matrix Storage Formats for more
details.
adia (input/output)
REAL for mkl_scsrdia.
DOUBLE PRECISION for mkl_dcsrdia.
COMPLEX for mkl_ccsrdia.
DOUBLE COMPLEX for mkl_zcsrdia.
Array of size (ndiag x idiag) containing diagonals of the matrix A.
The key point of the storage is that each element in the array adia retains
the row number of the original matrix. To achieve this diagonals in the
lower triangular part of the matrix are padded from the top, and those in
the upper triangular part are padded from the bottom.
ndiag INTEGER.
Specifies the leading dimension of the array adia as declared in the calling
(sub)program, must be at least max(1, m).
distance INTEGER.
Array of length idiag, containing the distances between the main diagonal
and each non-zero diagonal to be extracted. The distance is positive if the
diagonal is above the main diagonal, and negative if the diagonal is below
the main diagonal. The main diagonal has a distance equal to zero.
BLAS and Sparse BLAS Routines 2
311
idiag INTEGER.
Number of diagonals to be extracted. For conversion to diagonal format on
return this parameter may be modified.
acsr_rem, ja_rem, ia_rem Remainder of the matrix in the CSR format if it is needed for conversion to
the diagonal format.
Output Parameters
info INTEGER. This parameter is not used now.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem,
info)
INTEGER job(8)
INTEGER m, info, ndiag, idiag
INTEGER ja(*), ia(m+1), distance(*), ja_rem(*), ia_rem(*)
REAL acsr(*), adia(*), acsr_rem(*)
SUBROUTINE mkl_dcsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem,
info)
INTEGER job(8)
INTEGER m, info, ndiag, idiag
INTEGER ja(*), ia(m+1), distance(*), ja_rem(*), ia_rem(*)
DOUBLE PRECISION acsr(*), adia(*), acsr_rem(*)
SUBROUTINE mkl_ccsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem,
info)
INTEGER job(8)
INTEGER m, info, ndiag, idiag
INTEGER ja(*), ia(m+1), distance(*), ja_rem(*), ia_rem(*)
COMPLEX acsr(*), adia(*), acsr_rem(*)
SUBROUTINE mkl_zcsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem,
info)
INTEGER job(8)
INTEGER m, info, ndiag, idiag
INTEGER ja(*), ia(m+1), distance(*), ja_rem(*), ia_rem(*)
DOUBLE COMPLEX acsr(*), adia(*), acsr_rem(*)
C:
void mkl_scsrdia(int *job, int *m, float *acsr, int *ja,
int *ia, float *adia, int *ndiag, int *distance, int *distance,
int *idiag, float *acsr_rem, int *ja_rem, int *ia_rem, int *info);
void mkl_dcsrdia(int *job, int *m, double *acsr, int *ja,
int *ia, double *adia, int *ndiag, int *distance, int *distance,
int *idiag, double *acsr_rem, int *ja_rem, int *ia_rem, int *info);
2 Intel® Math Kernel Library Reference Manual
312
void mkl_ccsrdia(int *job, int *m, MKL_Complex8 *acsr, int *ja,
int *ia, MKL_Complex8 *adia, int *ndiag, int *distance, int *distance,
int *idiag, MKL_Complex8 *acsr_rem, int *ja_rem, int *ia_rem, int *info);
void mkl_zcsrdia(int *job, int *m, MKL_Complex16 *acsr, int *ja,
int *ia, MKL_Complex16 *adia, int *ndiag, int *distance, int *distance,
int *idiag, MKL_Complex16 *acsr_rem, int *ja_rem, int *ia_rem, int *info);
mkl_?csrsky
Converts a sparse matrix in CSR format to the skyline
format and vice versa.
Syntax
Fortran:
call mkl_scsrsky(job, m, acsr, ja, ia, asky, pointers, info)
call mkl_dcsrsky(job, m, acsr, ja, ia, asky, pointers, info)
call mkl_ccsrsky(job, m, acsr, ja, ia, asky, pointers, info)
call mkl_zcsrsky(job, m, acsr, ja, ia, asky, pointers, info)
C:
mkl_scsrsky(job, &m, acsr, ja, ia, asky, pointers, &info);
mkl_dcsrsky(job, &m, acsr, ja, ia, asky, pointers, &info);
mkl_ccsrsky(job, &m, acsr, ja, ia, asky, pointers, &info);
mkl_zcsrsky(job, &m, acsr, ja, ia, asky, pointers, &info);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
This routine converts a sparse matrix A stored in the compressed sparse row (CSR) format (3-array
variation) to the skyline format and vice versa.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
job INTEGER
Array, contains the following conversion parameters:
job(1)
If job(1)=0, the matrix in the CSR format is converted to the skyline
format;
if job(1)=1, the matrix in the skyline format is converted to the CSR
format.
job(2)
If job(2)=0, zero-based indexing for the matrix in CSR format is used;
if job(2)=1, one-based indexing for the matrix in CSR format is used.
BLAS and Sparse BLAS Routines 2
313
job(3)
If job(3)=0, zero-based indexing for the matrix in the skyline format is
used;
if job(3)=1, one-based indexing for the matrix in the skyline format is
used.
job(4)
For conversion to the skyline format:
If job(4)=0, the upper part of the matrix A in the CSR format is converted.
If job(4)=1, the lower part of the matrix A in the CSR format is converted.
For conversion to the CSR format:
If job(4)=0, the matrix is converted to the upper part of the matrix A in
the CSR format.
If job(4)=1, the matrix is converted to the lower part of the matrix A in the
CSR format.
job(5)
job(5)=nzmax - maximum number od the non-zero elements of the matrix
A if job(1)=0.
job(6) - job indicator.
Only for conversion to the skyline format:
If job(6)=0, only arrays pointers is filled in for the output storage.
If job(6)=1, all output arrays asky and pointers are filled in for the
output storage.
m INTEGER. Dimension of the matrix A.
acsr (input/output)
REAL for mkl_scsrsky.
DOUBLE PRECISION for mkl_dcsrsky.
COMPLEX for mkl_ccsrsky.
DOUBLE COMPLEX for mkl_zcsrsky.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ja (input/output) INTEGER. Array containing the column indices for each nonzero
element of the matrix A.
Its length is equal to the length of the array acsr. Refer to columns array
description in Sparse Matrix Storage Formats for more details.
ia (input/output) INTEGER. Array of length m + 1, containing indices of
elements in the array acsr, such that ia(I) is the index in the array acsr
of the first non-zero element from the row I. The value of the last element
ia(m + 1) is equal to the number of non-zeros plus one. Refer to
rowIndex array description in Sparse Matrix Storage Formats for more
details.
asky (input/output)
REAL for mkl_scsrsky.
DOUBLE PRECISION for mkl_dcsrsky.
COMPLEX for mkl_ccsrsky.
DOUBLE COMPLEX for mkl_zcsrsky.
Array, for a lower triangular part of A it contains the set of elements from
each row starting from the first none-zero element to and including the
diagonal element. For an upper triangular matrix it contains the set of
elements from each column of the matrix starting with the first non-zero
2 Intel® Math Kernel Library Reference Manual
314
element down to and including the diagonal element. Encountered zero
elements are included in the sets. Refer to values array description in
Skyline Storage Format for more details.
pointers (input/output) INTEGER.
Array with dimension (m+1), where m is number of rows for lower triangle
(columns for upper triangle), pointers(I) - pointers(1)+1 gives the
index of element in the array asky that is first non-zero element in row
(column)I . The value of pointers(m +1) is set tonnz + pointers(1),
wherennz is the number of elements in the array asky. Refer to pointers
array description in Skyline Storage Format for more details
Output Parameters
info INTEGER. Integer info indicator only for converting the matrix A from the
CSR format.
If info=0, the execution is successful.
If info=1, the routine is interrupted because there is no space in the array
asky according to the value nzmax.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrsky(job, m, acsr, ja, ia, asky, pointers, info)
INTEGER job(8)
INTEGER m, info
INTEGER ja(*), ia(m+1), pointers(m+1)
REAL acsr(*), asky(*)
SUBROUTINE mkl_dcsrsky(job, m, acsr, ja, ia, asky, pointers, info)
INTEGER job(8)
INTEGER m, info
INTEGER ja(*), ia(m+1), pointers(m+1)
DOUBLE PRECISION acsr(*), asky(*)
SUBROUTINE mkl_ccsrsky(job, m, acsr, ja, ia, asky, pointers, info)
INTEGER job(8)
INTEGER m, info
INTEGER ja(*), ia(m+1), pointers(m+1)
COMPLEX acsr(*), asky(*)
SUBROUTINE mkl_zcsrsky(job, m, acsr, ja, ia, asky, pointers, info)
INTEGER job(8)
INTEGER m, info
INTEGER ja(*), ia(m+1), pointers(m+1)
DOUBLE COMPLEX acsr(*), asky(*)
BLAS and Sparse BLAS Routines 2
315
C:
void mkl_scsrsky(int *job, int *m, float *acsr, int *ja,
int *ia, float *asky, int *pointers, int *info);
void mkl_dcsrsky(int *job, int *m, double *acsr, int *ja,
int *ia, double *asky, int *pointers, int *info);
void mkl_ccsrsky(int *job, int *m, MKL_COMPLEX8 *acsr, int *ja,
int *ia, MKL_COMPLEX8 *asky, int *pointers, int *info);
void mkl_zcsrsky(int *job, int *m, MKL_COMPLEX16 *acsr, int *ja,
int *ia, MKL_COMPLEX16 *asky, int *pointers, int *info);
mkl_?csradd
Computes the sum of two matrices stored in the CSR
format (3-array variation) with one-based indexing.
Syntax
Fortran:
call mkl_scsradd(trans, request, sort, m, n, a, ja, ia, beta, b, jb, ib, c, jc, ic,
nzmax, info)
call mkl_dcsradd(trans, request, sort, m, n, a, ja, ia, beta, b, jb, ib, c, jc, ic,
nzmax, info)
call mkl_ccsradd(trans, request, sort, m, n, a, ja, ia, beta, b, jb, ib, c, jc, ic,
nzmax, info)
call mkl_zcsradd(trans, request, sort, m, n, a, ja, ia, beta, b, jb, ib, c, jc, ic,
nzmax, info)
C:
mkl_scsradd(&trans, &request, &sort, &m, &n, a, ja, ia, &beta, b, jb, ib, c, jc, ic,
&nzmax, &info);
mkl_dcsradd(&trans, &request, &sort, &m, &n, a, ja, ia, &beta, b, jb, ib, c, jc, ic,
&nzmax, &info);
mkl_ccsradd(&trans, &request, &sort, &m, &n, a, ja, ia, &beta, b, jb, ib, c, jc, ic,
&nzmax, &info);
mkl_zcsradd(&trans, &request, &sort, &m, &n, a, ja, ia, &beta, b, jb, ib, c, jc, ic,
&nzmax, &info);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?csradd routine performs a matrix-matrix operation defined as
C := A+beta*op(B)
where:
A, B, C are the sparse matrices in the CSR format (3-array variation).
2 Intel® Math Kernel Library Reference Manual
316
op(B) is one of op(B) = B, or op(B) = B', or op(A) = conjg(B')
beta is a scalar.
The routine works correctly if and only if the column indices in sparse matrix representations of matrices A
and B are arranged in the increasing order for each row. If not, use the parameter sort (see below) to
reorder column indices and the corresponding elements of the input matrices.
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
trans CHARACTER*1. Specifies the operation.
If trans = 'N' or 'n', then C := A+beta*B
If trans = 'T' or 't' or 'C' or 'c', then C := A+beta*B'.
request INTEGER.
If request=0, the routine performs addition, the memory for the output
arrays ic, jc, c must be allocated beforehand.
If request=1, the routine computes only values of the array ic of length m
+ 1, the memory for this array must be allocated beforehand. On exit the
value ic(m+1) - 1 is the actual number of the elements in the arrays c
and jc.
If request=2, the routine has been called previously with the parameter
request=1, the output arrays jc and c are allocated in the calling program
and they are of the length (m+1)-1 at least.
sort INTEGER. Specifies the type of reordering. If this parameter is not set
(default), the routine does not perform reordering.
If sort=1, the routine arranges the column indices ja for each row in the
increasing order and reorders the corresponding values of the matrix A in
the array a.
If sort=2, the routine arranges the column indices jb for each row in the
increasing order and reorders the corresponding values of the matrix B in
the array b.
If sort=3, the routine performs reordering for both input matrices A and B.
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix A.
a REAL for mkl_scsradd.
DOUBLE PRECISION for mkl_dcsradd.
COMPLEX for mkl_ccsradd.
DOUBLE COMPLEX for mkl_zcsradd.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ja INTEGER. Array containing the column indices for each non-zero element of
the matrix A. For each row the column indices must be arranged in the
increasing order.
The length of this array is equal to the length of the array a. Refer to
columns array description in Sparse Matrix Storage Formats for more
details.
BLAS and Sparse BLAS Routines 2
317
ia INTEGER. Array of length m + 1, containing indices of elements in the array
a, such that ia(I) is the index in the array a of the first non-zero element
from the row I. The value of the last element ia(m + 1) is equal to the
number of non-zero elements of the matrix B plus one. Refer to rowIndex
array description in Sparse Matrix Storage Formats for more details.
beta REAL for mkl_scsradd.
DOUBLE PRECISION for mkl_dcsradd.
COMPLEX for mkl_ccsradd.
DOUBLE COMPLEX for mkl_zcsradd.
Specifies the scalar beta.
b REAL for mkl_scsradd.
DOUBLE PRECISION for mkl_dcsradd.
COMPLEX for mkl_ccsradd.
DOUBLE COMPLEX for mkl_zcsradd.
Array containing non-zero elements of the matrix B. Its length is equal to
the number of non-zero elements in the matrix B. Refer to values array
description in Sparse Matrix Storage Formats for more details.
jb INTEGER. Array containing the column indices for each non-zero element of
the matrix B. For each row the column indices must be arranged in the
increasing order.
The length of this array is equal to the length of the array b. Refer to
columns array description in Sparse Matrix Storage Formats for more
details.
ib INTEGER. Array of length m + 1 when trans = 'N' or 'n', or n + 1
otherwise.
This array contains indices of elements in the array b, such that ib(I) is
the index in the array b of the first non-zero element from the row I. The
value of the last element ib(m + 1) or ib(n + 1) is equal to the number
of non-zero elements of the matrix B plus one. Refer to rowIndex array
description in Sparse Matrix Storage Formats for more details.
nzmax INTEGER. The length of the arrays c and jc.
This parameter is used only if request=0. The routine stops calculation if
the number of elements in the result matrix C exceeds the specified value of
nzmax.
Output Parameters
c REAL for mkl_scsradd.
DOUBLE PRECISION for mkl_dcsradd.
COMPLEX for mkl_ccsradd.
DOUBLE COMPLEX for mkl_zcsradd.
Array containing non-zero elements of the result matrix C. Its length is
equal to the number of non-zero elements in the matrix C. Refer to values
array description in Sparse Matrix Storage Formats for more details.
jc INTEGER. Array containing the column indices for each non-zero element of
the matrix C.
The length of this array is equal to the length of the array c. Refer to
columns array description in Sparse Matrix Storage Formats for more
details.
2 Intel® Math Kernel Library Reference Manual
318
ic INTEGER. Array of length m + 1, containing indices of elements in the array
c, such that ic(I) is the index in the array c of the first non-zero element
from the row I. The value of the last element ic(m + 1) is equal to the
number of non-zero elements of the matrix C plus one. Refer to rowIndex
array description in Sparse Matrix Storage Formats for more details.
info INTEGER.
If info=0, the execution is successful.
If info=I>0, the routine stops calculation in the I-th row of the matrix C
because number of elements in C exceeds nzmax.
If info=-1, the routine calculates only the size of the arrays c and jc and
returns this value plus 1 as the last element of the array ic.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsradd( trans, request, sort, m, n, a, ja, ia, beta, b, jb, ib, c, jc, ic, nzmax,
info)
CHARACTER trans
INTEGER request, sort, m, n, nzmax, info
INTEGER ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
REAL a(*), b(*), c(*), beta
SUBROUTINE mkl_dcsradd( trans, request, sort, m, n, a, ja, ia, beta, b, jb, ib, c, jc, ic, nzmax,
info)
CHARACTER trans
INTEGER request, sort, m, n, nzmax, info
INTEGER ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
DOUBLE PRECISION a(*), b(*), c(*), beta
SUBROUTINE mkl_ccsradd( trans, request, sort, m, n, a, ja, ia, beta, b, jb, ib, c, jc, ic, nzmax,
info)
CHARACTER trans
INTEGER request, sort, m, n, nzmax, info
INTEGER ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
COMPLEX a(*), b(*), c(*), beta
SUBROUTINE mkl_zcsradd( trans, request, sort, m, n, a, ja, ia, beta, b, jb, ib, c, jc, ic, nzmax,
info)
CHARACTER trans
INTEGER request, sort, m, n, nzmax, info
INTEGER ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
DOUBLE COMPLEX a(*), b(*), c(*), beta
C:
void mkl_scsradd(char *trans, int *request, int *sort, int *m, int *n, float *a, int *ja, int *ia,
float *beta, float *b, int *jb, int *ib, float *c,
int *jc, int *ic, int *nzmax, int *info);
void mkl_dcsradd(char *trans, int *request, int *sort, int *m, int *n,
double *a, int *ja, int *ia, double *beta, double *b, int *jb, int *ib, double *c,
int *jc, int *ic, int *nzmax, int *info);
BLAS and Sparse BLAS Routines 2
319
void mkl_ccsradd(char *trans, int *request, int *sort, int *m, int *n,
MKL_Complex8 *a, int *ja, int *ia, MKL_Complex8 *beta, MKL_Complex8 *b,
int *jb, int *ib, MKL_Complex8 *c, int *jc, int *ic, int *nzmax, int *info);
void mkl_zcsradd(char *trans, int *request, int *sort, int *m, int *n,
MKL_Complex16 *a, int *ja, int *ia, MKL_Complex16 *beta, MKL_Complex16 *b,
int *jb, int *ib, MKL_Complex16 *c, int *jc, int *ic, int *nzmax, int *info);
mkl_?csrmultcsr
Computes product of two sparse matrices stored in
the CSR format (3-array variation) with one-based
indexing.
Syntax
Fortran:
call mkl_scsrmultcsr(trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic,
nzmax, info)
call mkl_dcsrmultcsr(trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic,
nzmax, info)
call mkl_ccsrmultcsr(trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic,
nzmax, info)
call mkl_zcsrmultcsr(trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic,
nzmax, info)
C:
mkl_scsrmultcsr(&trans, &request, &sort, &m, &n, &k, a, ja, ia, b, jb, ib, c, jc, ic,
&nzmax, &info);
mkl_dcsrmultcsr(&trans, &request, &sort, &m, &n, &k, a, ja, ia, b, jb, ib, c, jc, ic,
&nzmax, &info);
mkl_ccsrmultcsr(&trans, &request, &sort, &m, &n, &k, a, ja, ia, b, jb, ib, c, jc, ic,
&nzmax, &info);
mkl_zcsrmultcsr(&trans, &request, &sort, &m, &n, &k, a, ja, ia, b, jb, ib, c, jc, ic,
&nzmax, &info);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?csrmultcsr routine performs a matrix-matrix operation defined as
C := op(A)*B
where:
A, B, C are the sparse matrices in the CSR format (3-array variation);
op(A) is one of op(A) = A, or op(A) =A', or op(A) = conjg(A') .
You can use the parameter sort to perform or not perform reordering of non-zero entries in input and
output sparse matrices. The purpose of reordering is to rearrange non-zero entries in compressed sparse row
matrix so that column indices in compressed sparse representation are sorted in the increasing order for
each row.
2 Intel® Math Kernel Library Reference Manual
320
The following table shows correspondence between the value of the parameter sort and the type of
reordering performed by this routine for each sparse matrix involved:
Value of the parameter
sort
Reordering of A (arrays
a, ja, ia)
Reordering of B (arrays
b, ja, ib)
Reordering of C (arrays
c, jc, ic)
1 yes no yes
2 no yes yes
3 yes yes yes
4 yes no no
5 no yes no
6 yes yes no
7 no no no
arbitrary value not equal to
1, 2,..., 7
no no yes
NOTE This routine supports only one-based indexing of the input arrays.
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
trans CHARACTER*1. Specifies the operation.
If trans = 'N' or 'n', then C := A*B
If trans = 'T' or 't' or 'C' or 'c', then C := A'*B.
request INTEGER.
If request=0, the routine performs multiplication, the memory for the
output arrays ic, jc, c must be allocated beforehand.
If request=1, the routine computes only values of the array ic of length m
+ 1, the memory for this array must be allocated beforehand. On exit the
value ic(m+1) - 1 is the actual number of the elements in the arrays c
and jc.
If request=2, the routine has been called previously with the parameter
request=1, the output arrays jc and c are allocated in the calling program
and they are of the length ic(m+1) - 1 at least.
sort INTEGER. Specifies whether the routine performs reordering of non-zeros
entries in input and/or output sparse matrices (see table above).
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix A.
k INTEGER. Number of columns of the matrix B.
a REAL for mkl_scsrmultcsr.
DOUBLE PRECISION for mkl_dcsrmultcsr.
COMPLEX for mkl_ccsrmultcsr.
DOUBLE COMPLEX for mkl_zcsrmultcsr.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ja INTEGER. Array containing the column indices for each non-zero element of
the matrix A. For each row the column indices must be arranged in the
increasing order.
BLAS and Sparse BLAS Routines 2
321
The length of this array is equal to the length of the array a. Refer to
columns array description in Sparse Matrix Storage Formats for more
details.
ia INTEGER. Array of length m + 1.
This array contains indices of elements in the array a, such that ia(I) is
the index in the array a of the first non-zero element from the row I. The
value of the last element ia(m + 1) is equal to the number of non-zero
elements of the matrix A plus one. Refer to rowIndex array description in
Sparse Matrix Storage Formats for more details.
b REAL for mkl_scsrmultcsr.
DOUBLE PRECISION for mkl_dcsrmultcsr.
COMPLEX for mkl_ccsrmultcsr.
DOUBLE COMPLEX for mkl_zcsrmultcsr.
Array containing non-zero elements of the matrix B. Its length is equal to
the number of non-zero elements in the matrix B. Refer to values array
description in Sparse Matrix Storage Formats for more details.
jb INTEGER. Array containing the column indices for each non-zero element of
the matrix B. For each row the column indices must be arranged in the
increasing order.
The length of this array is equal to the length of the array b. Refer to
columns array description in Sparse Matrix Storage Formats for more
details.
ib INTEGER. Array of length n + 1 when trans = 'N' or 'n', or m + 1
otherwise.
This array contains indices of elements in the array b, such that ib(I) is
the index in the array b of the first non-zero element from the row I. The
value of the last element ib(n + 1) or ib(m + 1) is equal to the number
of non-zero elements of the matrix B plus one. Refer to rowIndex array
description in Sparse Matrix Storage Formats for more details.
nzmax INTEGER. The length of the arrays c and jc.
This parameter is used only if request=0. The routine stops calculation if
the number of elements in the result matrix C exceeds the specified value of
nzmax.
Output Parameters
c REAL for mkl_scsrmultcsr.
DOUBLE PRECISION for mkl_dcsrmultcsr.
COMPLEX for mkl_ccsrmultcsr.
DOUBLE COMPLEX for mkl_zcsrmultcsr.
Array containing non-zero elements of the result matrix C. Its length is
equal to the number of non-zero elements in the matrix C. Refer to values
array description in Sparse Matrix Storage Formats for more details.
jc INTEGER. Array containing the column indices for each non-zero element of
the matrix C.
The length of this array is equal to the length of the array c. Refer to
columns array description in Sparse Matrix Storage Formats for more
details.
ic INTEGER. Array of length m + 1 when trans = 'N' or 'n', or n + 1
otherwise.
2 Intel® Math Kernel Library Reference Manual
322
This array contains indices of elements in the array c, such that ic(I) is
the index in the array c of the first non-zero element from the row I. The
value of the last element ic(m + 1) or ic(n + 1) is equal to the number
of non-zero elements of the matrix C plus one. Refer to rowIndex array
description in Sparse Matrix Storage Formats for more details.
info INTEGER.
If info=0, the execution is successful.
If info=I>0, the routine stops calculation in the I-th row of the matrix C
because number of elements in C exceeds nzmax.
If info=-1, the routine calculates only the size of the arrays c and jc and
returns this value plus 1 as the last element of the array ic.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrmultcsr( trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax,
info)
CHARACTER*1 trans
INTEGER request, sort, m, n, k, nzmax, info
INTEGER ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
REAL a(*), b(*), c(*)
SUBROUTINE mkl_dcsrmultcsr( trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax,
info)
CHARACTER*1 trans
INTEGER request, sort, m, n, k, nzmax, info
INTEGER ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
DOUBLE PRECISION a(*), b(*), c(*)
SUBROUTINE mkl_ccsrmultcsr( trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax,
info)
CHARACTER*1 trans
INTEGER request, sort, m, n, k, nzmax, info
INTEGER ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
COMPLEX a(*), b(*), c(*)
SUBROUTINE mkl_zcsrmultcsr( trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax,
info)
CHARACTER*1 trans
INTEGER request, sort, m, n, k, nzmax, info
INTEGER ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
DOUBLE COMPLEX a(*), b(*), c(*)
C:
void mkl_scsrmultcsr(char *trans, int *request, int *sort, int *m, int *n, int *k,
float *a, int *ja, int *ia, float *b, int *jb, int *ib, float *c,
int *jc, int *ic, int *nzmax, int *info);
BLAS and Sparse BLAS Routines 2
323
void mkl_dcsrmultcsr(char *trans, int *request, int *sort, int *m, int *n, int *k,
double *a, int *ja, int *ia, double *b, int *jb, int *ib, double *c,
int *jc, int *ic, int *nzmax, int *info);
void mkl_ccsrmultcsr(char *trans, int *request, int *sort, int *m, int *n, int *k,
MKL_Complex8 *a, int *ja, int *ia, MKL_Complex8 *b, int *jb, int *ib,
MKL_Complex8 *c, int *jc, int *ic, int *nzmax, int *info);
void mkl_zcsrmultcsr(char *trans, int *request, int *sort, int *m, int *n, int *k,
MKL_Complex16 *a, int *ja, int *ia, MKL_Complex16 *b, int *jb, int *ib,
MKL_Complex16 *c, int *jc, int *ic, int *nzmax, int *info);
mkl_?csrmultd
Computes product of two sparse matrices stored in
the CSR format (3-array variation) with one-based
indexing. The result is stored in the dense matrix.
Syntax
Fortran:
call mkl_scsrmultd(trans, m, n, k, a, ja, ia, b, jb, ib, c, ldc)
call mkl_dcsrmultd(trans, m, n, k, a, ja, ia, b, jb, ib, c, ldc)
call mkl_ccsrmultd(trans, m, n, k, a, ja, ia, b, jb, ib, c, ldc)
call mkl_zcsrmultd(trans, m, n, k, a, ja, ia, b, jb, ib, c, ldc)
C:
mkl_scsrmultd(&trans, &m, &n, &k, a, ja, ia, b, jb, ib, c, &ldc);
mkl_dcsrmultd(&trans, &m, &n, &k, a, ja, ia, b, jb, ib, c, &ldc);
mkl_ccsrmultd(&trans, &m, &n, &k, a, ja, ia, b, jb, ib, c, &ldc);
mkl_zcsrmultd(&trans, &m, &n, &k, a, ja, ia, b, jb, ib, c, &ldc);
Include Files
• FORTRAN 77: mkl_spblas.fi
• C: mkl_spblas.h
Description
The mkl_?csrmultd routine performs a matrix-matrix operation defined as
C := op(A)*B
where:
A, B are the sparse matrices in the CSR format (3-array variation), C is dense matrix;
op(A) is one of op(A) = A, or op(A) =A', or op(A) = conjg(A') .
The routine works correctly if and only if the column indices in sparse matrix representations of matrices A
and B are arranged in the increasing order for each row. If not, use the parameter sort (see below) to
reorder column indices and the corresponding elements of the input matrices.
NOTE This routine supports only one-based indexing of the input arrays.
2 Intel® Math Kernel Library Reference Manual
324
Input Parameters
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer
here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the
section "Interfaces" below.
trans CHARACTER*1. Specifies the operation.
If trans = 'N' or 'n', then C := A*B
If trans = 'T' or 't' or 'C' or 'c', then C := A'*B.
m INTEGER. Number of rows of the matrix A.
n INTEGER. Number of columns of the matrix A.
k INTEGER. Number of columns of the matrix B.
a REAL for mkl_scsrmultd.
DOUBLE PRECISION for mkl_dcsrmultd.
COMPLEX for mkl_ccsrmultd.
DOUBLE COMPLEX for mkl_zcsrmultd.
Array containing non-zero elements of the matrix A. Its length is equal to
the number of non-zero elements in the matrix A. Refer to values array
description in Sparse Matrix Storage Formats for more details.
ja INTEGER. Array containing the column indices for each non-zero element of
the matrix A. For each row the column indices must be arranged in the
increasing order.
The length of this array is equal to the length of the array a. Refer to
columns array description in Sparse Matrix Storage Formats for more
details.
ia INTEGER. Array of length m + 1 when trans = 'N' or 'n', or n + 1
otherwise.
This array contains indices of elements in the array a, such that ia(I) is
the index in the array a of the first non-zero element from the row I. The
value of the last element ia(m + 1) or ia(n + 1) is equal to the number
of non-zero elements of the matrix A plus one. Refer to rowIndex array
description in Sparse Matrix Storage Formats for more details.
b REAL for mkl_scsrmultd.
DOUBLE PRECISION for mkl_dcsrmultd.
COMPLEX for mkl_ccsrmultd.
DOUBLE COMPLEX for mkl_zcsrmultd.
Array containing non-zero elements of the matrix B. Its length is equal to
the number of non-zero elements in the matrix B. Refer to values array
description in Sparse Matrix Storage Formats for more details.
jb INTEGER. Array containing the column indices for each non-zero element of
the matrix B. For each row the column indices must be arranged in the
increasing order.
The length of this array is equal to the length of the array b. Refer to
columns array description in Sparse Matrix Storage Formats for more
details.
ib INTEGER. Array of length m + 1.
This array contains indices of elements in the array b, such that ib(I) is
the index in the array b of the first non-zero element from the row I. The
value of the last element ib(m + 1) is equal to the number of non-zero
elements of the matrix B plus one. Refer to rowIndex array description in
Sparse Matrix Storage Formats for more details.
BLAS and Sparse BLAS Routines 2
325
Output Parameters
c REAL for mkl_scsrmultd.
DOUBLE PRECISION for mkl_dcsrmultd.
COMPLEX for mkl_ccsrmultd.
DOUBLE COMPLEX for mkl_zcsrmultd.
Array containing non-zero elements of the result matrix C.
ldc INTEGER. Specifies the leading dimension of the dense matrix C as declared
in the calling (sub)program. Must be at least max(m, 1) when trans =
'N' or 'n', or max(1, n) otherwise.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_scsrmultd( trans, m, n, k, a, ja, ia, b, jb, ib, c, ldc)
CHARACTER*1 trans
INTEGER m, n, k, ldc
INTEGER ja(*), jb(*), ia(*), ib(*)
REAL a(*), b(*), c(ldc, *)
SUBROUTINE mkl_dcsrmultd( trans, m, n, k, a, ja, ia, b, jb, ib, c, ldc)
CHARACTER*1 trans
INTEGER m, n, k, ldc
INTEGER ja(*), jb(*), ia(*), ib(*)
DOUBLE PRECISION a(*), b(*), c(ldc, *)
SUBROUTINE mkl_ccsrmultd( trans, m, n, k, a, ja, ia, b, jb, ib, c, ldc)
CHARACTER*1 trans
INTEGER m, n, k, ldc
INTEGER ja(*), jb(*), ia(*), ib(*)
COMPLEX a(*), b(*), c(ldc, *)
SUBROUTINE mkl_zcsrmultd( trans, m, n, k, a, ja, ia, b, jb, ib, c, ldc)
CHARACTER*1 trans
INTEGER m, n, k, ldc
INTEGER ja(*), jb(*), ia(*), ib(*)
DOUBLE COMPLEX a(*), b(*), c(ldc, *)
C:
void mkl_scsrmultd(char *trans, int *m, int *n, int *k,
float *a, int *ja, int *ia, float *b, int *jb, int *ib, float *c, int *ldc);
void mkl_dcsrmultd(char *trans, int *m, int *n, int *k,
double *a, int *ja, int *ia, double *b, int *jb, int *ib, double *c, int *ldc);
void mkl_ccsrmultd(char *trans, int *m, int *n, int *k,
MKL_Complex8 *a, int *ja, int *ia, MKL_Complex8 *b, int *jb, int *ib,
MKL_Complex8 *c, int *ldc);
2 Intel® Math Kernel Library Reference Manual
326
void mkl_zcsrmultd(char *trans, int *m, int *n, int *k,
MKL_Complex16 *a, int *ja, int *ia, MKL_Complex16 *b, int *jb, int *ib,
MKL_Complex16 *c, int *ldc);
BLAS-like Extensions
Intel MKL provides C and Fortran routines to extend the functionality of the BLAS routines. These include
routines to compute vector products, matrix-vector products, and matrix-matrix products.
Intel MKL also provides routines to perform certain data manipulation, including matrix in-place and out-ofplace
transposition operations combined with simple matrix arithmetic operations. Transposition operations
are Copy As Is, Conjugate transpose, Transpose, and Conjugate. Each routine adds the possibility of scaling
during the transposition operation by giving some alpha and/or beta parameters. Each routine supports
both row-major orderings and column-major orderings.
Table “BLAS-like Extensions” lists these routines.
The symbol in the routine short names is a precision prefix that indicates the data type:
s REAL for Fortran interface, or float for C interface
d DOUBLE PRECISION for Fortran interface, or double for C interface.
c COMPLEX for Fortran interface, or MKL_Complex8 for C interface.
z DOUBLE COMPLEX for Fortran interface, or MKL_Complex16 for C interface.
BLAS-like Extensions
Routine Data Types Description
axpby s, d, c, z Scales two vectors, adds them to one another and stores
result in the vector (routines)
gem2vu s, d Two matrix-vector products using a general matrix, real
data
gem2vc c, z Two matrix-vector products using a general matrix,
complex data
?gemm3m c, z Computes a scalar-matrix-matrix product using matrix
multiplications and adds the result to a scalar-matrix
product.
mkl_?imatcopy s, d, c, z Performs scaling and in-place transposition/copying of
matrices.
mkl_?omatcopy s, d, c, z Performs scaling and out-of-place transposition/copying of
matrices.
mkl_?omatcopy2 s, d, c, z Performs two-strided scaling and out-of-place
transposition/copying of matrices.
mkl_?omatadd s, d, c, z Performs scaling and sum of two matrices including their
out-of-place transposition/copying.
?axpby
Scales two vectors, adds them to one another and
stores result in the vector.
Syntax
Fortran 77:
call saxpby(n, a, x, incx, b, y, incy)
BLAS and Sparse BLAS Routines 2
327
call daxpby(n, a, x, incx, b, y, incy)
call caxpby(n, a, x, incx, b, y, incy)
call zaxpby(n, a, x, incx, b, y, incy)
Fortran 95:
call axpby(x, y [,a] [,b])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?axpby routines perform a vector-vector operation defined as
y := a*x + b*y
where:
a and b are scalars
x and y are vectors each with n elements.
Input Parameters
n INTEGER. Specifies the number of elements in vectors x and y.
a REAL for saxpby
DOUBLE PRECISION for daxpby
COMPLEX for caxpby
DOUBLE COMPLEX for zaxpby
Specifies the scalar a.
x REAL for saxpby
DOUBLE PRECISION for daxpby
COMPLEX for caxpby
DOUBLE COMPLEX for zaxpby
Array, DIMENSION at least (1 + (n-1)*abs(incx)).
incx INTEGER. Specifies the increment for the elements of x.
b REAL for saxpby
DOUBLE PRECISION for daxpby
COMPLEX for caxpby
DOUBLE COMPLEX for zaxpby
Specifies the scalar b.
y REAL for saxpby
DOUBLE PRECISION for daxpby
COMPLEX for caxpby
DOUBLE COMPLEX for zaxpby
Array, DIMENSION at least (1 + (n-1)*abs(incy)).
incy INTEGER. Specifies the increment for the elements of y.
Output Parameters
y Contains the updated vector y.
2 Intel® Math Kernel Library Reference Manual
328
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine axpby interface are the following:
x Holds the array of size n.
y Holds the array of size n.
a The default value is 1.
b The default value is 1.
?gem2vu
Computes two matrix-vector products using a general
matrix (real data)
Syntax
Fortran 77:
call sgem2vu(m, n, alpha, a, lda, x1, incx1, x2, incx2, beta, y1, incy1, y2, incy2)
call dgem2vu(m, n, alpha, a, lda, x1, incx1, x2, incx2, beta, y1, incy1, y2, incy2)
Fortran 95:
call gem2vu(a, x1, x2, y1, y2 [,alpha][,beta] )
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?gem2vu routines perform two matrix-vector operations defined as
y1 := alpha*A*x1 + beta*y1,
and
y2 := alpha*A'*x2 + beta*y2,
where:
alpha and beta are scalars,
x1, x2, y1, and y2 are vectors,
A is an m-by-n matrix.
Input Parameters
m INTEGER. Specifies the number of rows of the matrix A. The value of m must
be at least zero.
n INTEGER. Specifies the number of columns of the matrix A. The value of n
must be at least zero.
alpha REAL for sgem2vu
DOUBLE PRECISION for dgem2vu
BLAS and Sparse BLAS Routines 2
329
Specifies the scalar alpha.
a REAL for sgem2vu
DOUBLE PRECISION for dgem2vu
Array, DIMENSION (lda, n). Before entry, the leading m-by-n part of the
array a must contain the matrix of coefficients.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, m).
x1 REAL for sgem2vu
DOUBLE PRECISION for dgem2vu
Array, DIMENSION at least (1+(n-1)*abs(incx1)). Before entry, the
incremented array x1 must contain the vector x1.
incx1 INTEGER. Specifies the increment for the elements of x1.
The value of incx1 must not be zero.
x2 REAL for sgem2vu
DOUBLE PRECISION for dgem2vu
Array, DIMENSION at least (1+(m-1)*abs(incx2)). Before entry, the
incremented array x2 must contain the vector x2.
incx2 INTEGER. Specifies the increment for the elements of x2.
The value of incx2 must not be zero.
beta REAL for sgem2vu
DOUBLE PRECISION for dgem2vu
Specifies the scalar beta. When beta is set to zero, then y1 and y2 need
not be set on input.
y1 REAL for sgem2vu
DOUBLE PRECISION for dgem2vu
Array, DIMENSION at least (1+(m-1)*abs(incy1)). Before entry with nonzero
beta, the incremented array y1 must contain the vector y1.
incy1 INTEGER. Specifies the increment for the elements of y1.
The value of incy1 must not be zero.
y REAL for sgem2vu
DOUBLE PRECISION for dgem2vu
Array, DIMENSION at least (1+(n-1)*abs(incy2)). Before entry with nonzero
beta, the incremented array y2 must contain the vector y2.
incy2 INTEGER. Specifies the increment for the elements of y2.
The value of incy2 must not be zero.
Output Parameters
y1 Updated vector y1.
y2 Updated vector y2.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gem2vu interface are the following:
a Holds the matrix A of size (m,n).
x1 Holds the vector with the number of elements rx1 where rx1 = n.
x2 Holds the vector with the number of elements rx2 where rx2 = m.
2 Intel® Math Kernel Library Reference Manual
330
y1 Holds the vector with the number of elements ry1 where ry1 = m.
y2 Holds the vector with the number of elements ry2 where ry2 = n.
alpha The default value is 1.
beta The default value is 0.
?gem2vc
Computes two matrix-vector products using a general
matrix (complex data)
Syntax
Fortran 77:
call cgem2vc(m, n, alpha, a, lda, x1, incx1, x2, incx2, beta, y1, incy1, y2, incy2)
call zgem2vc(m, n, alpha, a, lda, x1, incx1, x2, incx2, beta, y1, incy1, y2, incy2)
Fortran 95:
call gem2vc(a, x1, x2, y1, y2 [,alpha][,beta] )
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?gem2vc routines perform two matrix-vector operations defined as
y1 := alpha*A*x1 + beta*y1,
and
y2 := alpha*conjg(A')*x2 + beta*y2,
where:
alpha and beta are scalars,
x1, x2, y1, and y2 are vectors,
A is an m-by-n matrix.
Input Parameters
m INTEGER. Specifies the number of rows of the matrix A. The value of m must
be at least zero.
n INTEGER. Specifies the number of columns of the matrix A. The value of n
must be at least zero.
alpha COMPLEX for cgem2vc
DOUBLE COMPLEX for zgem2vc
Specifies the scalar alpha.
a COMPLEX for cgem2vc
DOUBLE COMPLEX for zgem2vc
Array, DIMENSION (lda, n). Before entry, the leading m-by-n part of the
array a must contain the matrix of coefficients.
BLAS and Sparse BLAS Routines 2
331
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. The value of lda must be at least max(1, m).
x1 COMPLEX for cgem2vc
DOUBLE COMPLEX for zgem2vc
Array, DIMENSION at least (1+(n-1)*abs(incx1)). Before entry, the
incremented array x1 must contain the vector x1.
incx1 INTEGER. Specifies the increment for the elements of x1.
The value of incx1 must not be zero.
x2 COMPLEX for cgem2vc
DOUBLE COMPLEX for zgem2vc
Array, DIMENSION at least (1+(m-1)*abs(incx2)). Before entry, the
incremented array x2 must contain the vector x2.
incx2 INTEGER. Specifies the increment for the elements of x2.
The value of incx2 must not be zero.
beta COMPLEX for cgem2vc
DOUBLE COMPLEX for zgem2vc
Specifies the scalar beta. When beta is set to zero, then y1 and y2 need
not be set on input.
y1 COMPLEX for cgem2vc
DOUBLE COMPLEX for zgem2vc
Array, DIMENSION at least (1+(m-1)*abs(incy1)). Before entry with nonzero
beta, the incremented array y1 must contain the vector y1.
incy1 INTEGER. Specifies the increment for the elements of y1.
The value of incy1 must not be zero.
y2 COMPLEX for cgem2vc
DOUBLE COMPLEX for zgem2vc
Array, DIMENSION at least (1+(n-1)*abs(incy2)). Before entry with nonzero
beta, the incremented array y2 must contain the vector y2.
incy2 INTEGER. Specifies the increment for the elements of y2.
The value of incy must not be zero.
INTEGER. Specifies the increment for the elements of y.
Output Parameters
y1 Updated vector y1.
y2 Updated vector y2.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gem2vc interface are the following:
a Holds the matrix A of size (m,n).
x1 Holds the vector with the number of elements rx1 where rx1 = n.
x2 Holds the vector with the number of elements rx2 where rx2 = m.
y1 Holds the vector with the number of elements ry1 where ry1 = m.
y2 Holds the vector with the number of elements ry2 where ry2 = n.
alpha The default value is 1.
2 Intel® Math Kernel Library Reference Manual
332
beta The default value is 0.
?gemm3m
Computes a scalar-matrix-matrix product using matrix
multiplications and adds the result to a scalar-matrix
product.
Syntax
Fortran 77:
call cgemm3m(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
call zgemm3m(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
Fortran 95:
call gemm3m(a, b, c [,transa][,transb] [,alpha][,beta])
Include Files
• FORTRAN 77: mkl_blas.fi
• Fortran 95: blas.f90
• C: mkl_blas.h
Description
The ?gemm3m routines perform a matrix-matrix operation with general complex matrices. These routines are
similar to the ?gemm routines, but they use matrix multiplications(see Application Notes below).
The operation is defined as
C := alpha*op(A)*op(B) + beta*C,
where:
op(x) is one of op(x) = x, or op(x) = x', or op(x) = conjg(x'),
alpha and beta are scalars,
A, B and C are matrices:
op(A) is an m-by-k matrix,
op(B) is a k-by-n matrix,
C is an m-by-n matrix.
Input Parameters
transa CHARACTER*1. Specifies the form of op(A) used in the matrix
multiplication:
if transa = 'N' or 'n', then op(A) = A;
if transa = 'T' or 't', then op(A) = A';
if transa = 'C' or 'c', then op(A) = conjg(A').
transb CHARACTER*1. Specifies the form of op(B) used in the matrix
multiplication:
if transb = 'N' or 'n', then op(B) = B;
if transb = 'T' or 't', then op(B) = B';
if transb = 'C' or 'c', then op(B) = conjg(B').
BLAS and Sparse BLAS Routines 2
333
m INTEGER. Specifies the number of rows of the matrix op(A) and of the
matrix C. The value of m must be at least zero.
n INTEGER. Specifies the number of columns of the matrix op(B) and the
number of columns of the matrix C.
The value of n must be at least zero.
k INTEGER. Specifies the number of columns of the matrix op(A) and the
number of rows of the matrix op(B).
The value of k must be at least zero.
alpha COMPLEX for cgemm3m
DOUBLE COMPLEX for zgemm3m
Specifies the scalar alpha.
a COMPLEX for cgemm3m
DOUBLE COMPLEX for zgemm3m
Array, DIMENSION (lda, ka), where ka is k when transa= 'N' or 'n',
and is m otherwise. Before entry with transa= 'N' or 'n', the leading mby-
k part of the array a must contain the matrix A, otherwise the leading kby-
m part of the array a must contain the matrix A.
lda INTEGER. Specifies the leading dimension of a as declared in the calling
(sub)program. When transa= 'N' or 'n', then lda must be at least
max(1, m), otherwise lda must be at least max(1, k).
b COMPLEX for cgemm3m
DOUBLE COMPLEX for zgemm3m
Array, DIMENSION (ldb, kb), where kb is n when transb = 'N' or 'n',
and is k otherwise. Before entry with transb = 'N' or 'n', the leading kby-
n part of the array b must contain the matrix B, otherwise the leading nby-
k part of the array b must contain the matrix B.
ldb INTEGER. Specifies the leading dimension of b as declared in the calling
(sub)program. When transb = 'N' or 'n', then ldb must be at least
max(1, k), otherwise ldb must be at least max(1, n).
beta COMPLEX for cgemm3m
DOUBLE COMPLEX for zgemm3m
Specifies the scalar beta.
When beta is equal to zero, then c need not be set on input.
c COMPLEX for cgemm3m
DOUBLE COMPLEX for zgemm3m
Array, DIMENSION (ldc, n).
Before entry, the leading m-by-n part of the array c must contain the matrix
C, except when beta is equal to zero, in which case c need not be set on
entry.
ldc INTEGER. Specifies the leading dimension of c as declared in the calling
(sub)program. The value of ldc must be at least max(1, m).
Output Parameters
c Overwritten by the m-by-n matrix (alpha*op(A)*op(B) + beta*C).
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
2 Intel® Math Kernel Library Reference Manual
334
Specific details for the routine gemm3m interface are the following:
a Holds the matrix A of size (ma,ka) where
ka = k if transa= 'N',
ka = m otherwise,
ma = m if transa= 'N',
ma = k otherwise.
b Holds the matrix B of size (mb,kb) where
kb = n if transb = 'N',
kb = k otherwise,
mb = k if transb = 'N',
mb = n otherwise.
c Holds the matrix C of size (m,n).
transa Must be 'N', 'C', or 'T'.
The default value is 'N'.
transb Must be 'N', 'C', or 'T'.
The default value is 'N'.
alpha The default value is 1.
beta The default value is 1.
Application Notes
These routines perform the complex multiplication by forming the real and imaginary parts of the input
matrices. It allows to use three real matrix multiplications and five real matrix additions, instead of the
conventional four real matrix multiplications and two real matrix additions. The use of three real matrix
multiplications only gives a 25% reduction of time in matrix operations. This can result in significant savings
in computing time for large matrices.
If the errors in the floating point calculations satisfy the following conditions:
fl(x op y)=(x op y)(1+d),|d|=u, op=×,/, fl(x±y)=x(1+a)±y(1+ß), |a|,|ß|=u
then for n-by-n matrix C=fl(C1+iC2)= fl((A1+iA2)(B1+iB2))=C1+iC2 the following estimations are
correct
¦C1-C2¦= 2(n+1)u¦A¦8¦B¦8+O(u2),
¦C2-C1¦= 4(n+4)u¦A¦8¦B¦8+O(u2),
where ¦A¦8=max(¦A1¦8,¦A2¦8), and ¦B¦8=max(¦B1¦8,¦B2¦8).
and hence the matrix multiplications are stable.
mkl_?imatcopy
Performs scaling and in-place transposition/copying of
matrices.
Syntax
Fortran:
call mkl_simatcopy(ordering, trans, rows, cols, alpha, a, src_lda, dst_lda)
call mkl_dimatcopy(ordering, trans, rows, cols, alpha, a, src_lda, dst_lda)
call mkl_cimatcopy(ordering, trans, rows, cols, alpha, a, src_lda, dst_lda)
call mkl_zimatcopy(ordering, trans, rows, cols, alpha, a, src_lda, dst_lda)
BLAS and Sparse BLAS Routines 2
335
C:
mkl_simatcopy(ordering, trans, rows, cols, alpha, a, src_lda, dst_lda);
mkl_dimatcopy(ordering, trans, rows, cols, alpha, a, src_lda, dst_lda);
mkl_cimatcopy(ordering, trans, rows, cols, alpha, a, src_lda, dst_lda);
mkl_zimatcopy(ordering, trans, rows, cols, alpha, a, src_lda, dst_lda);
Include Files
• FORTRAN 77: mkl_trans.fi
• C: mkl_trans.h
Description
The mkl_?imatcopy routine performs scaling and in-place transposition/copying of matrices. A transposition
operation can be a normal matrix copy, a transposition, a conjugate transposition, or just a conjugation. The
operation is defined as follows:
A := alpha*op(A).
The routine parameter descriptions are common for all implemented interfaces with the exception of data
types that refer here to the FORTRAN 77 standard types. Data types specific to the different interfaces are
described in the section "Interfaces" below.
Note that different arrays should not overlap.
Input Parameters
ordering CHARACTER*1. Ordering of the matrix storage.
If ordering = 'R' or 'r', the ordering is row-major.
If ordering = 'C' or 'c', the ordering is column-major.
trans CHARACTER*1. Parameter that specifies the operation type.
If trans = 'N' or 'n', op(A)=A and the matrix A is assumed unchanged
on input.
If trans = 'T' or 't', it is assumed that A should be transposed.
If trans = 'C' or 'c', it is assumed that A should be conjugate
transposed.
If trans = 'R' or 'r', it is assumed that A should be only conjugated.
If the data is real, then trans = 'R' is the same as trans = 'N', and
trans = 'C' is the same as trans = 'T'.
rows INTEGER. The number of matrix rows.
cols INTEGER. The number of matrix columns.
a REAL for mkl_simatcopy.
DOUBLE PRECISION for mkl_dimatcopy.
COMPLEX for mkl_cimatcopy.
DOUBLE COMPLEX for mkl_zimatcopy.
Array, DIMENSION a(scr_lda,*).
alpha REAL for mkl_simatcopy.
DOUBLE PRECISION for mkl_dimatcopy.
COMPLEX for mkl_cimatcopy.
DOUBLE COMPLEX for mkl_zimatcopy.
This parameter scales the input matrix by alpha.
2 Intel® Math Kernel Library Reference Manual
336
src_lda INTEGER. Distance between the first elements in adjacent columns (in the
case of the column-major order) or rows (in the case of the row-major
order) in the source matrix; measured in the number of elements.
This parameter must be at least max(1,rows) if ordering = 'C' or 'c',
and max(1,cols) otherwise.
dst_lda INTEGER. Distance between the first elements in adjacent columns (in the
case of the column-major order) or rows (in the case of the row-major
order) in the destination matrix; measured in the number of elements.
To determine the minimum value of dst_lda on output, consider the
following guideline:
If ordering = 'C' or 'c', then
• If trans = 'T' or 't' or 'C' or 'c', this parameter must be at least
max(1,rows)
• If trans = 'N' or 'n' or 'R' or 'r', this parameter must be at least
max(1,cols)
If ordering = 'R' or 'r', then
• If trans = 'T' or 't' or 'C' or 'c', this parameter must be at least
max(1,cols)
• If trans = 'N' or 'n' or 'R' or 'r', this parameter must be at least
max(1,rows)
Output Parameters
a REAL for mkl_simatcopy.
DOUBLE PRECISION for mkl_dimatcopy.
COMPLEX for mkl_cimatcopy.
DOUBLE COMPLEX for mkl_zimatcopy.
Array, DIMENSION at least m.
Contains the matrix A.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_simatcopy ( ordering, trans, rows, cols, alpha, a, src_lda, dst_lda )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_ld, dst_ld
REAL a(*), alpha*
SUBROUTINE mkl_dimatcopy ( ordering, trans, rows, cols, alpha, a, src_lda, dst_lda )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_ld, dst_ld
DOUBLE PRECISION a(*), alpha*
SUBROUTINE mkl_cimatcopy ( ordering, trans, rows, cols, alpha, a, src_lda, dst_lda )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_ld, dst_ld
COMPLEX a(*), alpha*
SUBROUTINE mkl_zimatcopy ( ordering, trans, rows, cols, alpha, a, src_lda, dst_lda )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_ld, dst_ld
DOUBLE COMPLEX a(*), alpha*
C:
void mkl_simatcopy(char ordering, char trans, size_t rows, size_t cols, float *alpha, float *a, size_t src_lda, size_t dst_lda);
BLAS and Sparse BLAS Routines 2
337
void mkl_dimatcopy(char ordering, char trans, size_t rows, size_t cols, double *alpha, float *a, size_t src_lda, size_t dst_lda);
void mkl_cimatcopy(char ordering, char trans, size_t rows, size_t cols, MKL_Complex8 *alpha,
MKL_Complex8 *a, size_t src_lda, size_t dst_lda);
void mkl_zimatcopy(char ordering, char trans, size_t rows, size_t cols, MKL_Complex16 *alpha,
MKL_Complex16 *a, size_t src_lda, size_t dst_lda);
mkl_?omatcopy
Performs scaling and out-place transposition/copying
of matrices.
Syntax
Fortran:
call mkl_somatcopy(ordering, trans, rows, cols, alpha, src, src_ld, dst, dst_ld)
call mkl_domatcopy(ordering, trans, rows, cols, alpha, src, src_ld, dst, dst_ld)
call mkl_comatcopy(ordering, trans, rows, cols, alpha, src, src_ld, dst, dst_ld)
call mkl_zomatcopy(ordering, trans, rows, cols, alpha, src, src_ld, dst, dst_ld)
C:
mkl_somatcopy(ordering, trans, rows, cols, alpha, SRC, src_stride, DST, dst_stride);
mkl_domatcopy(ordering, trans, rows, cols, alpha, SRC, src_stride, DST, dst_stride);
mkl_comatcopy(ordering, trans, rows, cols, alpha, SRC, src_stride, DST, dst_stride);
mkl_zomatcopy(ordering, trans, rows, cols, alpha, SRC, src_stride, DST, dst_stride);
Include Files
• FORTRAN 77: mkl_trans.fi
• C: mkl_trans.h
Description
The mkl_?omatcopy routine performs scaling and out-of-place transposition/copying of matrices. A
transposition operation can be a normal matrix copy, a transposition, a conjugate transposition, or just a
conjugation. The operation is defined as follows:
B := alpha*op(A)
The routine parameter descriptions are common for all implemented interfaces with the exception of data
types that mostly refer here to the FORTRAN 77 standard types. Data types specific to the different
interfaces are described in the section "Interfaces" below.
Note that different arrays should not overlap.
Input Parameters
ordering CHARACTER*1. Ordering of the matrix storage.
If ordering = 'R' or 'r', the ordering is row-major.
If ordering = 'C' or 'c', the ordering is column-major.
trans CHARACTER*1. Parameter that specifies the operation type.
If trans = 'N' or 'n', op(A)=A and the matrix A is assumed unchanged
on input.
2 Intel® Math Kernel Library Reference Manual
338
If trans = 'T' or 't', it is assumed that A should be transposed.
If trans = 'C' or 'c', it is assumed that A should be conjugate
transposed.
If trans = 'R' or 'r', it is assumed that A should be only conjugated.
If the data is real, then trans = 'R' is the same as trans = 'N', and
trans = 'C' is the same as trans = 'T'.
rows INTEGER. The number of matrix rows.
cols INTEGER. The number of matrix columns.
alpha REAL for mkl_somatcopy.
DOUBLE PRECISION for mkl_domatcopy.
COMPLEX for mkl_comatcopy.
DOUBLE COMPLEX for mkl_zomatcopy.
This parameter scales the input matrix by alpha.
src REAL for mkl_somatcopy.
DOUBLE PRECISION for mkl_domatcopy.
COMPLEX for mkl_comatcopy.
DOUBLE COMPLEX for mkl_zomatcopy.
Array, DIMENSION src(scr_ld,*).
src_ld INTEGER. (Fortran interface). Distance between the first elements in
adjacent columns (in the case of the column-major order) or rows (in the
case of the row-major order) in the source matrix; measured in the number
of elements.
This parameter must be at least max(1,rows) if ordering = 'C' or 'c',
and max(1,cols) otherwise.
src_stride INTEGER. (C interface). Distance between the first elements in adjacent
columns (in the case of the column-major order) or rows (in the case of the
row-major order) in the source matrix; measured in the number of
elements.
This parameter must be at least max(1,rows) if ordering = 'C' or 'c',
and max(1,cols) otherwise.
dst REAL for mkl_somatcopy.
DOUBLE PRECISION for mkl_domatcopy.
COMPLEX for mkl_comatcopy.
DOUBLE COMPLEX for mkl_zomatcopy.
Array, DIMENSION dst(dst_ld,*).
dst_ld INTEGER. (Fortran interface). Distance between the first elements in
adjacent columns (in the case of the column-major order) or rows (in the
case of the row-major order) in the destination matrix; measured in the
number of elements.
To determine the minimum value of dst_lda on output, consider the
following guideline:
If ordering = 'C' or 'c', then
• If trans = 'T' or 't' or 'C' or 'c', this parameter must be at least
max(1,rows)
• If trans = 'N' or 'n' or 'R' or 'r', this parameter must be at least
max(1,cols)
If ordering = 'R' or 'r', then
• If trans = 'T' or 't' or 'C' or 'c', this parameter must be at least
max(1,cols)
BLAS and Sparse BLAS Routines 2
339
• If trans = 'N' or 'n' or 'R' or 'r', this parameter must be at least
max(1,rows)
dst_stride INTEGER. (C interface). Distance between the first elements in adjacent
columns (in the case of the column-major order) or rows (in the case of the
row-major order) in the destination matrix; measured in the number of
elements.
To determine the minimum value of dst_lda on output, consider the
following guideline:
If ordering = 'C' or 'c', then
• If trans = 'T' or 't' or 'C' or 'c', this parameter must be at least
max(1,rows)
• If trans = 'N' or 'n' or 'R' or 'r', this parameter must be at least
max(1,cols)
If ordering = 'R' or 'r', then
• If trans = 'T' or 't' or 'C' or 'c', this parameter must be at least
max(1,cols)
• If trans = 'N' or 'n' or 'R' or 'r', this parameter must be at least
max(1,rows)
Output Parameters
dst REAL for mkl_somatcopy.
DOUBLE PRECISION for mkl_domatcopy.
COMPLEX for mkl_comatcopy.
DOUBLE COMPLEX for mkl_zomatcopy.
Array, DIMENSION at least m.
Contains the destination matrix.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_somatcopy ( ordering, trans, rows, cols, alpha, src, src_ld, dst, dst_ld )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_ld, dst_ld
REAL alpha, dst(dst_ld,*), src(src_ld,*)
SUBROUTINE mkl_domatcopy ( ordering, trans, rows, cols, alpha, src, src_ld, dst, dst_ld )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_lda, dst_lda
DOUBLE PRECISION alpha, dst(dst_ld,*), src(src_ld,*)
SUBROUTINE mkl_comatcopy ( ordering, trans, rows, cols, alpha, src, src_ld, dst, dst_ld )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_lda, dst_lda
COMPLEX alpha, dst(dst_ld,*), src(src_ld,*)
SUBROUTINE mkl_zomatcopy ( ordering, trans, rows, cols, alpha, src, src_ld, dst, dst_ld )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_lda, dst_lda
DOUBLE COMPLEX alpha, dst(dst_ld,*), src(src_ld,*)
C:
void mkl_somatcopy(char ordering, char trans, size_t rows, size_t cols, float alpha, float *SRC, size_t src_stride, float *DST, size_t dst_stride);
2 Intel® Math Kernel Library Reference Manual
340
void mkl_domatcopy(char ordering, char trans, size_t rows, size_t cols, double alpha, double *SRC,
size_t src_stride, double *DST, size_t dst_stride);
void mkl_comatcopy(char ordering, char trans, size_t rows, size_t cols, MKL_Complex8 alpha,
MKL_Complex8 *SRC, size_t src_stride, MKL_Complex8 *DST, size_t dst_stride);
void mkl_zomatcopy(char ordering, char trans, size_t rows, size_t cols, MKL_Complex16 alpha,
MKL_Complex16 *SRC, size_t src_stride, MKL_Complex16 *DST, size_t dst_stride);
mkl_?omatcopy2
Performs two-strided scaling and out-of-place
transposition/copying of matrices.
Syntax
Fortran:
call mkl_somatcopy2(ordering, trans, rows, cols, alpha, src, src_row, src_col, dst,
dst_row, dst_col)
call mkl_domatcopy2(ordering, trans, rows, cols, alpha, src, src_row, src_col, dst,
dst_row, dst_col)
call mkl_comatcopy2(ordering, trans, rows, cols, alpha, src, src_row, src_col, dst,
dst_row, dst_col)
call mkl_zomatcopy2(ordering, trans, rows, cols, alpha, src, src_row, src_col, dst,
dst_row, dst_col)
C:
mkl_somatcopy2(ordering, trans, rows, cols, alpha, SRC, src_row, src_col, DST,
dst_row, dst_col);
mkl_domatcopy2(ordering, trans, rows, cols, alpha, SRC, src_row, src_col, DST,
dst_row, dst_col);
mkl_comatcopy2(ordering, trans, rows, cols, alpha, SRC, src_row, src_col, DST,
dst_row, dst_col);
mkl_zomatcopy2(ordering, trans, rows, cols, alpha, SRC, src_row, src_col, DST,
dst_row, dst_col);
Include Files
• FORTRAN 77: mkl_trans.fi
• C: mkl_trans.h
Description
The mkl_?omatcopy2 routine performs two-strided scaling and out-of-place transposition/copying of
matrices. A transposition operation can be a normal matrix copy, a transposition, a conjugate transposition,
or just a conjugation. The operation is defined as follows:
B := alpha*op(A)
Normally, matrices in the BLAS or LAPACK are specified by a single stride index. For instance, in the columnmajor
order, A(2,1) is stored in memory one element away from A(1,1), but A(1,2) is a leading
dimension away. The leading dimension in this case is the single stride. If a matrix has two strides, then both
A(2,1) and A(1,2) may be an arbitrary distance from A(1,1).
BLAS and Sparse BLAS Routines 2
341
The routine parameter descriptions are common for all implemented interfaces with the exception of data
types that refer here to the FORTRAN 77 standard types. Data types specific to the different interfaces are
described in the section "Interfaces" below.
Note that different arrays should not overlap.
Input Parameters
ordering CHARACTER*1. Ordering of the matrix storage.
If ordering = 'R' or 'r', the ordering is row-major.
If ordering = 'C' or 'c', the ordering is column-major.
trans CHARACTER*1. Parameter that specifies the operation type.
If trans = 'N' or 'n', op(A)=A and the matrix A is assumed unchanged
on input.
If trans = 'T' or 't', it is assumed that A should be transposed.
If trans = 'C' or 'c', it is assumed that A should be conjugate
transposed.
If trans = 'R' or 'r', it is assumed that A should be only conjugated.
If the data is real, then trans = 'R' is the same as trans = 'N', and
trans = 'C' is the same as trans = 'T'.
rows INTEGER. The number of matrix rows.
cols INTEGER. The number of matrix columns.
alpha REAL for mkl_somatcopy2.
DOUBLE PRECISION for mkl_domatcopy2.
COMPLEX for mkl_comatcopy2.
DOUBLE COMPLEX for mkl_zomatcopy2.
This parameter scales the input matrix by alpha.
src REAL for mkl_somatcopy2.
DOUBLE PRECISION for mkl_domatcopy2.
COMPLEX for mkl_comatcopy2.
DOUBLE COMPLEX for mkl_zomatcopy2.
Array, DIMENSION src(*).
src_row INTEGER. Distance between the first elements in adjacent rows in the
source matrix; measured in the number of elements.
This parameter must be at least max(1,rows).
src_col INTEGER. Distance between the first elements in adjacent columns in the
source matrix; measured in the number of elements.
This parameter must be at least max(1,cols).
dst REAL for mkl_somatcopy2.
DOUBLE PRECISION for mkl_domatcopy2.
COMPLEX for mkl_comatcopy2.
DOUBLE COMPLEX for mkl_zomatcopy2.
Array, DIMENSION dst(*).
dst_row INTEGER. Distance between the first elements in adjacent rows in the
destination matrix; measured in the number of elements.
To determine the minimum value of dst_row on output, consider the
following guideline:
• If trans = 'T' or 't' or 'C' or 'c', this parameter must be at least
max(1,cols)
• If trans = 'N' or 'n' or 'R' or 'r', this parameter must be at least
max(1,rows)
2 Intel® Math Kernel Library Reference Manual
342
dst_col INTEGER. Distance between the first elements in adjacent columns in the
destination matrix; measured in the number of elements.
To determine the minimum value of dst_lda on output, consider the
following guideline:
• If trans = 'T' or 't' or 'C' or 'c', this parameter must be at least
max(1,rows)
• If trans = 'N' or 'n' or 'R' or 'r', this parameter must be at least
max(1,cols)
Output Parameters
dst REAL for mkl_somatcopy2.
DOUBLE PRECISION for mkl_domatcopy2.
COMPLEX for mkl_comatcopy2.
DOUBLE COMPLEX for mkl_zomatcopy2.
Array, DIMENSION at least m.
Contains the destination matrix.
Interfaces
FORTRAN 77:
SUBROUTINE mkl_somatcopy2 ( ordering, trans, rows, cols, alpha, src, src_row, src_col, dst, dst_row,
dst_col )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_row, src_col, dst_row, dst_col
REAL alpha, dst(*), src(*)
SUBROUTINE mkl_domatcopy2 ( ordering, trans, rows, cols, alpha, src, src_row, src_col, dst, dst_row,
dst_col )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_row, src_col, dst_row, dst_col
DOUBLE PRECISION alpha, dst(*), src(*)
SUBROUTINE mkl_comatcopy2 ( ordering, trans, rows, cols, alpha, src, src_row, src_col, dst, dst_row,
dst_col )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_row, src_col, dst_row, dst_col
COMPLEX alpha, dst(*), src(*)
SUBROUTINE mkl_zomatcopy2 ( ordering, trans, rows, cols, alpha, src, src_row, src_col, dst, dst_row,
dst_col )
CHARACTER*1 ordering, trans
INTEGER rows, cols, src_row, src_col, dst_row, dst_col
DOUBLE COMPLEX alpha, dst(*), src(*)
C:
void mkl_somatcopy2(char ordering, char trans, size_t rows, size_t cols, float *alpha, float *SRC,
size_t src_row, size_t src_col, float *DST, size_t dst_row, size_t dst_col);
void mkl_domatcopy2(char ordering, char trans, size_t rows, size_t cols, float *alpha, double *SRC,
size_t src_row, size_t src_col, double *DST, size_t dst_row, size_t dst_col);
void mkl_comatcopy2(char ordering, char trans, size_t rows, size_t cols, MKL_Complex8 *alpha,
MKL_Complex8 *SRC, size_t src_row, size_t src_col, MKL_Complex8 *DST, size_t dst_row, size_t dst_col);
void mkl_zomatcopy2(char ordering, char trans, size_t rows, size_t cols, MKL_Complex16 *alpha,
MKL_Complex16 *SRC, size_t src_row, size_t src_col, MKL_Complex16 *DST, size_t dst_row, size_t dst_col);
BLAS and Sparse BLAS Routines 2
343
mkl_?omatadd
Performs scaling and sum of two matrices including
their out-of-place transposition/copying.
Syntax
Fortran:
call mkl_somatadd(ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc)
call mkl_domatadd(ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc)
call mkl_comatadd(ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc)
call mkl_zomatadd(ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc)
C:
mkl_somatadd(ordering, transa, transb, m, n, alpha, A, lda, beta, B, ldb, C, ldc);
mkl_domatadd(ordering, transa, transb, m, n, alpha, A, lda, beta, B, ldb, C, ldc);
mkl_comatadd(ordering, transa, transb, m, n, alpha, A, lda, beta, B, ldb, C, ldc);
mkl_zomatadd(ordering, transa, transb, m, n, alpha, A, lda, beta, B, ldb, C, ldc);
Include Files
• FORTRAN 77: mkl_trans.fi
• C: mkl_trans.h
Description
The mkl_?omatadd routine scaling and sum of two matrices including their out-of-place transposition/
copying. A transposition operation can be a normal matrix copy, a transposition, a conjugate transposition,
or just a conjugation. The following out-of-place memory movement is done:
C := alpha*op(A) + beta*op(B)
op(A) is either transpose, conjugate-transpose, or leave alone depending on transa. If no transposition of
the source matrices is required, m is the number of rows and n is the number of columns in the source
matrices A and B. In this case, the output matrix C is m-by-n.
The routine parameter descriptions are common for all implemented interfaces with the exception of data
types that refer here to the FORTRAN 77 standard types. Data types specific to the different interfaces are
described in the section "Interfaces" below.
Note that different arrays should not overlap.
Input Parameters
ordering CHARACTER*1. Ordering of the matrix storage.
If ordering = 'R' or 'r', the ordering is row-major.
If ordering = 'C' or 'c', the ordering is column-major.
transa CHARACTER*1. Parameter that specifies the operation type on matrix A.
If transa = 'N' or 'n', op(A)=A and the matrix A is assumed unchanged
on input.
If transa = 'T' or 't', it is assumed that A should be transposed.
If transa = 'C' or 'c', it is assumed that A should be conjugate
transposed.
If transa = 'R' or 'r', it is assumed that A should be only conjugated.
2 Intel® Math Kernel Library Reference Manual
344
If the data is real, then transa = 'R' is the same as transa = 'N', and
transa = 'C' is the same as transa = 'T'.
transb CHARACTER*1. Parameter that specifies the operation type on matrix B.
If transb = 'N' or 'n', op(B)=B and the matrix B is assumed unchanged
on input.
If transb = 'T' or 't', it is assumed that B should be transposed.
If transb = 'C' or 'c', it is assumed that B should be conjugate
transposed.
If transb = 'R' or 'r', it is assumed that B should be only conjugated.
If the data is real, then transb = 'R' is the same as transb = 'N', and
transb = 'C' is the same as transb = 'T'.
m INTEGER. The number of matrix rows.
n INTEGER. The number of matrix columns.
alpha REAL for mkl_somatadd.
DOUBLE PRECISION for mkl_domatadd.
COMPLEX for mkl_comatadd.
DOUBLE COMPLEX for mkl_zomatadd.
This parameter scales the input matrix by alpha.
a REAL for mkl_somatadd.
DOUBLE PRECISION for mkl_domatadd.
COMPLEX for mkl_comatadd.
DOUBLE COMPLEX for mkl_zomatadd.
Array, DIMENSION a(lda,*).
lda INTEGER. Distance between the first elements in adjacent columns (in the
case of the column-major order) or rows (in the case of the row-major
order) in the source matrix A; measured in the number of elements.
This parameter must be at least max(1,rows) if ordering = 'C' or 'c',
and max(1,cols) otherwise.
beta REAL for mkl_somatadd.
DOUBLE PRECISION for mkl_domatadd.
COMPLEX for mkl_comatadd.
DOUBLE COMPLEX for mkl_zomatadd.
This parameter scales the input matrix by beta.
b REAL for mkl_somatadd.
DOUBLE PRECISION for mkl_domatadd.
COMPLEX for mkl_comatadd.
DOUBLE COMPLEX for mkl_zomatadd.
Array, DIMENSION b(ldb,*).
ldb INTEGER. Distance between the first elements in adjacent columns (in the
case of the column-major order) or rows (in the case of the row-major
order) in the source matrix B; measured in the number of elements.
This parameter must be at least max(1,rows) if ordering = 'C' or 'c',
and max(1,cols) otherwise.
Output Parameters
c REAL for mkl_somatadd.
DOUBLE PRECISION for mkl_domatadd.
COMPLEX for mkl_comatadd.
DOUBLE COMPLEX for mkl_zomatadd.
Array, DIMENSION c(ldc,*).
BLAS and Sparse BLAS Routines 2
345
ldc INTEGER. Distance between the first elements in adjacent columns (in the
case of the column-major order) or rows (in the case of the row-major
order) in the destination matrix C; measured in the number of elements.
To determine the minimum value of ldc, consider the following guideline:
If ordering = 'C' or 'c', then
• If transa or transb = 'T' or 't' or 'C' or 'c', this parameter must
be at least max(1,rows)
• If transa or transb = 'N' or 'n' or 'R' or 'r', this parameter must
be at least max(1,cols)
If ordering = 'R' or 'r', then
• If transa or transb = 'T' or 't' or 'C' or 'c', this parameter must
be at least max(1,cols)
• If transa or transb = 'N' or 'n' or 'R' or 'r', this parameter must
be at least max(1,rows)
Interfaces
FORTRAN 77:
SUBROUTINE mkl_somatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
CHARACTER*1 ordering, transa, transb
INTEGER m, n, lda, ldb, ldc
REAL alpha, beta
REAL a(lda,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_domatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
CHARACTER*1 ordering, transa, transb
INTEGER m, n, lda, ldb, ldc
DOUBLE PRECISION alpha, beta
DOUBLE PRECISION a(lda,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_comatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
CHARACTER*1 ordering, transa, transb
INTEGER m, n, lda, ldb, ldc
COMPLEX alpha, beta
COMPLEX a(lda,*), b(ldb,*), c(ldc,*)
SUBROUTINE mkl_zomatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
CHARACTER*1 ordering, transa, transb
INTEGER m, n, lda, ldb, ldc
DOUBLE COMPLEX alpha, beta
DOUBLE COMPLEX a(lda,*), b(ldb,*), c(ldc,*)
C:
void mkl_somatadd(char ordering, char transa, char transb, size_t m, size_t n, float *alpha, float *A,
size_t lda, float *beta, float *B, size_t ldb, float *C, size_t ldc);
void mkl_domatadd(char ordering, char transa, char transb, size_t m, size_t n, double *alpha, double
*A, size_t lda, double *beta, float *B, size_t ldb, double *C, size_t ldc);
void mkl_comatadd(char ordering, char transa, char transb, size_t m, size_t n,
MKL_Complex8 *alpha, MKL_Complex8 *A, size_t lda, float *beta, float *B, size_t ldb, MKL_Complex8 *C,
size_t ldc);
void mkl_zomatadd(char ordering, char transa, char transb, size_t m, size_t n,
MKL_Complex16 *alpha, MKL_Complex16 *A, size_t lda, float *beta, float *B, size_t ldb, MKL_Complex16
*C, size_t ldc);
2 Intel® Math Kernel Library Reference Manual
346
LAPACK Routines: Linear
Equations 3
This chapter describes the Intel® Math Kernel Library implementation of routines from the LAPACK package
that are used for solving systems of linear equations and performing a number of related computational
tasks. The library includes LAPACK routines for both real and complex data. Routines are supported for
systems of equations with the following types of matrices:
• general
• banded
• symmetric or Hermitian positive-definite (full, packed, and rectangular full packed (RFP) storage)
• symmetric or Hermitian positive-definite banded
• symmetric or Hermitian indefinite (both full and packed storage)
• symmetric or Hermitian indefinite banded
• triangular (full, packed, and RFP storage)
• triangular banded
• tridiagonal
• diagonally dominant tridiagonal.
For each of the above matrix types, the library includes routines for performing the following computations:
– factoring the matrix (except for triangular matrices)
– equilibrating the matrix (except for RFP matrices)
– solving a system of linear equations
– estimating the condition number of a matrix (except for RFP matrices)
– refining the solution of linear equations and computing its error bounds (except for RFP matrices)
– inverting the matrix.
To solve a particular problem, you can call two or more computational routines or call a corresponding driver
routine that combines several tasks in one call. For example, to solve a system of linear equations with a
general matrix, call ?getrf (LU factorization) and then ?getrs (computing the solution). Then, call ?gerfs
to refine the solution and get the error bounds. Alternatively, use the driver routine ?gesvx that performs all
these tasks in one call.
WARNING LAPACK routines assume that input matrices do not contain IEEE 754 special values such
as INF or NaN values. Using these special values may cause LAPACK to return unexpected results or
become unstable.
Starting from release 8.0, Intel MKL along with the FORTRAN 77 interface to LAPACK computational and
driver routines also supports the Fortran 95 interface that uses simplified routine calls with shorter argument
lists. The syntax section of the routine description gives the calling sequence for the Fortran 95 interface,
where available, immediately after the FORTRAN 77 calls.
Routine Naming Conventions
To call each routine introduced in this chapter from the FORTRAN 77 program, you can use the LAPACK
name.
LAPACK names are listed in Table "Computational Routines for Systems of Equations with Real Matrices"
and Table "Computational Routines for Systems of Equations with Complex Matrices", and have the
structure ?yyzzz or ?yyzz, which is described below.
The initial symbol ? indicates the data type:
s real, single precision
347
c complex, single precision
d real, double precision
z complex, double precision
Some routines can have combined character codes, such as ds or zc.
The second and third letters yy indicate the matrix type and storage scheme:
ge general
gb general band
gt general tridiagonal
dt diagonally dominant tridiagonal
po symmetric or Hermitian positive-definite
pp symmetric or Hermitian positive-definite (packed storage)
pf symmetric or Hermitian positive-definite (RFP storage)
pb symmetric or Hermitian positive-definite band
pt symmetric or Hermitian positive-definite tridiagonal
sy symmetric indefinite
sp symmetric indefinite (packed storage)
he Hermitian indefinite
hp Hermitian indefinite (packed storage)
tr triangular
tp triangular (packed storage)
tf triangular (RFP storage)
tb triangular band
The last three letters zzz indicate the computation performed:
trf perform a triangular matrix factorization
trs solve the linear system with a factored matrix
con estimate the matrix condition number
rfs refine the solution and compute error bounds
rfsx refine the solution and compute error bounds using extra-precise
iterative refinement
tri compute the inverse matrix using the factorization
equ, equb equilibrate a matrix.
For example, the sgetrf routine performs the triangular factorization of general real matrices in single
precision; the corresponding routine for complex matrices is cgetrf.
Driver routine names can end with -sv (meaning a simple driver), or with -svx (meaning an expert driver)
or with -svxx (meaning an extra-precise iterative refinement expert driver).
The Fortran 95 interfaces to the LAPACK computational and driver routines are the same as the FORTRAN 77
names but without the first letter that indicates the data type. For example, the name of the routine that
performs a triangular factorization of general real matrices in Fortran 95 is getrf. Different data types are
handled through the definition of a specific internal parameter that refers to a module block with named
constants for single and double precision.
C Interface Conventions
The C interfaces are implemented for most of the Intel MKL LAPACK driver and computational routines.
The arguments of the C interfaces for the Intel MKL LAPACK functions comply with the following rules:
• Scalar input arguments are passed by value.
3 Intel® Math Kernel Library Reference Manual
348
• Array arguments are passed by reference.
• Array input arguments are declared with the const modifier.
• Function arguments are passed by pointer.
• An integer return value replaces the info output parameter. The return value equal to 0 means the
function operation is completed successfully. See also special error codes below.
Matrix Order
Most of the LAPACK C interfaces have an additional parameter matrix_order of type int as their first
argument. This parameter specifies whether the two-dimensional arrays are row-major
(LAPACK_ROW_MAJOR) or column-major (LAPACK_COL_MAJOR).
In general the leading dimension lda is equal to the number of elements in the major dimension. It is also
equal to the distance in elements between two neighboring elements in a line in the minor dimension. If
there are no extra elements in a matrix with m rows and n columns, then
• For row-major ordering: the number of elements in a row is n, and row i is stored in memory right after
row i-1. Therefore lda is n.
• For column-major ordering: the number of elements in a column is m, and column i is stored in memory
right after column i-1. Therefore lda is m.
To refer to a submatrix with dimensions k by l, use the number of elements in the major dimension of the
whole matrix (as above) as the leading dimension and k and l in the subroutine's input parameters to
describe the size of the submatrix.
Workspace Arrays
The LAPACK C interface omits workspace parameters because workspace is allocated during runtime and
released upon completion of the function operation.
For some functions, work arrays contain valuable information on exit. In such cases, the interface contains
an additional argument or arguments, namely:
• ?gesvx and ?gbsvx contain rpivot
• ?gesvd contains superb
• ?gejsv and ?gesvj contain istat and stat, respectively.
Function Types
The function types are used in non-symmetric eigenproblem functions only.
typedef lapack_logical (*LAPACK_S_SELECT2) (const float*, const float*);
typedef lapack_logical (*LAPACK_S_SELECT3) (const float*, const float*, const float*);
typedef lapack_logical (*LAPACK_D_SELECT2) (const double*, const double*);
typedef lapack_logical (*LAPACK_D_SELECT3) (const double*, const double*, const double*);
LAPACK Routines: Linear Equations 3
349
typedef lapack_logical (*LAPACK_C_SELECT1) (const lapack_complex_float*);
typedef lapack_logical (*LAPACK_C_SELECT2) (const lapack_complex_float*, const lapack_complex_float*);
typedef lapack_logical (*LAPACK_Z_SELECT1) (const lapack_complex_double*);
typedef lapack_logical (*LAPACK_Z_SELECT2) (const lapack_complex_double*, const lapack_complex_double*);
Mapping FORTRAN Data Types against C Data Types
FORTRAN Data Types vs. C Data Types
FORTRAN C
INTEGER lapack_int
LOGICAL lapack_logical
REAL float
DOUBLE PRECISION double
COMPLEX lapack_complex_float
COMPLEX*16/DOUBLE COMPLEX lapack_complex_double
CHARACTER char
C Type Definitions
#ifndef lapack_int
#define lapack_int MKL_INT
#endif
#ifndef lapack_logical
#define lapack_logical lapack_int
#endif
Complex Type Definitions
Complex type for single precision:
#ifndef lapack_complex_float
#define lapack_complex_float MKL_Complex8
#endif
Complex type for double precision:
#ifndef lapack_complex_double
#define lapack_complex_double MKL_Complex16
#endif
Matrix Order Definitions
#define LAPACK_ROW_MAJOR 101
#define LAPACK_COL_MAJOR 102
See Matrix Order for an explanation of row-major order and column-major order storage.
Error Code Definitions
#define LAPACK_WORK_MEMORY_ERROR -1010 /* Failed to allocate memory
for a working array */
#define LAPACK_TRANSPOSE_MEMORY_ERROR -1011 /* Failed to allocate memory
for transposed matrix */
If the return value is -i, the -i-th parameter has an invalid value.
3 Intel® Math Kernel Library Reference Manual
350
Function Prototypes
Some Intel MKL functions differ in data types they support and vary in the parameters they take.
Each function type has a unique prototype defined. Use this prototype when you call the function from your
application program. In most cases, Intel MKL supports four distinct floating-point precisions. Each
corresponding prototype looks similar, usually differing only in the data type. To avoid listing all the
prototypes in every supported precision, a generic prototype template is provided.
denotes precision and is s, d, c, or z:
• s for real, single precision
• d for real, double precision
• c for complex, single precision
• z for complex, double precision
stands for a respective data type: float, double, lapack_complex_float, or
lapack_complex_double.
For example, the C prototype template for the ?pptrs function that solves a system of linear equations with
a packed Cholesky-factored symmetric (Hermitian) positive-definite matrix looks as follows:
lapack_int LAPACKE_pptrs(int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const * ap, * b, lapack_int ldb);
To obtain the function name and parameter list that corresponds to a specific precision, replace the
symbol with s, d, c, or z and the field with the corresponding data type (float, double,
lapack_complex_float, or lapack_complex_double respectively).
A specific example follows. To solve a system of linear equations with a packed Cholesky-factored Hermitian
positive-definite matrix with complex precision, use the following:
lapack_int LAPACKE_cpptrs(int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_float* ap, lapack_complex_float* b, lapack_int ldb);
NOTE For the select parameter, the respective values of the field for s, d, c, or z are
as follows: LAPACK_S_SELECT3, LAPACK_D_SELECT3, LAPACK_C_SELECT2, and LAPACK_Z_SELECT2.
Fortran 95 Interface Conventions
Intel® MKL implements the Fortran 95 interface to LAPACK through wrappers that call respective FORTRAN 77
routines. This interface uses such Fortran 95 features as assumed-shape arrays and optional arguments to
provide simplified calls to LAPACK routines with fewer arguments.
NOTE For LAPACK, Intel MKL offers two types of the Fortran 95 interfaces:
• using mkl_lapack.fi only through the include ‘mkl_lapack.fi’ statement. Such interfaces
allow you to make use of the original LAPACK routines with all their arguments
• using lapack.f90 that includes improved interfaces. This file is used to generate the module files
lapack95.mod and f95_precision.mod. The module files mkl95_lapack.mod and
mkl95_precision.mod are also generated. See also the section "Fortran 95 interfaces and
wrappers to LAPACK and BLAS" of the Intel® MKL User's Guide for details. The module files are
used to process the FORTRAN use clauses referencing the LAPACK interface: use lapack95 (or an
equivalent use mkl95_lapack) and use f95_precision (or an equivalent use
mkl95_precision).
The main conventions for the Fortran 95 interface are as follows:
LAPACK Routines: Linear Equations 3
351
• The names of arguments used in Fortran 95 call are typically the same as for the respective generic
(FORTRAN 77) interface. In rare cases, formal argument names may be different. For instance, select
instead of selctg.
• Input arguments such as array dimensions are not required in Fortran 95 and are skipped from the calling
sequence. Array dimensions are reconstructed from the user data that must exactly follow the required
array shape.
Another type of generic arguments that are skipped in the Fortran 95 interface are arguments that
represent workspace arrays (such as work, rwork, and so on). The only exception are cases when
workspace arrays return significant information on output.
An argument can also be skipped if its value is completely defined by the presence or absence of another
argument in the calling sequence, and the restored value is the only meaningful value for the skipped
argument.
• Some generic arguments are declared as optional in the Fortran 95 interface and may or may not be
present in the calling sequence. An argument can be declared optional if it meets one of the following
conditions:
– If an argument value is completely defined by the presence or absence of another argument in the
calling sequence, it can be declared optional. The difference from the skipped argument in this case is
that the optional argument can have some meaningful values that are distinct from the value
reconstructed by default. For example, if some argument (like jobz) can take only two values and one
of these values directly implies the use of another argument, then the value of jobz can be uniquely
reconstructed from the actual presence or absence of this second argument, and jobz can be omitted.
– If an input argument can take only a few possible values, it can be declared as optional. The default
value of such argument is typically set as the first value in the list and all exceptions to this rule are
explicitly stated in the routine description.
– If an input argument has a natural default value, it can be declared as optional. The default value of
such optional argument is set to its natural default value.
• Argument info is declared as optional in the Fortran 95 interface. If it is present in the calling sequence,
the value assigned to info is interpreted as follows:
– If this value is more than -1000, its meaning is the same as in the FORTRAN 77 routine.
– If this value is equal to -1000, it means that there is not enough work memory.
– If this value is equal to -1001, incompatible arguments are present in the calling sequence.
– If this value is equal to -i, the ith parameter (counting parameters in the FORTRAN 77 interface, not
the Fortran 95 interface) had an illegal value.
• Optional arguments are given in square brackets in the Fortran 95 call syntax.
The "Fortran 95 Notes" subsection at the end of the topic describing each routine details concrete rules for
reconstructing the values of the omitted optional parameters.
Intel® MKL Fortran 95 Interfaces for LAPACK Routines vs. Netlib Implementation
The following list presents general digressions of the Intel MKL LAPACK95 implementation from the Netlib
analog:
• The Intel MKL Fortran 95 interfaces are provided for pure procedures.
• Names of interfaces do not contain the LA_ prefix.
• An optional array argument always has the target attribute.
• Functionality of the Intel MKL LAPACK95 wrapper is close to the FORTRAN 77 original implementation in
the getrf, gbtrf, and potrf interfaces.
• If jobz argument value specifies presence or absence of z argument, then z is always declared as
optional and jobz is restored depending on whether z is present or not. It is not always so in the Netlib
version (see "Modified Netlib Interfaces" in Appendix E).
• To avoid double error checking, processing of the info argument is limited to checking of the allocated
memory and disarranging of optional arguments.
• If an argument that is present in the list of arguments completely defines another argument, the latter is
always declared as optional.
3 Intel® Math Kernel Library Reference Manual
352
You can transform an application that uses the Netlib LAPACK interfaces to ensure its work with the Intel MKL
interfaces providing that:
a. The application is correct, that is, unambiguous, compiler-independent, and contains no errors.
b. Each routine name denotes only one specific routine. If any routine name in the application coincides with
a name of the original Netlib routine (for example, after removing the LA_ prefix) but denotes a routine
different from the Netlib original routine, this name should be modified through context name
replacement.
You should transform your application in the following cases (see Appendix E for specific differences of
individual interfaces):
• When using the Netlib routines that differ from the Intel MKL routines only by the LA_ prefix or in the
array attribute target. The only transformation required in this case is context name replacement. See
"Interfaces Identical to Netlib" in Appendix E for details.
• When using Netlib routines that differ from the Intel MKL routines by the LA_ prefix, the target array
attribute, and the names of formal arguments. In the case of positional passing of arguments, no
additional transformation except context name replacement is required. In the case of the keywords
passing of arguments, in addition to the context name replacement the names of mismatching keywords
should also be modified. See "Interfaces with Replaced Argument Names" in Appendix E for details.
• When using the Netlib routines that differ from the respective Intel MKL routines by the LA_ prefix, the
target array attribute, sequence of the arguments, arguments missing in Intel MKL but present in Netlib
and, vice versa, present in Intel MKL but missing in Netlib. Remove the differences in the sequence and
range of the arguments in process of all the transformations when you use the Netlib routines specified by
this bullet and the preceding bullet. See "Modified Netlib Interfaces" in Appendix E for details.
• When using the getrf, gbtrf, and potrf interfaces, that is, new functionality implemented in Intel MKL
but unavailable in the Netlib source. To override the differences, build the desired functionality explicitly
with the Intel MKL means or create a new subroutine with the new functionality, using specific MKL
interfaces corresponding to LAPACK 77 routines. You can call the LAPACK 77 routines directly but using
the new Intel MKL interfaces is preferable. See "Interfaces Absent From Netlib" and "Interfaces of New
Functionality" in Appendix E for details. Note that if the transformed application calls getrf, gbtrf or
potrf without controlling arguments rcond and norm, just context name replacement is enough in
modifying the calls into the Intel MKL interfaces, as described in the first bullet above. The Netlib
functionality is preserved in such cases.
• When using the Netlib auxiliary routines. In this case, call a corresponding subroutine directly, using the
Intel MKL LAPACK 77 interfaces.
Transform your application as follows:
1. Make sure conditions a. and b. are met.
2. Select Netlib LAPACK 95 calls. For each call, do the following:
• Select the type of digression and do the required transformations.
• Revise results to eliminate unneeded code or data, which may appear after several identical calls.
3. Make sure the transformations are correct and complete.
Matrix Storage Schemes
LAPACK routines use the following matrix storage schemes:
• Full storage: a matrix A is stored in a two-dimensional array a, with the matrix element aij stored in the
array element a(i,j).
• Packed storage scheme allows you to store symmetric, Hermitian, or triangular matrices more
compactly: the upper or lower triangle of the matrix is packed by columns in a one-dimensional array.
• Band storage: an m-by-n band matrix with kl sub-diagonals and ku superdiagonals is stored compactly in
a two-dimensional array ab with kl+ku+1 rows and n columns. Columns of the matrix are stored in the
corresponding columns of the array, and diagonals of the matrix are stored in rows of the array.
• Rectangular Full Packed (RFP) storage: the upper or lower triangle of the matrix is packed combining
the full and packed storage schemes. This combination enables using half of the full storage as packed
storage while maintaining efficiency by using Level 3 BLAS/LAPACK kernels as the full storage.
LAPACK Routines: Linear Equations 3
353
In Chapters 4 and 5, arrays that hold matrices in packed storage have names ending in p; arrays with
matrices in band storage have names ending in b; arrays with matrices in the RFP storage have names
ending in fp.
For more information on matrix storage schemes, see "Matrix Arguments" in Appendix B.
Mathematical Notation
Descriptions of LAPACK routines use the following notation:
Ax = b A system of linear equations with an n-by-n matrix A = {aij}, a
right-hand side vector b = {bi}, and an unknown vector x = {xi}.
AX = B A set of systems with a common matrix A and multiple right-hand
sides. The columns of B are individual right-hand sides, and the
columns of X are the corresponding solutions.
|x| the vector with elements |xi| (absolute values of xi).
|A| the matrix with elements |aij| (absolute values of aij).
||x||8 = maxi|xi| The infinity-norm of the vector x.
||A||8 = maxiSj|aij| The infinity-norm of the matrix A.
||A||1 = maxjSi|aij| The one-norm of the matrix A. ||A||1 = ||AT||8 = ||AH||8
?(A) = ||A|| ||A-1|| The condition number of the matrix A.
Error Analysis
In practice, most computations are performed with rounding errors. Besides, you often need to solve a
system Ax = b, where the data (the elements of A and b) are not known exactly. Therefore, it is important
to understand how the data errors and rounding errors can affect the solution x.
Data perturbations. If x is the exact solution of Ax = b, and x + dx is the exact solution of a perturbed
problem (A + dA)x = (b + db), then
where
In other words, relative errors in A or b may be amplified in the solution vector x by a factor ?(A) = ||A||
||A-1|| called the condition number of A.
Rounding errors have the same effect as relative perturbations c(n)e in the original data. Here e is the
machine precision, and c(n) is a modest function of the matrix order n. The corresponding solution error is
||dx||/||x||= c(n)?(A)e. (The value of c(n) is seldom greater than 10n.)
Thus, if your matrix A is ill-conditioned (that is, its condition number ?(A) is very large), then the error in
the solution x is also large; you may even encounter a complete loss of precision. LAPACK provides routines
that allow you to estimate ?(A) (see Routines for Estimating the Condition Number) and also give you a
more precise estimate for the actual solution error (see Refining the Solution and Estimating Its Error).
3 Intel® Math Kernel Library Reference Manual
354
Computational Routines
Table "Computational Routines for Systems of Equations with Real Matrices" lists the LAPACK computational
routines (FORTRAN 77 and Fortran 95 interfaces) for factorizing, equilibrating, and inverting real matrices,
estimating their condition numbers, solving systems of equations with real matrices, refining the solution,
and estimating its error. Table "Computational Routines for Systems of Equations with Complex Matrices"
lists similar routines for complex matrices. Respective routine names in the Fortran 95 interface are without
the first symbol (see Routine Naming Conventions).
Computational Routines for Systems of Equations with Real Matrices
Matrix type,
storage scheme
Factorize
matrix
Equilibrate
matrix
Solve
system
Condition
number
Estimate
error
Invert matrix
general ?getrf ?geequ,
?geequb
?getrs ?gecon ?gerfs,
?gerfsx
?getri
general band ?gbtrf ?gbequ,
?gbequb
?gbtrs ?gbcon ?gbrfs,
?gbrfsx
general tridiagonal ?gttrf ?gttrs ?gtcon ?gtrfs
diagonally
dominant
tridiagonal
?dttrfb ?dttrsb
symmetric
positive-definite
?potrf ?poequ,
?poequb
?potrs ?pocon ?porfs,
?porfsx
?potri
symmetric
positive-definite,
packed storage
?pptrf ?ppequ ?pptrs ?ppcon ?pprfs ?pptri
symmetric
positive-definite,
RFP storage
?pftrf ?pftrs ?pftri
symmetric
positive-definite,
band
?pbtrf ?pbequ ?pbtrs ?pbcon ?pbrfs
symmetric
positive-definite,
tridiagonal
?pttrf ?pttrs ?ptcon ?ptrfs
symmetric
indefinite
?sytrf ?syequb ?sytrs
?sytrs2
?sycon
?syconv
?syrfs,
?syrfsx
?sytri
?sytri2
?sytri2x
symmetric
indefinite, packed
storage
?sptrf ?sptrs ?spcon ?sprfs ?sptri
triangular ?trtrs ?trcon ?trrfs ?trtri
triangular, packed
storage
?tptrs ?tpcon ?tprfs ?tptri
triangular, RFP
storage
?tftri
triangular band ?tbtrs ?tbcon ?tbrfs
LAPACK Routines: Linear Equations 3
355
In the table above, ? denotes s (single precision) or d (double precision) for the FORTRAN 77 interface.
Computational Routines for Systems of Equations with Complex Matrices
Matrix type,
storage scheme
Factorize
matrix
Equilibrate
matrix
Solve
system
Condition
number
Estimate
error
Invert matrix
general ?getrf ?geequ,
?geequb
?getrs ?gecon ?gerfs,
?gerfsx
?getri
general band ?gbtrf ?gbequ,
?gbequb
?gbtrs ?gbcon ?gbrfs,
?gbrfsx
general tridiagonal ?gttrf ?gttrs ?gtcon ?gtrfs
Hermitian
positive-definite
?potrf ?poequ,
?poequb
?potrs ?pocon ?porfs,
?porfsx
?potri
Hermitian
positive-definite,
packed storage
?pptrf ?ppequ ?pptrs ?ppcon ?pprfs ?pptri
Hermitian
positive-definite,
RFP storage
?pftrf ?pftrs ?pftri
Hermitian
positive-definite,
band
?pbtrf ?pbequ ?pbtrs ?pbcon ?pbrfs
Hermitian
positive-definite,
tridiagonal
?pttrf ?pttrs ?ptcon ?ptrfs
Hermitian
indefinite
?hetrf ?heequb ?hetrs
?hetrs2
?hecon ?herfs,
?herfsx
?hetri
?hetri2
?hetri2x
symmetric
indefinite
?sytrf ?syequb ?sytrs
?sytrs2
?sycon
?syconv
?syrfs,
?syrfsx
?sytri
?sytri2
?sytri2x
Hermitian
indefinite, packed
storage
?hptrf ?hptrs ?hpcon ?hprfs ?hptri
symmetric
indefinite, packed
storage
?sptrf ?sptrs ?spcon ?sprfs ?sptri
triangular ?trtrs ?trcon ?trrfs ?trtri
triangular, packed
storage
?tptrs ?tpcon ?tprfs ?tptri
triangular, RFP
storage
?tftri
triangular band ?tbtrs ?tbcon ?tbrfs
In the table above, ? stands for c (single precision complex) or z (double precision complex) for FORTRAN 77
interface.
3 Intel® Math Kernel Library Reference Manual
356
Routines for Matrix Factorization
This section describes the LAPACK routines for matrix factorization. The following factorizations are
supported:
• LU factorization
• Cholesky factorization of real symmetric positive-definite matrices
• Cholesky factorization of real symmetric positive-definite matrices with pivoting
• Cholesky factorization of Hermitian positive-definite matrices
• Cholesky factorization of Hermitian positive-definite matrices with pivoting
• Bunch-Kaufman factorization of real and complex symmetric matrices
• Bunch-Kaufman factorization of Hermitian matrices.
You can compute:
• the LU factorization using full and band storage of matrices
• the Cholesky factorization using full, packed, RFP, and band storage
• the Bunch-Kaufman factorization using full and packed storage.
?getrf
Computes the LU factorization of a general m-by-n
matrix.
Syntax
Fortran 77:
call sgetrf( m, n, a, lda, ipiv, info )
call dgetrf( m, n, a, lda, ipiv, info )
call cgetrf( m, n, a, lda, ipiv, info )
call zgetrf( m, n, a, lda, ipiv, info )
Fortran 95:
call getrf( a [,ipiv] [,info] )
C:
lapack_int LAPACKE_getrf( int matrix_order, lapack_int m, lapack_int n, *
a, lapack_int lda, lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the LU factorization of a general m-by-n matrix A as
A = P*L*U,
where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if m >
n) and U is upper triangular (upper trapezoidal if m < n). The routine uses partial pivoting, with row
interchanges.
LAPACK Routines: Linear Equations 3
357
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows in the matrix A (m = 0).
n INTEGER. The number of columns in A; n = 0.
a REAL for sgetrf
DOUBLE PRECISION for dgetrf
COMPLEX for cgetrf
DOUBLE COMPLEX for zgetrf.
Array, DIMENSION (lda,*). Contains the matrix A. The second
dimension of a must be at least max(1, n).
lda INTEGER. The leading dimension of array a.
Output Parameters
a Overwritten by L and U. The unit diagonal elements of L are not
stored.
ipiv INTEGER.
Array, DIMENSION at least max(1,min(m, n)). The pivot indices; for
1 = i = min(m, n), row i was interchanged with row ipiv(i).
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, uii is 0. The factorization has been completed, but U is
exactly singular. Division by 0 will occur if you use the factor U for
solving a system of linear equations.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine getrf interface are as follows:
a Holds the matrix A of size (m,n).
ipiv Holds the vector of length min(m,n).
Application Notes
The computed L and U are the exact factors of a perturbed matrix A + E, where
|E| = c(min(m,n))e P|L||U|
c(n) is a modest linear function of n, and e is the machine precision.
The approximate number of floating-point operations for real flavors is
(2/3)n3 If m = n,
(1/3)n2(3m-n) If m > n,
(1/3)m2(3n-m) If m < n.
The number of operations for complex flavors is four times greater.
3 Intel® Math Kernel Library Reference Manual
358
After calling this routine with m = n, you can call the following:
?getrs to solve A*x = B or ATX = B or AHX = B
?gecon to estimate the condition number of A
?getri to compute the inverse of A.
See Also
mkl_progress
?gbtrf
Computes the LU factorization of a general m-by-n
band matrix.
Syntax
Fortran 77:
call sgbtrf( m, n, kl, ku, ab, ldab, ipiv, info )
call dgbtrf( m, n, kl, ku, ab, ldab, ipiv, info )
call cgbtrf( m, n, kl, ku, ab, ldab, ipiv, info )
call zgbtrf( m, n, kl, ku, ab, ldab, ipiv, info )
Fortran 95:
call gbtrf( ab [,kl] [,m] [,ipiv] [,info] )
C:
lapack_int LAPACKE_gbtrf( int matrix_order, lapack_int m, lapack_int n, lapack_int
kl, lapack_int ku, * ab, lapack_int ldab, lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine forms the LU factorization of a general m-by-n band matrix A with kl non-zero subdiagonals and
ku non-zero superdiagonals, that is,
A = P*L*U,
where P is a permutation matrix; L is lower triangular with unit diagonal elements and at most kl non-zero
elements in each column; U is an upper triangular band matrix with kl + ku superdiagonals. The routine uses
partial pivoting, with row interchanges (which creates the additional kl superdiagonals in U).
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows in matrix A; m = 0.
LAPACK Routines: Linear Equations 3
359
n INTEGER. The number of columns in matrix A; n = 0.
kl INTEGER. The number of subdiagonals within the band of A; kl = 0.
ku INTEGER. The number of superdiagonals within the band of A; ku = 0.
ab REAL for sgbtrf
DOUBLE PRECISION for dgbtrf
COMPLEX for cgbtrf
DOUBLE COMPLEX for zgbtrf.
Array, DIMENSION (ldab,*). The array ab contains the matrix A in
band storage, in rows kl + 1 to 2*kl + ku + 1; rows 1 to kl of the
array need not be set. The j-th column of A is stored in the j-th
column of the array ab as follows:
ab(kl + ku + 1 + i - j, j) = a(i,j) for max(1,j-ku) = i =
min(m,j+kl).
ldab INTEGER. The leading dimension of the array ab. (ldab = 2*kl + ku +
1)
Output Parameters
ab Overwritten by L and U. U is stored as an upper triangular band matrix
with kl + ku superdiagonals in rows 1 to kl + ku + 1, and the
multipliers used during the factorization are stored in rows kl + ku +
2 to 2*kl + ku + 1. See Application Notes below for further details.
ipiv INTEGER.
Array, DIMENSION at least max(1,min(m, n)). The pivot indices; for
1 = i = min(m, n) , row i was interchanged with row ipiv(i). .
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, uii is 0. The factorization has been completed, but U is
exactly singular. Division by 0 will occur if you use the factor U for
solving a system of linear equations.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gbtrf interface are as follows:
ab Holds the array A of size (2*kl+ku+1,n).
ipiv Holds the vector of length min(m,n).
kl If omitted, assumed kl = ku.
ku Restored as ku = lda-2*kl-1.
m If omitted, assumed m = n.
Application Notes
The computed L and U are the exact factors of a perturbed matrix A + E, where
|E| = c(kl+ku+1) e P|L||U|
c(k) is a modest linear function of k, and e is the machine precision.
3 Intel® Math Kernel Library Reference Manual
360
The total number of floating-point operations for real flavors varies between approximately 2n(ku+1)kl and
2n(kl+ku+1)kl. The number of operations for complex flavors is four times greater. All these estimates
assume that kl and ku are much less than min(m,n).
The band storage scheme is illustrated by the following example, when m = n = 6, kl = 2, ku = 1:
Array elements marked * are not used by the routine; elements marked + need not be set on entry, but are
required by the routine to store elements ofU because of fill-in resulting from the row interchanges.
After calling this routine with m = n, you can call the following routines:
gbtrs to solve A*X = B or AT*X = B or AH*X = B
gbcon to estimate the condition number of A.
See Also
mkl_progress
?gttrf
Computes the LU factorization of a tridiagonal matrix.
Syntax
Fortran 77:
call sgttrf( n, dl, d, du, du2, ipiv, info )
call dgttrf( n, dl, d, du, du2, ipiv, info )
call cgttrf( n, dl, d, du, du2, ipiv, info )
call zgttrf( n, dl, d, du, du2, ipiv, info )
Fortran 95:
call gttrf( dl, d, du, du2 [, ipiv] [,info] )
C:
lapack_int LAPACKE_gttrf( lapack_int n, * dl, * d, *
du, * du2, lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
LAPACK Routines: Linear Equations 3
361
Description
The routine computes the LU factorization of a real or complex tridiagonal matrix A in the form
A = P*L*U,
where P is a permutation matrix; L is lower bidiagonal with unit diagonal elements; and U is an upper
triangular matrix with nonzeroes in only the main diagonal and first two superdiagonals. The routine uses
elimination with partial pivoting and row interchanges.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The order of the matrix A; n = 0.
dl, d, du REAL for sgttrf
DOUBLE PRECISION for dgttrf
COMPLEX for cgttrf
DOUBLE COMPLEX for zgttrf.
Arrays containing elements of A.
The array dl of dimension (n - 1) contains the subdiagonal
elements of A.
The array d of dimension n contains the diagonal elements of A.
The array du of dimension (n - 1) contains the superdiagonal
elements of A.
Output Parameters
dl Overwritten by the (n-1) multipliers that define the matrix L from the
LU factorization of A. The matrix L has unit diagonal elements, and the
(n-1) elements of dl form the subdiagonal. All other elements of L
are zero.
d Overwritten by the n diagonal elements of the upper triangular matrix
U from the LU factorization of A.
du Overwritten by the (n-1) elements of the first superdiagonal of U.
du2 REAL for sgttrf
DOUBLE PRECISION for dgttrf
COMPLEX for cgttrf
DOUBLE COMPLEX for zgttrf.
Array, dimension (n -2). On exit, du2 contains (n-2) elements of
the second superdiagonal of U.
ipiv INTEGER.
Array, dimension (n). The pivot indices: for 1 = i = n, row i was
interchanged with row ipiv(i). ipiv(i) is always i or i+1; ipiv(i)
= i indicates a row interchange was not required.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, uii is 0. The factorization has been completed, but U is
exactly singular. Division by zero will occur if you use the factor U for
solving a system of linear equations.
3 Intel® Math Kernel Library Reference Manual
362
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gttrf interface are as follows:
dl Holds the vector of length (n-1).
d Holds the vector of length n.
du Holds the vector of length (n-1).
du2 Holds the vector of length (n-2).
ipiv Holds the vector of length n.
Application Notes
?gbtrs to solve A*X = B or AT*X = B or AH*X = B
?gbcon to estimate the condition number of A.
?dttrfb
Computes the factorization of a diagonally dominant
tridiagonal matrix.
Syntax
Fortran 77:
call sdttrfb( n, dl, d, du, info )
call ddttrfb( n, dl, d, du, info )
call cdttrfb( n, dl, d, du, info )
call zdttrfb( n, dl, d, du, info )
Include Files
• FORTRAN 77: mkl_lapack.fi and mkl_lapack.h
Description
The ?dttrfb routine computes the factorization of a real or complex diagonally dominant tridiagonal matrix
A with the BABE (Burning At Both Ends) algorithm in the form
A = L1*U*L2
where
• L1, L2 are lower bidiagonal with unit diagonal elements corresponding to the Gaussian elimination taken
from both ends of the matrix.
• U is an upper triangular matrix with nonzeroes in only the main diagonal and first two superdiagonals.
Input Parameters
n INTEGER. The order of the matrix A; n = 0.
dl, d, du REAL for sdttrfb
DOUBLE PRECISION for ddttrfb
COMPLEX for cdttrfb
DOUBLE COMPLEX for zdttrfb.
LAPACK Routines: Linear Equations 3
363
Arrays containing elements of A.
The array dl of dimension (n - 1) contains the subdiagonal
elements of A.
The array d of dimension n contains the diagonal elements of A.
The array du of dimension (n - 1) contains the superdiagonal
elements of A.
Output Parameters
dl Overwritten by the (n -1) multipliers that define the matrix L from
the LU factorization of A.
d Overwritten by the n diagonal element reciprocals of the upper
triangular matrix U from the factorization of A.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, uii is 0. The factorization has been completed, but U is
exactly singular. Division by zero will occur if you use the factor U for
solving a system of linear equations.
Application Notes
A diagonally dominant tridiagonal system is defined such that |di| > |dli-1| + |dui| for any i:
1 < i < n, and |d1| > |du1|, |dn| > |dln-1|
The underlying BABE algorithm is designed for diagonally dominant systems. Such systems are free from the
numerical stability issue unlike the canonical systems that use elimination with partial pivoting (see ?gttrf).
The diagonally dominant systems are much faster than the canonical systems.
NOTE
• The current implementation of BABE has a potential accuracy issue on very small or large data
close to the underflow or overflow threshold respectively. Scale the matrix before applying the
solver in the case of such input data.
• Applying the ?dttrfb factorization to non-diagonally dominant systems may lead to an accuracy
loss, or false singularity detected due to no pivoting.
?potrf
Computes the Cholesky factorization of a symmetric
(Hermitian) positive-definite matrix.
Syntax
Fortran 77:
call spotrf( uplo, n, a, lda, info )
call dpotrf( uplo, n, a, lda, info )
call cpotrf( uplo, n, a, lda, info )
call zpotrf( uplo, n, a, lda, info )
Fortran 95:
call potrf( a [, uplo] [,info] )
3 Intel® Math Kernel Library Reference Manual
364
C:
lapack_int LAPACKE_potrf( int matrix_order, char uplo, lapack_int n, * a,
lapack_int lda );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine forms the Cholesky factorization of a symmetric positive-definite or, for complex data, Hermitian
positive-definite matrix A:
A = UT*U for real data, A = UH*U for complex data if uplo='U'
A = L*LT for real data, A = L*LH for complex data if uplo='L'
where L is a lower triangular matrix and U is upper triangular.
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored and
how A is factored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A.
n INTEGER. The order of matrix A; n = 0.
a REAL for spotrf
DOUBLE PRECISION for dpotrf
COMPLEX for cpotrf
DOUBLE COMPLEX for zpotrf.
Array, DIMENSION (lda,*). The array a contains either the upper or
the lower triangular part of the matrix A (see uplo). The second
dimension of a must be at least max(1, n).
lda INTEGER. The leading dimension of a.
Output Parameters
a The upper or lower triangular part of a is overwritten by the Cholesky
factor U or L, as specified by uplo.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
LAPACK Routines: Linear Equations 3
365
If info = i, the leading minor of order i (and therefore the matrix A
itself) is not positive-definite, and the factorization could not be
completed. This may indicate an error in forming the matrix A.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine potrf interface are as follows:
a Holds the matrix A of size (n, n).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
If uplo = 'U', the computed factor U is the exact factor of a perturbed matrix A + E, where
c(n) is a modest linear function of n, and e is the machine precision.
A similar estimate holds for uplo = 'L'.
The total number of floating-point operations is approximately (1/3)n3 for real flavors or (4/3)n3 for
complex flavors.
After calling this routine, you can call the following routines:
?potrs to solve A*X = B
?pocon to estimate the condition number of A
?potri to compute the inverse of A.
See Also
mkl_progress
?pstrf
Computes the Cholesky factorization with complete
pivoting of a real symmetric (complex Hermitian)
positive semidefinite matrix.
Syntax
Fortran 77:
call spstrf( uplo, n, a, lda, piv, rank, tol, work, info )
call dpstrf( uplo, n, a, lda, piv, rank, tol, work, info )
call cpstrf( uplo, n, a, lda, piv, rank, tol, work, info )
call zpstrf( uplo, n, a, lda, piv, rank, tol, work, info )
C:
lapack_int LAPACKE_spstrf( int matrix_order, char uplo, lapack_int n, float* a,
lapack_int lda, lapack_int* piv, lapack_int* rank, float tol );
lapack_int LAPACKE_dpstrf( int matrix_order, char uplo, lapack_int n, double* a,
lapack_int lda, lapack_int* piv, lapack_int* rank, double tol );
3 Intel® Math Kernel Library Reference Manual
366
lapack_int LAPACKE_cpstrf( int matrix_order, char uplo, lapack_int n,
lapack_complex_float* a, lapack_int lda, lapack_int* piv, lapack_int* rank, float
tol );
lapack_int LAPACKE_zpstrf( int matrix_order, char uplo, lapack_int n,
lapack_complex_double* a, lapack_int lda, lapack_int* piv, lapack_int* rank, double
tol );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the Cholesky factorization with complete pivoting of a real symmetric (complex
Hermitian) positive semidefinite matrix. The form of the factorization is:
PT * A * P = UT * U, if uplo ='U' for real flavors,
PH * A * P = UH * U, if uplo ='U' for complex flavors,
PT * A * P = L * LT, if uplo ='L' for real flavors,
PH * A * P = L * LH, if uplo ='L' for complex flavors,
where P is stored as vector piv, 'U' and 'L' are upper and lower triangular matrices respectively.
This algorithm does not attempt to check that A is positive semidefinite. This version of the algorithm calls
level 3 BLAS.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A, and the strictly lower triangular part of the matrix is not
referenced.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A, and the strictly upper triangular part of the matrix is not
referenced.
n INTEGER. The order of matrix A; n = 0.
a, work REAL for spstrf
DOUBLE PRECISION for dpstrf
COMPLEX for cpstrf
DOUBLE COMPLEX for zpstrf.
Array a, DIMENSION (lda,*). The array a contains either the upper
or the lower triangular part of the matrix A (see uplo). The second
dimension of a must be at least max(1, n).
work(*) is a workspace array. The dimension of work is at least
max(1,2*n).
tol REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
LAPACK Routines: Linear Equations 3
367
User difined tolerance. If tol < 0, then n*U*max(a(k,k)) will be
used. The algorithm terminates at the (k-1)-th step, if the pivot =
tol.
lda INTEGER. The leading dimension of a; at least max(1, n).
Output Parameters
a If info = 0, the factor U or L from the Cholesky factorization is as
described in Description.
piv INTEGER.
Array, DIMENSION at least max(1, n). The array piv is such that the
nonzero entries are p( piv(k),k ) = 1.
rank INTEGER.
The rank of a given by the number of steps the algorithm completed.
info INTEGER. If info = 0, the execution is successful.
If info = -k, the k-th argument had an illegal value.
If info > 0, the matrix A is either rank deficient with a computed
rank as returned in rank, or is indefinite.
?pftrf
Computes the Cholesky factorization of a symmetric
(Hermitian) positive-definite matrix using the
Rectangular Full Packed (RFP) format .
Syntax
Fortran 77:
call spftrf( transr, uplo, n, a, info )
call dpftrf( transr, uplo, n, a, info )
call cpftrf( transr, uplo, n, a, info )
call zpftrf( transr, uplo, n, a, info )
C:
lapack_int LAPACKE_pftrf( int matrix_order, char transr, char uplo, lapack_int n,
* a );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine forms the Cholesky factorization of a symmetric positive-definite or, for complex data, a
Hermitian positive-definite matrix A:
A = UT*U for real data, A = UH*U for complex data if uplo='U'
A = L*LT for real data, A = L*LH for complex data if uplo='L'
where L is a lower triangular matrix and U is upper triangular.
The matrix A is in the Rectangular Full Packed (RFP) format. For the description of the RFP format, see Matrix
Storage Schemes.
3 Intel® Math Kernel Library Reference Manual
368
This is the block version of the algorithm, calling Level 3 BLAS.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
transr CHARACTER*1. Must be 'N', 'T' (for real data) or 'C' (for complex
data).
If transr = 'N', the Normal transr of RFP A is stored.
If transr = 'T', the Transpose transr of RFP A is stored.
If transr = 'C', the Conjugate-Transpose transr of RFP A is stored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A.
n INTEGER. The order of the matrix A; n = 0.
a REAL for spftrf
DOUBLE PRECISION for dpftrf
COMPLEX for cpftrf
DOUBLE COMPLEX for zpftrf.
Array, DIMENSION (n*(n+1)/2). The array a contains the matrix A in
the RFP format.
Output Parameters
a The upper or lower triangular part of a is overwritten by the Cholesky
factor U or L, as specified by info.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the leading minor of order i (and therefore the matrix A
itself) is not positive-definite, and the factorization could not be
completed. This may indicate an error in forming the matrix A.
?pptrf
Computes the Cholesky factorization of a symmetric
(Hermitian) positive-definite matrix using packed
storage.
Syntax
Fortran 77:
call spptrf( uplo, n, ap, info )
call dpptrf( uplo, n, ap, info )
call cpptrf( uplo, n, ap, info )
call zpptrf( uplo, n, ap, info )
Fortran 95:
call pptrf( ap [, uplo] [,info] )
LAPACK Routines: Linear Equations 3
369
C:
lapack_int LAPACKE_pptrf( int matrix_order, char uplo, lapack_int n, *
ap );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine forms the Cholesky factorization of a symmetric positive-definite or, for complex data, Hermitian
positive-definite packed matrix A:
A = UT*U for real data, A = UH*U for complex data if uplo='U'
A = L*LT for real data, A = L*LH for complex data if uplo='L'
where L is a lower triangular matrix and U is upper triangular.
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is packed in
the array ap, and how A is factored:
If uplo = 'U', the array ap stores the upper triangular part of the
matrix A, and A is factored as UH*U.
If uplo = 'L', the array ap stores the lower triangular part of the
matrix A; A is factored as L*LH.
n INTEGER. The order of matrix A; n = 0.
ap REAL for spptrf
DOUBLE PRECISION for dpptrf
COMPLEX for cpptrf
DOUBLE COMPLEX for zpptrf.
Array, DIMENSION at least max(1, n(n+1)/2). The array ap contains
either the upper or the lower triangular part of the matrix A (as
specified by uplo) in packed storage (see Matrix Storage Schemes).
Output Parameters
ap The upper or lower triangular part of A in packed storage is
overwritten by the Cholesky factor U or L, as specified by uplo.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the leading minor of order i (and therefore the matrix A
itself) is not positive-definite, and the factorization could not be
completed. This may indicate an error in forming the matrix A.
3 Intel® Math Kernel Library Reference Manual
370
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pptrf interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
If uplo = 'U', the computed factor U is the exact factor of a perturbed matrix A + E, where
c(n) is a modest linear function of n, and e is the machine precision.
A similar estimate holds for uplo = 'L'.
The total number of floating-point operations is approximately (1/3)n3 for real flavors and (4/3)n3 for
complex flavors.
After calling this routine, you can call the following routines:
?pptrs to solve A*X = B
?ppcon to estimate the condition number of A
?pptri to compute the inverse of A.
See Also
mkl_progress
?pbtrf
Computes the Cholesky factorization of a symmetric
(Hermitian) positive-definite band matrix.
Syntax
Fortran 77:
call spbtrf( uplo, n, kd, ab, ldab, info )
call dpbtrf( uplo, n, kd, ab, ldab, info )
call cpbtrf( uplo, n, kd, ab, ldab, info )
call zpbtrf( uplo, n, kd, ab, ldab, info )
Fortran 95:
call pbtrf( ab [, uplo] [,info] )
C:
lapack_int LAPACKE_pbtrf( int matrix_order, char uplo, lapack_int n, lapack_int kd,
* ab, lapack_int ldab );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
LAPACK Routines: Linear Equations 3
371
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine forms the Cholesky factorization of a symmetric positive-definite or, for complex data, Hermitian
positive-definite band matrix A:
A = UT*U for real data, A = UH*U for complex data if uplo='U'
A = L*LT for real data, A = L*LH for complex data if uplo='L'
where L is a lower triangular matrix and U is upper triangular.
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored in
the array ab, and how A is factored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
kd INTEGER. The number of superdiagonals or subdiagonals in the matrix
A; kd = 0.
ab REAL for spbtrf
DOUBLE PRECISION for dpbtrf
COMPLEX for cpbtrf
DOUBLE COMPLEX for zpbtrf.
Array, DIMENSION (,*). The array ab contains either the upper or the
lower triangular part of the matrix A (as specified by uplo) in band
storage (see Matrix Storage Schemes). The second dimension of ab
must be at least max(1, n).
ldab INTEGER. The leading dimension of the array ab. (ldab = kd + 1)
Output Parameters
ab The upper or lower triangular part of A (in band storage) is
overwritten by the Cholesky factor U or L, as specified by uplo.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the leading minor of order i (and therefore the matrix A
itself) is not positive-definite, and the factorization could not be
completed. This may indicate an error in forming the matrix A.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
3 Intel® Math Kernel Library Reference Manual
372
Specific details for the routine pbtrf interface are as follows:
ab Holds the array A of size (kd+1,n).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
If uplo = 'U', the computed factor U is the exact factor of a perturbed matrix A + E, where
c(n) is a modest linear function of n, and e is the machine precision.
A similar estimate holds for uplo = 'L'.
The total number of floating-point operations for real flavors is approximately n(kd+1)2. The number of
operations for complex flavors is 4 times greater. All these estimates assume that kd is much less than n.
After calling this routine, you can call the following routines:
?pbtrs to solve A*X = B
?pbcon to estimate the condition number of A.
See Also
mkl_progress
?pttrf
Computes the factorization of a symmetric (Hermitian)
positive-definite tridiagonal matrix.
Syntax
Fortran 77:
call spttrf( n, d, e, info )
call dpttrf( n, d, e, info )
call cpttrf( n, d, e, info )
call zpttrf( n, d, e, info )
Fortran 95:
call pttrf( d, e [,info] )
C:
lapack_int LAPACKE_spttrf( lapack_int n, float* d, float* e );
lapack_int LAPACKE_dpttrf( lapack_int n, double* d, double* e );
lapack_int LAPACKE_cpttrf( lapack_int n, float* d, lapack_complex_float* e );
lapack_int LAPACKE_zpttrf( lapack_int n, double* d, lapack_complex_double* e );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
LAPACK Routines: Linear Equations 3
373
Description
The routine forms the factorization of a symmetric positive-definite or, for complex data, Hermitian positivedefinite
tridiagonal matrix A:
A = L*D*LT for real flavors, or
A = L*D*LH for complex flavors,
where D is diagonal and L is unit lower bidiagonal. The factorization may also be regarded as having the form
A = UT*D*U for real flavors, or A = UH*D*U for complex flavors, where D is unit upper bidiagonal.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The order of the matrix A; n = 0.
d REAL for spttrf, cpttrf
DOUBLE PRECISION for dpttrf, zpttrf.
Array, dimension (n). Contains the diagonal elements of A.
e REAL for spttrf
DOUBLE PRECISION for dpttrf
COMPLEX for cpttrf
DOUBLE COMPLEX for zpttrf. Array, dimension (n -1). Contains the
subdiagonal elements of A.
Output Parameters
d Overwritten by the n diagonal elements of the diagonal matrix D from
the L*D*LT (for real flavors) or L*D*LH (for complex flavors)
factorization of A.
e Overwritten by the (n - 1) off-diagonal elements of the unit
bidiagonal factor L or U from the factorization of A.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the leading minor of order i (and therefore the matrix A
itself) is not positive-definite; if i < n, the factorization could not be
completed, while if i = n, the factorization was completed, but d(n)
= 0.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pttrf interface are as follows:
d Holds the vector of length n.
e Holds the vector of length (n-1).
?sytrf
Computes the Bunch-Kaufman factorization of a
symmetric matrix.
3 Intel® Math Kernel Library Reference Manual
374
Syntax
Fortran 77:
call ssytrf( uplo, n, a, lda, ipiv, work, lwork, info )
call dsytrf( uplo, n, a, lda, ipiv, work, lwork, info )
call csytrf( uplo, n, a, lda, ipiv, work, lwork, info )
call zsytrf( uplo, n, a, lda, ipiv, work, lwork, info )
Fortran 95:
call sytrf( a [, uplo] [,ipiv] [,info] )
C:
lapack_int LAPACKE_sytrf( int matrix_order, char uplo, lapack_int n, * a,
lapack_int lda, lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the factorization of a real/complex symmetric matrix A using the Bunch-Kaufman
diagonal pivoting method. The form of the factorization is:
if uplo='U', A = P*U*D*UT*PT
if uplo='L', A = P*L*D*LT*PT,
where A is the input matrix, P is a permutation matrix, U and L are upper and lower triangular matrices with
unit diagonal, and D is a symmetric block-diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks. U and L
have 2-by-2 unit diagonal blocks corresponding to the 2-by-2 blocks of D.
NOTE This routine supports the Progress Routine feature. See Progress Routine section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored and
how A is factored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A, and A is factored as P*U*D*UT*PT.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A, and A is factored as P*L*D*LT*PT.
n INTEGER. The order of matrix A; n = 0.
a REAL for ssytrf
DOUBLE PRECISION for dsytrf
COMPLEX for csytrf
DOUBLE COMPLEX for zsytrf.
LAPACK Routines: Linear Equations 3
375
Array, DIMENSION (lda,*). The array a contains either the upper or
the lower triangular part of the matrix A (see uplo). The second
dimension of a must be at least max(1, n).
lda INTEGER. The leading dimension of a; at least max(1, n).
work Same type as a. A workspace array, dimension at least
max(1,lwork).
lwork INTEGER. The size of the work array (lwork = n).
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the
first entry of the work array, and no error message related to lwork is
issued by xerbla.
See Application Notes for the suggested value of lwork.
Output Parameters
a The upper or lower triangular part of a is overwritten by details of the
block-diagonal matrix D and the multipliers used to obtain the factor U
(or L).
work(1) If info=0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent
runs.
ipiv INTEGER.
Array, DIMENSION at least max(1, n). Contains details of the
interchanges and the block structure of D. If ipiv(i) = k >0, then
dii is a 1-by-1 block, and the i-th row and column of A was
interchanged with the k-th row and column.
If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-by-2
block in rows/columns i and i-1, and (i-1)-th row and column of A
was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-by-2
block in rows/columns i and i+1, and (i+1)-th row and column of A
was interchanged with the m-th row and column.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, Dii is 0. The factorization has been completed, but D is
exactly singular. Division by 0 will occur if you use D for solving a
system of linear equations.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sytrf interface are as follows:
a holds the matrix A of size (n, n)
ipiv holds the vector of length n
uplo must be 'U' or 'L'. The default value is 'U'.
Application Notes
For better performance, try using lwork = n*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
3 Intel® Math Kernel Library Reference Manual
376
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The 2-by-2 unit diagonal blocks and the unit diagonal elements of U and L are not stored. The remaining
elements of U and L are stored in the corresponding columns of the array a, but additional row interchanges
are required to recover U or L explicitly (which is seldom necessary).
If ipiv(i) = i for all i =1...n, then all off-diagonal elements of U (L) are stored explicitly in the
corresponding elements of the array a.
If uplo = 'U', the computed factors U and D are the exact factors of a perturbed matrix A + E, where
|E| = c(n)e P|U||D||UT|PT
c(n) is a modest linear function of n, and e is the machine precision. A similar estimate holds for the
computed L and D when uplo = 'L'.
The total number of floating-point operations is approximately (1/3)n3 for real flavors or (4/3)n3 for
complex flavors.
After calling this routine, you can call the following routines:
?sytrs to solve A*X = B
?sycon to estimate the condition number of A
?sytri to compute the inverse of A.
If uplo = 'U', then A = U*D*U', where
U = P(n)*U(n)* ... *P(k)*U(k)*...,
that is, U is a product of terms P(k)*U(k), where
• k decreases from n to 1 in steps of 1 and 2.
• D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k).
• P(k) is a permutation matrix as defined by ipiv(k).
• U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k).
LAPACK Routines: Linear Equations 3
377
If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k) and A(k,k), and v overwrites A(1:k-2,k
-1:k).
If uplo = 'L', then A = L*D*L', where
L = P(1)*L(1)* ... *P(k)*L(k)*...,
that is, L is a product of terms P(k)*L(k), where
• k decreases from 1 to n in steps of 1 and 2.
• D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k).
• P(k) is a permutation matrix as defined by ipiv(k).
• L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k).
If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k
+2:n,k:k+1).
See Also
mkl_progress
?hetrf
Computes the Bunch-Kaufman factorization of a
complex Hermitian matrix.
Syntax
Fortran 77:
call chetrf( uplo, n, a, lda, ipiv, work, lwork, info )
call zhetrf( uplo, n, a, lda, ipiv, work, lwork, info )
Fortran 95:
call hetrf( a [, uplo] [,ipiv] [,info] )
C:
lapack_int LAPACKE_hetrf( int matrix_order, char uplo, lapack_int n, * a,
lapack_int lda, lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
3 Intel® Math Kernel Library Reference Manual
378
Description
The routine computes the factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal
pivoting method:
if uplo='U', A = P*U*D*UH*PT
if uplo='L', A = P*L*D*LH*PT,
where A is the input matrix, P is a permutation matrix, U and L are upper and lower triangular matrices with
unit diagonal, and D is a Hermitian block-diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks. U and L
have 2-by-2 unit diagonal blocks corresponding to the 2-by-2 blocks of D.
NOTE This routine supports the Progress Routine feature. See Progress Routine section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored and
how A is factored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A, and A is factored as P*U*D*UH*PT.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A, and A is factored as P*L*D*LH*PT.
n INTEGER. The order of matrix A; n = 0.
a, work COMPLEX for chetrf
DOUBLE COMPLEX for zhetrf.
Arrays, DIMENSION a(lda,*), work(*).
The array a contains the upper or the lower triangular part of the
matrix A (see uplo). The second dimension of a must be at least
max(1, n).
work(*) is a workspace array of dimension at least max(1, lwork).
lda INTEGER. The leading dimension of a; at least max(1, n).
lwork INTEGER. The size of the work array (lwork = n).
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the
first entry of the work array, and no error message related to lwork is
issued by xerbla.
See Application Notes for the suggested value of lwork.
Output Parameters
a The upper or lower triangular part of a is overwritten by details of the
block-diagonal matrix D and the multipliers used to obtain the factor U
(or L).
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent
runs.
ipiv INTEGER.
LAPACK Routines: Linear Equations 3
379
Array, DIMENSION at least max(1, n). Contains details of the
interchanges and the block structure of D. If ipiv(i) = k > 0, then
dii is a 1-by-1 block, and the i-th row and column of A was
interchanged with the k-th row and column.
If uplo = 'U' and ipiv(i) = ipiv(i-1) = -m < 0, then D has a 2-by-2
block in rows/columns i and i-1, and the (i-1)-th row and column of
A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) = ipiv(i+1) = -m < 0, then D has a
2-by-2 block in rows/columns i and i+1, and the (i+1)-th row and
column of A was interchanged with the m-th row and column.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, dii is 0. The factorization has been completed, but D is
exactly singular. Division by 0 will occur if you use D for solving a
system of linear equations.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hetrf interface are as follows:
a holds the matrix A of size (n, n)
ipiv holds the vector of length n
uplo must be 'U' or 'L'. The default value is 'U'.
Application Notes
This routine is suitable for Hermitian matrices that are not known to be positive-definite. If A is in fact
positive-definite, the routine does not perform interchanges, and no 2-by-2 diagonal blocks occur in D.
For better performance, try using lwork = n*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The 2-by-2 unit diagonal blocks and the unit diagonal elements of U and L are not stored. The remaining
elements of U and L are stored in the corresponding columns of the array a, but additional row interchanges
are required to recover U or L explicitly (which is seldom necessary).
If ipiv(i) = i for all i =1...n, then all off-diagonal elements of U (L) are stored explicitly in the
corresponding elements of the array a.
If uplo = 'U', the computed factors U and D are the exact factors of a perturbed matrix A + E, where
|E| = c(n)e P|U||D||UT|PT
3 Intel® Math Kernel Library Reference Manual
380
c(n) is a modest linear function of n, and e is the machine precision.
A similar estimate holds for the computed L and D when uplo = 'L'.
The total number of floating-point operations is approximately (4/3)n3.
After calling this routine, you can call the following routines:
?hetrs to solve A*X = B
?hecon to estimate the condition number of A
?hetri to compute the inverse of A.
See Also
mkl_progress
?sptrf
Computes the Bunch-Kaufman factorization of a
symmetric matrix using packed storage.
Syntax
Fortran 77:
call ssptrf( uplo, n, ap, ipiv, info )
call dsptrf( uplo, n, ap, ipiv, info )
call csptrf( uplo, n, ap, ipiv, info )
call zsptrf( uplo, n, ap, ipiv, info )
Fortran 95:
call sptrf( ap [,uplo] [,ipiv] [,info] )
C:
lapack_int LAPACKE_sptrf( int matrix_order, char uplo, lapack_int n, * ap,
lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the factorization of a real/complex symmetric matrix A stored in the packed format
using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is:
if uplo='U', A = P*U*D*UT*PT
if uplo='L', A = P*L*D*LT*PT,
where P is a permutation matrix, U and L are upper and lower triangular matrices with unit diagonal, and D is
a symmetric block-diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks. U and L have 2-by-2 unit
diagonal blocks corresponding to the 2-by-2 blocks of D.
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
LAPACK Routines: Linear Equations 3
381
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is packed in
the array ap and how A is factored:
If uplo = 'U', the array ap stores the upper triangular part of the
matrix A, and A is factored as P*U*D*UT*PT.
If uplo = 'L', the array ap stores the lower triangular part of the
matrix A, and A is factored as P*L*D*LT*PT.
n INTEGER. The order of matrix A; n = 0.
ap REAL for ssptrf
DOUBLE PRECISION for dsptrf
COMPLEX for csptrf
DOUBLE COMPLEX for zsptrf.
Array, DIMENSION at least max(1, n(n+1)/2). The array ap contains
the upper or the lower triangular part of the matrix A (as specified by
uplo) in packed storage (see Matrix Storage Schemes).
Output Parameters
ap The upper or lower triangle of A (as specified by uplo) is overwritten
by details of the block-diagonal matrix D and the multipliers used to
obtain the factor U (or L).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). Contains details of the
interchanges and the block structure of D. If ipiv(i) = k > 0, then
dii is a 1-by-1 block, and the i-th row and column of A was
interchanged with the k-th row and column.
If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-by-2
block in rows/columns i and i-1, and the (i-1)-th row and column of
A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-by-2
block in rows/columns i and i+1, and the (i+1)-th row and column of
A was interchanged with the m-th row and column.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, dii is 0. The factorization has been completed, but D is
exactly singular. Division by 0 will occur if you use D for solving a
system of linear equations.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sptrf interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
3 Intel® Math Kernel Library Reference Manual
382
Application Notes
The 2-by-2 unit diagonal blocks and the unit diagonal elements of U and L are not stored. The remaining
elements of U and L overwrite elements of the corresponding columns of the matrix A, but additional row
interchanges are required to recover U or L explicitly (which is seldom necessary).
If ipiv(i) = i for all i = 1...n, then all off-diagonal elements of U (L) are stored explicitly in packed form.
If uplo = 'U', the computed factors U and D are the exact factors of a perturbed matrix A + E, where
|E| = c(n)e P|U||D||UT|PT
c(n) is a modest linear function of n, and e is the machine precision. A similar estimate holds for the
computed L and D when uplo = 'L'.
The total number of floating-point operations is approximately (1/3)n3 for real flavors or (4/3)n3 for
complex flavors.
After calling this routine, you can call the following routines:
?sptrs to solve A*X = B
?spcon to estimate the condition number of A
?sptri to compute the inverse of A.
See Also
mkl_progress
?hptrf
Computes the Bunch-Kaufman factorization of a
complex Hermitian matrix using packed storage.
Syntax
Fortran 77:
call chptrf( uplo, n, ap, ipiv, info )
call zhptrf( uplo, n, ap, ipiv, info )
Fortran 95:
call hptrf( ap [,uplo] [,ipiv] [,info] )
C:
lapack_int LAPACKE_hptrf( int matrix_order, char uplo, lapack_int n, * ap,
lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the factorization of a complex Hermitian packed matrix A using the Bunch-Kaufman
diagonal pivoting method:
if uplo='U', A = P*U*D*UH*PT
if uplo='L', A = P*L*D*LH*PT,
LAPACK Routines: Linear Equations 3
383
where A is the input matrix, P is a permutation matrix, U and L are upper and lower triangular matrices with
unit diagonal, and D is a Hermitian block-diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks. U and L
have 2-by-2 unit diagonal blocks corresponding to the 2-by-2 blocks of D.
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is packed
and how A is factored:
If uplo = 'U', the array ap stores the upper triangular part of the
matrix A, and A is factored as P*U*D*UH*PT.
If uplo = 'L', the array ap stores the lower triangular part of the
matrix A, and A is factored as P*L*D*LH*PT.
n INTEGER. The order of matrix A; n = 0.
ap COMPLEX for chptrf
DOUBLE COMPLEX for zhptrf.
Array, DIMENSION at least max(1, n(n+1)/2). The array ap contains
the upper or the lower triangular part of the matrix A (as specified by
uplo) in packed storage (see Matrix Storage Schemes).
Output Parameters
ap The upper or lower triangle of A (as specified by uplo) is overwritten
by details of the block-diagonal matrix D and the multipliers used to
obtain the factor U (or L).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). Contains details of the
interchanges and the block structure of D. If ipiv(i) = k > 0, then
dii is a 1-by-1 block, and the i-th row and column of A was
interchanged with the k-th row and column.
If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-by-2
block in rows/columns i and i-1, and the (i-1)-th row and column of
A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-by-2
block in rows/columns i and i+1, and the (i+1)-th row and column of
A was interchanged with the m-th row and column.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, dii is 0. The factorization has been completed, but D is
exactly singular. Division by 0 will occur if you use D for solving a
system of linear equations.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
3 Intel® Math Kernel Library Reference Manual
384
Specific details for the routine hptrf interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The 2-by-2 unit diagonal blocks and the unit diagonal elements of U and L are not stored. The remaining
elements of U and L are stored in the corresponding columns of the array a, but additional row interchanges
are required to recover U or L explicitly (which is seldom necessary).
If ipiv(i) = i for all i = 1...n, then all off-diagonal elements of U (L) are stored explicitly in the
corresponding elements of the array a.
If uplo = 'U', the computed factors U and D are the exact factors of a perturbed matrix A + E, where
|E| = c(n)e P|U||D||UT|PT
c(n) is a modest linear function of n, and e is the machine precision.
A similar estimate holds for the computed L and D when uplo = 'L'.
The total number of floating-point operations is approximately (4/3)n3.
After calling this routine, you can call the following routines:
?hptrs to solve A*X = B
?hpcon to estimate the condition number of A
?hptri to compute the inverse of A.
See Also
mkl_progress
Routines for Solving Systems of Linear Equations
This section describes the LAPACK routines for solving systems of linear equations. Before calling most of
these routines, you need to factorize the matrix of your system of equations (see Routines for Matrix
Factorization in this chapter). However, the factorization is not necessary if your system of equations has a
triangular matrix.
?getrs
Solves a system of linear equations with an LUfactored
square matrix, with multiple right-hand sides.
Syntax
Fortran 77:
call sgetrs( trans, n, nrhs, a, lda, ipiv, b, ldb, info )
call dgetrs( trans, n, nrhs, a, lda, ipiv, b, ldb, info )
call cgetrs( trans, n, nrhs, a, lda, ipiv, b, ldb, info )
call zgetrs( trans, n, nrhs, a, lda, ipiv, b, ldb, info )
Fortran 95:
call getrs( a, ipiv, b [, trans] [,info] )
LAPACK Routines: Linear Equations 3
385
C:
lapack_int LAPACKE_getrs( int matrix_order, char trans, lapack_int n, lapack_int
nrhs, const * a, lapack_int lda, const lapack_int* ipiv, * b,
lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the following systems of linear equations:
A*X = B if trans='N',
AT*X = B if trans='T',
AH*X = B if trans='C' (for complex matrices only).
Before calling this routine, you must call ?getrf to compute the LU factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
Indicates the form of the equations:
If trans = 'N', then A*X = B is solved for X.
If trans = 'T', then AT*X = B is solved for X.
If trans = 'C', then AH*X = B is solved for X.
n INTEGER. The order of A; the number of rows in B(n = 0).
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
a, b REAL for sgetrs
DOUBLE PRECISION for dgetrs
COMPLEX for cgetrs
DOUBLE COMPLEX for zgetrs.
Arrays: a(lda,*), b(ldb,*).
The array a contains LU factorization of matrix A resulting from the
call of ?getrf .
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
The second dimension of a must be at least max(1,n), the second
dimension of b at least max(1,nrhs).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?getrf.
Output Parameters
b Overwritten by the solution matrix X.
3 Intel® Math Kernel Library Reference Manual
386
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine getrs interface are as follows:
a Holds the matrix A of size (n, n).
b Holds the matrix B of size (n, nrhs).
ipiv Holds the vector of length n.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(n)e P|L||U|
c(n) is a modest linear function of n, and e is the machine precision.
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A); the condition number of AT and AH might or might
not be equal to ?8(A).
The approximate number of floating-point operations for one right-hand side vector b is 2n2 for real flavors
and 8n2 for complex flavors.
To estimate the condition number ?8(A), call ?gecon.
To refine the solution and estimate the error, call ?gerfs.
?gbtrs
Solves a system of linear equations with an LUfactored
band matrix, with multiple right-hand sides.
Syntax
Fortran 77:
call sgbtrs( trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info )
call dgbtrs( trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info )
call cgbtrs( trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info )
call zgbtrs( trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info )
LAPACK Routines: Linear Equations 3
387
Fortran 95:
call gbtrs( ab, b, ipiv, [, kl] [, trans] [, info] )
C:
lapack_int LAPACKE_gbtrs( int matrix_order, char trans, lapack_int n, lapack_int kl,
lapack_int ku, lapack_int nrhs, const * ab, lapack_int ldab, const
lapack_int* ipiv, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the following systems of linear equations:
A*X = B if trans='N',
AT*X = B if trans='T',
AH*X = B if trans='C' (for complex matrices only).
Here A is an LU-factored general band matrix of order n with kl non-zero subdiagonals and ku nonzero
superdiagonals. Before calling this routine, call ?gbtrf to compute the LU factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
n INTEGER. The order of A; the number of rows in B; n = 0.
kl INTEGER. The number of subdiagonals within the band of A; kl = 0.
ku INTEGER. The number of superdiagonals within the band of A; ku = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ab, b REAL for sgbtrs
DOUBLE PRECISION for dgbtrs
COMPLEX for cgbtrs
DOUBLE COMPLEX for zgbtrs.
Arrays: ab(ldab,*), b(ldb,*).
The array ab contains the matrix A in band storage (see Matrix
Storage Schemes).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
The second dimension of ab must be at least max(1, n), and the
second dimension of b at least max(1,nrhs).
ldab INTEGER. The leading dimension of the array ab; ldab = 2*kl + ku
+1.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER. Array, DIMENSION at least max(1, n). The ipiv array, as
returned by ?gbtrf.
3 Intel® Math Kernel Library Reference Manual
388
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gbtrs interface are as follows:
ab Holds the array A of size (2*kl+ku+1,n).
b Holds the matrix B of size (n, nrhs).
ipiv Holds the vector of length min(m, n).
kl If omitted, assumed kl = ku.
ku Restored as lda-2*kl-1.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(kl + ku + 1)e P|L||U|
c(k) is a modest linear function of k, and e is the machine precision.
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A); the condition number of AT and AH might or might
not be equal to ?8(A).
The approximate number of floating-point operations for one right-hand side vector is 2n(ku + 2kl) for real
flavors. The number of operations for complex flavors is 4 times greater. All these estimates assume that kl
and ku are much less than min(m,n).
To estimate the condition number ?8(A), call ?gbcon.
To refine the solution and estimate the error, call ?gbrfs.
?gttrs
Solves a system of linear equations with a tridiagonal
matrix using the LU factorization computed by ?
gttrf.
LAPACK Routines: Linear Equations 3
389
Syntax
Fortran 77:
call sgttrs( trans, n, nrhs, dl, d, du, du2, ipiv, b, ldb, info )
call dgttrs( trans, n, nrhs, dl, d, du, du2, ipiv, b, ldb, info )
call cgttrs( trans, n, nrhs, dl, d, du, du2, ipiv, b, ldb, info )
call zgttrs( trans, n, nrhs, dl, d, du, du2, ipiv, b, ldb, info )
Fortran 95:
call gttrs( dl, d, du, du2, b, ipiv [, trans] [,info] )
C:
lapack_int LAPACKE_gttrs( int matrix_order, char trans, lapack_int n, lapack_int
nrhs, const * dl, const * d, const * du, const
* du2, const lapack_int* ipiv, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the following systems of linear equations with multiple right hand sides:
A*X = B if trans='N',
AT*X = B if trans='T',
AH*X = B if trans='C' (for complex matrices only).
Before calling this routine, you must call ?gttrf to compute the LU factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
Indicates the form of the equations:
If trans = 'N', then A*X = B is solved for X.
If trans = 'T', then AT*X = B is solved for X.
If trans = 'C', then AH*X = B is solved for X.
n INTEGER. The order of A; n = 0.
nrhs INTEGER. The number of right-hand sides, that is, the number of
columns in B; nrhs = 0.
dl,d,du,du2,b REAL for sgttrs
DOUBLE PRECISION for dgttrs
COMPLEX for cgttrs
DOUBLE COMPLEX for zgttrs.
Arrays: dl(n -1), d(n), du(n -1), du2(n -2), b(ldb,nrhs).
The array dl contains the (n - 1) multipliers that define the matrix L
from the LU factorization of A.
3 Intel® Math Kernel Library Reference Manual
390
The array d contains the n diagonal elements of the upper triangular
matrix U from the LU factorization of A.
The array du contains the (n - 1) elements of the first superdiagonal
of U.
The array du2 contains the (n - 2) elements of the second
superdiagonal of U.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER. Array, DIMENSION (n). The ipiv array, as returned by ?
gttrf.
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gttrs interface are as follows:
dl Holds the vector of length (n-1).
d Holds the vector of length n.
du Holds the vector of length (n-1).
du2 Holds the vector of length (n-2).
b Holds the matrix B of size (n, nrhs).
ipiv Holds the vector of length n.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(n)e P|L||U|
c(n) is a modest linear function of n, and e is the machine precision.
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A); the condition number of AT and AH might or might
not be equal to ?8(A).
LAPACK Routines: Linear Equations 3
391
The approximate number of floating-point operations for one right-hand side vector b is 7n (including n
divisions) for real flavors and 34n (including 2n divisions) for complex flavors.
To estimate the condition number ?8(A), call ?gtcon.
To refine the solution and estimate the error, call ?gtrfs.
?dttrsb
Solves a system of linear equations with a diagonally
dominant tridiagonal matrix using the LU factorization
computed by ?dttrfb.
Syntax
Fortran 77:
call sdttrsb( trans, n, nrhs, dl, d, du, b, ldb, info )
call ddttrsb( trans, n, nrhs, dl, d, du, b, ldb, info )
call cdttrsb( trans, n, nrhs, dl, d, du, b, ldb, info )
call zdttrsb( trans, n, nrhs, dl, d, du, b, ldb, info )
Include Files
• FORTRAN 77: mkl_lapack.fi and mkl_lapack.h
Description
The ?dttrsb routine solves the following systems of linear equations with multiple right hand sides for X:
A*X = B if trans='N',
AT*X = B if trans='T',
AH*X = B if trans='C' (for complex matrices only).
Before calling this routine, call ?dttrfb to compute the factorization of A.
Input Parameters
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
Indicates the form of the equations solved for X:
If trans = 'N', then A*X = B.
If trans = 'T', then AT*X = B.
If trans = 'C', then AH*X = B.
n INTEGER. The order of A; n = 0.
nrhs INTEGER. The number of right-hand sides, that is, the number of
columns in B; nrhs = 0.
dl, d, du, b REAL for sdttrsb
DOUBLE PRECISION for ddttrsb
COMPLEX for cdttrsb
DOUBLE COMPLEX for zdttrsb.
Arrays: dl(n -1), d(n), du(n -1), b(ldb,nrhs).
The array dl contains the (n - 1) multipliers that define the
matrices L1, L2 from the factorization of A.
The array d contains the n diagonal elements of the upper triangular
matrix U from the factorization of A.
The array du contains the (n - 1) elements of the superdiagonal of U.
3 Intel® Math Kernel Library Reference Manual
392
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
?potrs
Solves a system of linear equations with a Choleskyfactored
symmetric (Hermitian) positive-definite
matrix.
Syntax
Fortran 77:
call spotrs( uplo, n, nrhs, a, lda, b, ldb, info )
call dpotrs( uplo, n, nrhs, a, lda, b, ldb, info )
call cpotrs( uplo, n, nrhs, a, lda, b, ldb, info )
call zpotrs( uplo, n, nrhs, a, lda, b, ldb, info )
Fortran 95:
call potrs( a, b [,uplo] [, info] )
C:
lapack_int LAPACKE_potrs( int matrix_order, char uplo, lapack_int n, lapack_int
nrhs, const * a, lapack_int lda, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the system of linear equations A*X = B with a symmetric positive-definite or, for
complex data, Hermitian positive-definite matrix A, given the Cholesky factorization of A:
A = UT*U for real data, A = UH*U for complex data if uplo='U'
A = L*LT for real data, A = L*LH for complex data if uplo='L'
where L is a lower triangular matrix and U is upper triangular. The system is solved with multiple right-hand
sides stored in the columns of the matrix B.
Before calling this routine, you must call ?potrf to compute the Cholesky factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
LAPACK Routines: Linear Equations 3
393
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides (nrhs = 0).
a, b REAL for spotrs
DOUBLE PRECISION for dpotrs
COMPLEX for cpotrs
DOUBLE COMPLEX for zpotrs.
Arrays: a(lda,*), b(ldb,*).
The array a contains the factor U or L (see uplo).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
The second dimension of a must be at least max(1,n), the second
dimension of b at least max(1,nrhs).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine potrs interface are as follows:
a Holds the matrix A of size (n, n).
b Holds the matrix B of size (n, nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
If uplo = 'U', the computed solution for each right-hand side b is the exact solution of a perturbed system
of equations (A + E)x = b, where
|E| = c(n)e |UH||U|
c(n) is a modest linear function of n, and e is the machine precision.
A similar estimate holds for uplo = 'L'. If x0 is the true solution, the computed solution x satisfies this
error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
3 Intel® Math Kernel Library Reference Manual
394
Note that cond(A,x) can be much smaller than ?8 (A). The approximate number of floating-point operations
for one right-hand side vector b is 2n2 for real flavors and 8n2 for complex flavors.
To estimate the condition number ?8(A), call ?pocon.
To refine the solution and estimate the error, call ?porfs.
?pftrs
Solves a system of linear equations with a Choleskyfactored
symmetric (Hermitian) positive-definite
matrix using the Rectangular Full Packed (RFP)
format.
Syntax
Fortran 77:
call spftrs( transr, uplo, n, nrhs, a, b, ldb, info )
call dpftrs( transr, uplo, n, nrhs, a, b, ldb, info )
call cpftrs( transr, uplo, n, nrhs, a, b, ldb, info )
call zpftrs( transr, uplo, n, nrhs, a, b, ldb, info )
C:
lapack_int LAPACKE_pftrs( int matrix_order, char transr, char uplo, lapack_int n,
lapack_int nrhs, const * a, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves a system of linear equations A*X = B with a symmetric positive-definite or, for complex
data, Hermitian positive-definite matrix A using the Cholesky factorization of A:
A = UT*U for real data, A = UH*U for complex data if uplo='U'
A = L*LT for real data, A = L*LH for complex data if uplo='L'
computed by ?pftrf. L stands for a lower triangular matrix and U - for an upper triangular matrix.
The matrix A is in the Rectangular Full Packed (RFP) format. For the description of the RFP format, see Matrix
Storage Schemes.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
transr CHARACTER*1. Must be 'N', 'T' (for real data) or 'C' (for complex
data).
If transr = 'N', the Normal transr of RFP A is stored.
If transr = 'T', the Transpose transr of RFP A is stored.
If transr = 'C', the Conjugate-Transpose transr of RFP A is stored.
uplo CHARACTER*1. Must be 'U' or 'L'.
LAPACK Routines: Linear Equations 3
395
Indicates whether the upper or lower triangular part of the RFP matrix
A is stored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, that is, the number of
columns of the matrix B; nrhs = 0.
a, b REAL for spftrs
DOUBLE PRECISION for dpftrs
COMPLEX for cpftrs
DOUBLE COMPLEX for zpftrs.
Arrays: a(n*(n+1)/2), b(ldb,nrhs). The array a contains the
matrix A in the RFP format.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b The solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
?pptrs
Solves a system of linear equations with a packed
Cholesky-factored symmetric (Hermitian) positivedefinite
matrix.
Syntax
Fortran 77:
call spptrs( uplo, n, nrhs, ap, b, ldb, info )
call dpptrs( uplo, n, nrhs, ap, b, ldb, info )
call cpptrs( uplo, n, nrhs, ap, b, ldb, info )
call zpptrs( uplo, n, nrhs, ap, b, ldb, info )
Fortran 95:
call pptrs( ap, b [,uplo] [,info] )
C:
lapack_int LAPACKE_pptrs( int matrix_order, char uplo, lapack_int n, lapack_int
nrhs, const * ap, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
3 Intel® Math Kernel Library Reference Manual
396
Description
The routine solves for X the system of linear equations A*X = B with a packed symmetric positive-definite
or, for complex data, Hermitian positive-definite matrix A, given the Cholesky factorization of A:
A = UT*U for real data, A = UH*U for complex data if uplo='U'
A = L*LT for real data, A = L*LH for complex data if uplo='L'
where L is a lower triangular matrix and U is upper triangular. The system is solved with multiple right-hand
sides stored in the columns of the matrix B.
Before calling this routine, you must call ?pptrf to compute the Cholesky factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides (nrhs = 0).
ap, b REAL for spptrs
DOUBLE PRECISION for dpptrs
COMPLEX for cpptrs
DOUBLE COMPLEX for zpptrs.
Arrays: ap(*), b(ldb,*)
The dimension of ap must be at least max(1,n(n+1)/2).
The array ap contains the factor U or L, as specified by uplo, in
packed storage (see Matrix Storage Schemes).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1, nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pptrs interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n, nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
LAPACK Routines: Linear Equations 3
397
Application Notes
If uplo = 'U', the computed solution for each right-hand side b is the exact solution of a perturbed system
of equations (A + E)x = b, where
|E| = c(n)e |UH||U|
c(n) is a modest linear function of n, and e is the machine precision.
A similar estimate holds for uplo = 'L'.
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A).
The approximate number of floating-point operations for one right-hand side vector b is 2n2 for real flavors
and 8n2 for complex flavors.
To estimate the condition number ?8(A), call ?ppcon.
To refine the solution and estimate the error, call ?pprfs.
?pbtrs
Solves a system of linear equations with a Choleskyfactored
symmetric (Hermitian) positive-definite band
matrix.
Syntax
Fortran 77:
call spbtrs( uplo, n, kd, nrhs, ab, ldab, b, ldb, info )
call dpbtrs( uplo, n, kd, nrhs, ab, ldab, b, ldb, info )
call cpbtrs( uplo, n, kd, nrhs, ab, ldab, b, ldb, info )
call zpbtrs( uplo, n, kd, nrhs, ab, ldab, b, ldb, info )
Fortran 95:
call pbtrs( ab, b [,uplo] [,info] )
C:
lapack_int LAPACKE_pbtrs( int matrix_order, char uplo, lapack_int n, lapack_int kd,
lapack_int nrhs, const * ab, lapack_int ldab, * b, lapack_int
ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
3 Intel® Math Kernel Library Reference Manual
398
Description
The routine solves for real data a system of linear equations A*X = B with a symmetric positive-definite or,
for complex data, Hermitian positive-definite band matrix A, given the Cholesky factorization of A:
A = UT*U for real data, A = UH*U for complex data if uplo='U'
A = L*LT for real data, A = L*LH for complex data if uplo='L'
where L is a lower triangular matrix and U is upper triangular. The system is solved with multiple right-hand
sides stored in the columns of the matrix B.
Before calling this routine, you must call ?pbtrf to compute the Cholesky factorization of A in the band
storage form.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the upper triangular factor is stored in ab.
If uplo = 'L', the lower triangular factor is stored in ab.
n INTEGER. The order of matrix A; n = 0.
kd INTEGER. The number of superdiagonals or subdiagonals in the matrix
A; kd = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ab, b REAL for spbtrs
DOUBLE PRECISION for dpbtrs
COMPLEX for cpbtrs
DOUBLE COMPLEX for zpbtrs.
Arrays: ab(ldab,*), b(ldb,*).
The array ab contains the Cholesky factor, as returned by the
factorization routine, in band storage form.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
The second dimension of ab must be at least max(1, n), and the
second dimension of b at least max(1,nrhs).
ldab INTEGER. The leading dimension of the array ab; ldab = kd +1.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pbtrs interface are as follows:
LAPACK Routines: Linear Equations 3
399
ab Holds the array A of size (kd+1,n).
b Holds the matrix B of size (n, nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(kd + 1)e P|UH||U| or |E| = c(kd + 1)e P|LH||L|
c(k) is a modest linear function of k, and e is the machine precision.
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A).
The approximate number of floating-point operations for one right-hand side vector is 4n*kd for real flavors
and 16n*kd for complex flavors.
To estimate the condition number ?8(A), call ?pbcon.
To refine the solution and estimate the error, call ?pbrfs.
?pttrs
Solves a system of linear equations with a symmetric
(Hermitian) positive-definite tridiagonal matrix using
the factorization computed by ?pttrf.
Syntax
Fortran 77:
call spttrs( n, nrhs, d, e, b, ldb, info )
call dpttrs( n, nrhs, d, e, b, ldb, info )
call cpttrs( uplo, n, nrhs, d, e, b, ldb, info )
call zpttrs( uplo, n, nrhs, d, e, b, ldb, info )
Fortran 95:
call pttrs( d, e, b [,info] )
call pttrs( d, e, b [,uplo] [,info] )
C:
lapack_int LAPACKE_spttrs( int matrix_order, lapack_int n, lapack_int nrhs, const
float* d, const float* e, float* b, lapack_int ldb );
lapack_int LAPACKE_dpttrs( int matrix_order, lapack_int n, lapack_int nrhs, const
double* d, const double* e, double* b, lapack_int ldb );
3 Intel® Math Kernel Library Reference Manual
400
lapack_int LAPACKE_cpttrs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const float* d, const lapack_complex_float* e, lapack_complex_float* b, lapack_int
ldb );
lapack_int LAPACKE_zpttrs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const double* d, const lapack_complex_double* e, lapack_complex_double* b, lapack_int
ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X a system of linear equations A*X = B with a symmetric (Hermitian) positive-definite
tridiagonal matrix A. Before calling this routine, call ?pttrf to compute the L*D*L' for real data and the
L*D*L' or U'*D*U factorization of A for complex data.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Used for cpttrs/zpttrs only. Must be 'U' or 'L'.
Specifies whether the superdiagonal or the subdiagonal of the
tridiagonal matrix A is stored and how A is factored:
If uplo = 'U', the array e stores the superdiagonal of A, and A is
factored as U'*D*U.
If uplo = 'L', the array e stores the subdiagonal of A, and A is
factored as L*D*L'.
n INTEGER. The order of A; n = 0.
nrhs INTEGER. The number of right-hand sides, that is, the number of
columns of the matrix B; nrhs = 0.
d REAL for spttrs, cpttrs
DOUBLE PRECISION for dpttrs, zpttrs.
Array, dimension (n). Contains the diagonal elements of the diagonal
matrix D from the factorization computed by ?pttrf.
e, b REAL for spttrs
DOUBLE PRECISION for dpttrs
COMPLEX for cpttrs
DOUBLE COMPLEX for zpttrs.
Arrays: e(n -1), b(ldb, nrhs).
The array e contains the (n - 1) off-diagonal elements of the unit
bidiagonal factor U or L from the factorization computed by ?pttrf
(see uplo).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
LAPACK Routines: Linear Equations 3
401
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pttrs interface are as follows:
d Holds the vector of length n.
e Holds the vector of length (n-1).
b Holds the matrix B of size (n, nrhs).
uplo Used in complex flavors only. Must be 'U' or 'L'. The default value is
'U'.
?sytrs
Solves a system of linear equations with a UDU- or
LDL-factored symmetric matrix.
Syntax
Fortran 77:
call ssytrs( uplo, n, nrhs, a, lda, ipiv, b, ldb, info )
call dsytrs( uplo, n, nrhs, a, lda, ipiv, b, ldb, info )
call csytrs( uplo, n, nrhs, a, lda, ipiv, b, ldb, info )
call zsytrs( uplo, n, nrhs, a, lda, ipiv, b, ldb, info )
Fortran 95:
call sytrs( a, b, ipiv [,uplo] [,info] )
C:
lapack_int LAPACKE_sytrs( int matrix_order, char uplo, lapack_int n, lapack_int
nrhs, const * a, lapack_int lda, const lapack_int* ipiv, * b,
lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the system of linear equations A*X = B with a symmetric matrix A, given the Bunch-
Kaufman factorization of A:
if uplo='U', A = P*U*D*UT*PT
if uplo='L', A = P*L*D*LT*PT,
where P is a permutation matrix, U and L are upper and lower triangular matrices with unit diagonal, and D is
a symmetric block-diagonal matrix. The system is solved with multiple right-hand sides stored in the columns
of the matrix B. You must supply to this routine the factor U (or L) and the array ipiv returned by the
factorization routine ?sytrf.
3 Intel® Math Kernel Library Reference Manual
402
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the upper triangular factor U of the
factorization A = P*U*D*UT*PT.
If uplo = 'L', the array a stores the lower triangular factor L of the
factorization A = P*L*D*LT*PT.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ipiv INTEGER. Array, DIMENSION at least max(1, n). The ipiv array, as
returned by ?sytrf.
a, b REAL for ssytrs
DOUBLE PRECISION for dsytrs
COMPLEX for csytrs
DOUBLE COMPLEX for zsytrs.
Arrays: a(lda,*), b(ldb,*).
The array a contains the factor U or L (see uplo).
The array b contains the matrix B whose columns are the right-hand
sides for the system of equations.
The second dimension of a must be at least max(1,n), and the
second dimension of b at least max(1,nrhs).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sytrs interface are as follows:
a Holds the matrix A of size (n, n).
b Holds the matrix B of size (n, nrhs).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(n)e P|U||D||UT|PT or |E| = c(n)e P|L||D||UT|PT
c(n) is a modest linear function of n, and e is the machine precision.
LAPACK Routines: Linear Equations 3
403
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A).
The total number of floating-point operations for one right-hand side vector is approximately 2n2 for real
flavors or 8n2 for complex flavors.
To estimate the condition number ?8(A), call ?sycon.
To refine the solution and estimate the error, call ?syrfs.
?hetrs
Solves a system of linear equations with a UDU- or
LDL-factored Hermitian matrix.
Syntax
Fortran 77:
call chetrs( uplo, n, nrhs, a, lda, ipiv, b, ldb, info )
call zhetrs( uplo, n, nrhs, a, lda, ipiv, b, ldb, info )
Fortran 95:
call hetrs( a, b, ipiv [, uplo] [,info] )
C:
lapack_int LAPACKE_hetrs( int matrix_order, char uplo, lapack_int n, lapack_int
nrhs, const * a, lapack_int lda, const lapack_int* ipiv, * b,
lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the system of linear equations A*X = B with a Hermitian matrix A, given the Bunch-
Kaufman factorization of A:
if uplo = 'U' A = P*U*D*UH*PT
if uplo = 'L' A = P*L*D*LH*PT,
where P is a permutation matrix, U and L are upper and lower triangular matrices with unit diagonal, and D is
a symmetric block-diagonal matrix. The system is solved with multiple right-hand sides stored in the columns
of the matrix B. You must supply to this routine the factor U (or L) and the array ipiv returned by the
factorization routine ?hetrf.
3 Intel® Math Kernel Library Reference Manual
404
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the upper triangular factor U of the
factorization A = P*U*D*UH*PT.
If uplo = 'L', the array a stores the lower triangular factor L of the
factorization A = P*L*D*LH*PT.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ipiv INTEGER.
Array, DIMENSION at least max(1, n).
The ipiv array, as returned by ?hetrf.
a, b COMPLEX for chetrs
DOUBLE COMPLEX for zhetrs.
Arrays: a(lda,*), b(ldb,*).
The array a contains the factor U or L (see uplo).
The array b contains the matrix B whose columns are the right-hand
sides for the system of equations.
The second dimension of a must be at least max(1,n), the second
dimension of b at least max(1,nrhs).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hetrs interface are as follows:
a Holds the matrix A of size (n, n).
b Holds the matrix B of size (n, nrhs).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(n)e P|U||D||UH|PT or |E| = c(n)e P|L||D||LH|PT
c(n) is a modest linear function of n, and e is the machine precision.
LAPACK Routines: Linear Equations 3
405
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A).
The total number of floating-point operations for one right-hand side vector is approximately 8n2.
To estimate the condition number ?8(A), call ?hecon.
To refine the solution and estimate the error, call ?herfs.
?sytrs2
Solves a system of linear equations with a UDU- or
LDL-factored symmetric matrix computed by ?sytrf
and converted by ?syconv.
Syntax
Fortran 77:
call ssytrs2( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, info )
call dsytrs2( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, info )
call csytrs2( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, info )
call zsytrs2( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, info )
Fortran 95:
call sytrs2( a,b,ipiv[,uplo][,info] )
C:
lapack_int LAPACKE_sytrs2( int matrix_order, char uplo, lapack_int n, lapack_int
nrhs, const * a, lapack_int lda, const lapack_int* ipiv, * b,
lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves a system of linear equations A*X = B with a symmetric matrix A using the factorization of
A:
if uplo='U', A = U*D*UT
if uplo='L', A = L*D*LT
where
• U and L are upper and lower triangular matrices with unit diagonal
• D is a symmetric block-diagonal matrix.
3 Intel® Math Kernel Library Reference Manual
406
The factorization is computed by ?sytrf and converted by ?syconv.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the upper triangular factor U of the
factorization A = U*D*UT.
If uplo = 'L', the array a stores the lower triangular factor L of the
factorization A = L*D*LT.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
a, b REAL for ssytrs2
DOUBLE PRECISION for dsytrs2
COMPLEX for csytrs2
DOUBLE COMPLEX for zsytrs2
Arrays: a(lda,*), b(ldb,*).
The array a contains the block diagonal matrix D and the multipliers
used to obtain the factor U or L as computed by ?sytrf.
The array b contains the right-hand side matrix B.
The second dimension of a must be at least max(1,n), and the
second dimension of b at least max(1,nrhs).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER. Array of DIMENSION n. The ipiv array contains details of
the interchanges and the block structure of D as determined by ?
sytrf.
work REAL for ssytrs2
DOUBLE PRECISION for dsytrs2
COMPLEX for csytrs2
DOUBLE COMPLEX for zsytrs2
Workspace array, DIMENSION n.
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sytrs2 interface are as follows:
a Holds the matrix A of size (n, n).
b Holds the matrix B of size (n, nrhs).
ipiv Holds the vector of length n.
LAPACK Routines: Linear Equations 3
407
uplo Indicates how the input matrix A has been factored. Must be 'U' or
'L'.
See Also
?sytrf
?syconv
?hetrs2
Solves a system of linear equations with a UDU- or
LDL-factored Hermitian matrix computed by ?hetrf
and converted by ?syconv.
Syntax
Fortran 77:
call chetrs2( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, info )
call zhetrs2( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, info )
Fortran 95:
call hetrs2( a, b, ipiv [,uplo] [,info] )
C:
lapack_int LAPACKE_hetrs2( int matrix_order, char uplo, lapack_int n, lapack_int
nrhs, const * a, lapack_int lda, const lapack_int* ipiv, * b,
lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves a system of linear equations A*X = B with a complex Hermitian matrix A using the
factorization of A:
if uplo='U', A = U*D*UH
if uplo='L', A = L*D*LH
where
• U and L are upper and lower triangular matrices with unit diagonal
• D is a Hermitian block-diagonal matrix.
The factorization is computed by ?hetrf and converted by ?syconv.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the upper triangular factor U of the
factorization A = U*D*UH.
3 Intel® Math Kernel Library Reference Manual
408
If uplo = 'L', the array a stores the lower triangular factor L of the
factorization A = L*D*LH.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
a, b COMPLEX for chetrs2
DOUBLE COMPLEX for zhetrs2
Arrays: a(lda,*), b(ldb,*).
The array a contains the block diagonal matrix D and the multipliers
used to obtain the factor U or L as computed by ?hetrf.
The array b contains the right-hand side matrix B.
The second dimension of a must be at least max(1,n), and the
second dimension of b at least max(1,nrhs).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER. Array of DIMENSION n. The ipiv array contains details of
the interchanges and the block structure of D as determined by ?
hetrf.
work COMPLEX for chetrs2
DOUBLE COMPLEX for zhetrs2
Workspace array, DIMENSION n.
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hetrs2 interface are as follows:
a Holds the matrix A of size (n, n).
b Holds the matrix B of size (n, nrhs).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
See Also
?hetrf
?syconv
?sptrs
Solves a system of linear equations with a UDU- or
LDL-factored symmetric matrix using packed storage.
Syntax
Fortran 77:
call ssptrs( uplo, n, nrhs, ap, ipiv, b, ldb, info )
call dsptrs( uplo, n, nrhs, ap, ipiv, b, ldb, info )
LAPACK Routines: Linear Equations 3
409
call csptrs( uplo, n, nrhs, ap, ipiv, b, ldb, info )
call zsptrs( uplo, n, nrhs, ap, ipiv, b, ldb, info )
Fortran 95:
call sptrs( ap, b, ipiv [, uplo] [,info] )
C:
lapack_int LAPACKE_sptrs( int matrix_order, char uplo, lapack_int n, lapack_int
nrhs, const * ap, const lapack_int* ipiv, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the system of linear equations A*X = B with a symmetric matrix A, given the Bunch-
Kaufman factorization of A:
if uplo='U', A = PUDUTPT
if uplo='L', A = PLDLTPT,
where P is a permutation matrix, U and L are upper and lower packed triangular matrices with unit diagonal,
and D is a symmetric block-diagonal matrix. The system is solved with multiple right-hand sides stored in the
columns of the matrix B. You must supply the factor U (or L) and the array ipiv returned by the factorization
routine ?sptrf.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array ap stores the packed factor U of the
factorization A = P*U*D*UT*PT. If uplo = 'L', the array ap stores
the packed factor L of the factorization A = P*L*D*LT*PT.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?sptrf.
ap, b REAL for ssptrs
DOUBLE PRECISION for dsptrs
COMPLEX for csptrs
DOUBLE COMPLEX for zsptrs.
Arrays: ap(*), b(ldb,*).
The dimension of ap must be at least max(1,n(n+1)/2). The array ap
contains the factor U or L, as specified by uplo, in packed storage
(see Matrix Storage Schemes).
3 Intel® Math Kernel Library Reference Manual
410
The array b contains the matrix B whose columns are the right-hand
sides for the system of equations. The second dimension of b must be
at least max(1, nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sptrs interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n, nrhs).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(n)e P|U||D||UT|PT or |E| = c(n)e P|L||D||LT|PT
c(n) is a modest linear function of n, and e is the machine precision.
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A).
The total number of floating-point operations for one right-hand side vector is approximately 2n2 for real
flavors or 8n2 for complex flavors.
To estimate the condition number ?8(A), call ?spcon.
To refine the solution and estimate the error, call ?sprfs.
?hptrs
Solves a system of linear equations with a UDU- or
LDL-factored Hermitian matrix using packed storage.
LAPACK Routines: Linear Equations 3
411
Syntax
Fortran 77:
call chptrs( uplo, n, nrhs, ap, ipiv, b, ldb, info )
call zhptrs( uplo, n, nrhs, ap, ipiv, b, ldb, info )
Fortran 95:
call hptrs( ap, b, ipiv [,uplo] [,info] )
C:
lapack_int LAPACKE_hptrs( int matrix_order, char uplo, lapack_int n, lapack_int
nrhs, const * ap, const lapack_int* ipiv, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the system of linear equations A*X = B with a Hermitian matrix A, given the Bunch-
Kaufman factorization of A:
if uplo='U', A = P*U*D*UH*PT
if uplo='L', A = P*L*D*LH*PT,
where P is a permutation matrix, U and L are upper and lower packed triangular matrices with unit diagonal,
and D is a symmetric block-diagonal matrix. The system is solved with multiple right-hand sides stored in the
columns of the matrix B.
You must supply to this routine the arrays ap (containing U or L)and ipiv in the form returned by the
factorization routine ?hptrf.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array ap stores the packed factor U of the
factorization A = P*U*D*UH*PT. If uplo = 'L', the array ap stores
the packed factor L of the factorization A = P*L*D*LH*PT.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ipiv INTEGER. Array, DIMENSION at least max(1, n). The ipiv array, as
returned by ?hptrf.
ap, b COMPLEX for chptrs
DOUBLE COMPLEX for zhptrs.
Arrays: ap(*), b(ldb,*).
The dimension of ap must be at least max(1,n(n+1)/2). The array ap
contains the factor U or L, as specified by uplo, in packed storage
(see Matrix Storage Schemes).
3 Intel® Math Kernel Library Reference Manual
412
The array b contains the matrix B whose columns are the right-hand
sides for the system of equations. The second dimension of b must be
at least max(1, nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hptrs interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n, nrhs).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(n)e P|U||D||UH|PT or |E| = c(n)e P|L||D||LH|PT
c(n) is a modest linear function of n, and e is the machine precision.
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A).
The total number of floating-point operations for one right-hand side vector is approximately 8n2 for complex
flavors.
To estimate the condition number ?8(A), call ?hpcon.
To refine the solution and estimate the error, call ?hprfs.
?trtrs
Solves a system of linear equations with a triangular
matrix, with multiple right-hand sides.
LAPACK Routines: Linear Equations 3
413
Syntax
Fortran 77:
call strtrs( uplo, trans, diag, n, nrhs, a, lda, b, ldb, info )
call dtrtrs( uplo, trans, diag, n, nrhs, a, lda, b, ldb, info )
call ctrtrs( uplo, trans, diag, n, nrhs, a, lda, b, ldb, info )
call ztrtrs( uplo, trans, diag, n, nrhs, a, lda, b, ldb, info )
Fortran 95:
call trtrs( a, b [,uplo] [, trans] [,diag] [,info] )
C:
lapack_int LAPACKE_trtrs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const * a, lapack_int lda, * b,
lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the following systems of linear equations with a triangular matrix A, with multiple
right-hand sides stored in B:
A*X = B if trans='N',
AT*X = B if trans='T',
AH*X = B if trans='C' (for complex matrices only).
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', then A is upper triangular.
If uplo = 'L', then A is lower triangular.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
If trans = 'N', then A*X = B is solved for X.
If trans = 'T', then AT*X = B is solved for X.
If trans = 'C', then AH*X = B is solved for X.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
If diag = 'U', then A is unit triangular: diagonal elements of A are
assumed to be 1 and not referenced in the array a.
n INTEGER. The order of A; the number of rows in B; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
a, b REAL for strtrs
3 Intel® Math Kernel Library Reference Manual
414
DOUBLE PRECISION for dtrtrs
COMPLEX for ctrtrs
DOUBLE COMPLEX for ztrtrs.
Arrays: a(lda,*), b(ldb,*).
The array a contains the matrix A.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
The second dimension of a must be at least max(1,n), the second
dimension of b at least max(1,nrhs).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine trtrs interface are as follows:
a Stands for argument ap in FORTRAN 77 interface. Holds the matrix A
of size (n*(n+1)/2).
b Holds the matrix B of size (n, nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(n)e |A|
c(n) is a modest linear function of n, and e is the machine precision. If x0 is the true solution, the computed
solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A); the condition number of AT and AH might or might
not be equal to ?8(A).
The approximate number of floating-point operations for one right-hand side vector b is n2 for real flavors
and 4n2 for complex flavors.
LAPACK Routines: Linear Equations 3
415
To estimate the condition number ?8(A), call ?trcon.
To estimate the error in the solution, call ?trrfs.
?tptrs
Solves a system of linear equations with a packed
triangular matrix, with multiple right-hand sides.
Syntax
Fortran 77:
call stptrs( uplo, trans, diag, n, nrhs, ap, b, ldb, info )
call dtptrs( uplo, trans, diag, n, nrhs, ap, b, ldb, info )
call ctptrs( uplo, trans, diag, n, nrhs, ap, b, ldb, info )
call ztptrs( uplo, trans, diag, n, nrhs, ap, b, ldb, info )
Fortran 95:
call tptrs( ap, b [,uplo] [, trans] [,diag] [,info] )
C:
lapack_int LAPACKE_tptrs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const * ap, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the following systems of linear equations with a packed triangular matrix A, with
multiple right-hand sides stored in B:
A*X = B if trans='N',
AT*X = B if trans='T',
AH*X = B if trans='C' (for complex matrices only).
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', then A is upper triangular.
If uplo = 'L', then A is lower triangular.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
If trans = 'N', then A*X = B is solved for X.
If trans = 'T', then AT*X = B is solved for X.
If trans = 'C', then AH*X = B is solved for X.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
3 Intel® Math Kernel Library Reference Manual
416
If diag = 'U', then A is unit triangular: diagonal elements are
assumed to be 1 and not referenced in the array ap.
n INTEGER. The order of A; the number of rows in B; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ap, b REAL for stptrs
DOUBLE PRECISION for dtptrs
COMPLEX for ctptrs
DOUBLE COMPLEX for ztptrs.
Arrays: ap(*), b(ldb,*).
The dimension of ap must be at least max(1,n(n+1)/2). The array ap
contains the matrix A in packed storage (see Matrix Storage
Schemes).
The array b contains the matrix B whose columns are the right-hand
sides for the system of equations. The second dimension of b must be
at least max(1, nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tptrs interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n, nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E| = c(n)e |A|
c(n) is a modest linear function of n, and e is the machine precision.
If x0 is the true solution, the computed solution x satisfies this error bound:
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
LAPACK Routines: Linear Equations 3
417
Note that cond(A,x) can be much smaller than ?8(A); the condition number of AT and AH might or might
not be equal to ?8(A).
The approximate number of floating-point operations for one right-hand side vector b is n2 for real flavors
and 4n2 for complex flavors.
To estimate the condition number ?8(A), call ?tpcon.
To estimate the error in the solution, call ?tprfs.
?tbtrs
Solves a system of linear equations with a band
triangular matrix, with multiple right-hand sides.
Syntax
Fortran 77:
call stbtrs( uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, info )
call dtbtrs( uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, info )
call ctbtrs( uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, info )
call ztbtrs( uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, info )
Fortran 95:
call tbtrs( ab, b [,uplo] [, trans] [,diag] [,info] )
C:
lapack_int LAPACKE_tbtrs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int kd, lapack_int nrhs, const * ab, lapack_int ldab,
* b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the following systems of linear equations with a band triangular matrix A, with
multiple right-hand sides stored in B:
A*X = B if trans='N',
AT*X = B if trans='T',
AH*X = B if trans='C' (for complex matrices only).
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', then A is upper triangular.
If uplo = 'L', then A is lower triangular.
3 Intel® Math Kernel Library Reference Manual
418
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
If trans = 'N', then A*X = B is solved for X.
If trans = 'T', then AT*X = B is solved for X.
If trans = 'C', then AH*X = B is solved for X.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
If diag = 'U', then A is unit triangular: diagonal elements are
assumed to be 1 and not referenced in the array ab.
n INTEGER. The order of A; the number of rows in B; n = 0.
kd INTEGER. The number of superdiagonals or subdiagonals in the matrix
A; kd = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ab, b REAL for stbtrs
DOUBLE PRECISION for dtbtrs
COMPLEX for ctbtrs
DOUBLE COMPLEX for ztbtrs.
Arrays: ab(ldab,*), b(ldb,*).
The array ab contains the matrix A in band storage form.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
The second dimension of ab must be at least max(1, n), the second
dimension of b at least max(1,nrhs).
ldab INTEGER. The leading dimension of ab; ldab = kd + 1.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
b Overwritten by the solution matrix X.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tbtrs interface are as follows:
ab Holds the array A of size (kd+1,n)
b Holds the matrix B of size (n, nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
For each right-hand side b, the computed solution is the exact solution of a perturbed system of equations (A
+ E)x = b, where
|E|= c(n)e|A|
c(n) is a modest linear function of n, and e is the machine precision. If x0 is the true solution, the computed
solution x satisfies this error bound:
LAPACK Routines: Linear Equations 3
419
where cond(A,x)= || |A-1||A| |x| ||8 / ||x||8 = ||A-1||8 ||A||8 = ?8(A).
Note that cond(A,x) can be much smaller than ?8(A); the condition number of AT and AH might or might
not be equal to ?8(A).
The approximate number of floating-point operations for one right-hand side vector b is 2n*kd for real
flavors and 8n*kd for complex flavors.
To estimate the condition number ?8(A), call ?tbcon.
To estimate the error in the solution, call ?tbrfs.
Routines for Estimating the Condition Number
This section describes the LAPACK routines for estimating the condition number of a matrix. The condition
number is used for analyzing the errors in the solution of a system of linear equations (see Error Analysis).
Since the condition number may be arbitrarily large when the matrix is nearly singular, the routines actually
compute the reciprocal condition number.
?gecon
Estimates the reciprocal of the condition number of a
general matrix in the 1-norm or the infinity-norm.
Syntax
Fortran 77:
call sgecon( norm, n, a, lda, anorm, rcond, work, iwork, info )
call dgecon( norm, n, a, lda, anorm, rcond, work, iwork, info )
call cgecon( norm, n, a, lda, anorm, rcond, work, rwork, info )
call zgecon( norm, n, a, lda, anorm, rcond, work, rwork, info )
Fortran 95:
call gecon( a, anorm, rcond [,norm] [,info] )
C:
lapack_int LAPACKE_sgecon( int matrix_order, char norm, lapack_int n, const float* a,
lapack_int lda, float anorm, float* rcond );
lapack_int LAPACKE_dgecon( int matrix_order, char norm, lapack_int n, const double* a,
lapack_int lda, double anorm, double* rcond );
lapack_int LAPACKE_cgecon( int matrix_order, char norm, lapack_int n, const
lapack_complex_float* a, lapack_int lda, float anorm, float* rcond );
lapack_int LAPACKE_zgecon( int matrix_order, char norm, lapack_int n, const
lapack_complex_double* a, lapack_int lda, double anorm, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
3 Intel® Math Kernel Library Reference Manual
420
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a general matrix A in the 1-norm or infinitynorm:
? 1(A) =||A||1||A-1||1 = ? 8(AT) = ? 8(AH)
? 8(A) =||A||8||A-1||8 = ? 1(AT) = ? 1(AH).
Before calling this routine:
• compute anorm (either ||A||1 = maxj Si |aij| or ||A||8 = maxi Sj |aij|)
• call ?getrf to compute the LU factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
norm CHARACTER*1. Must be '1' or 'O' or 'I'.
If norm = '1' or 'O', then the routine estimates the condition
number of matrix A in 1-norm.
If norm = 'I', then the routine estimates the condition number of
matrix A in infinity-norm.
n INTEGER. The order of the matrix A; n = 0.
a, work REAL for sgecon
DOUBLE PRECISION for dgecon
COMPLEX for cgecon
DOUBLE COMPLEX for zgecon. Arrays: a(lda,*), work(*).
The array a contains the LU-factored matrix A, as returned by ?getrf.
The second dimension of a must be at least max(1,n). The array work
is a workspace for the routine.
The dimension of work must be at least max(1, 4*n) for real flavors
and max(1, 2*n) for complex flavors.
anorm REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors. The norm of the
original matrix A (see Description).
lda INTEGER. The leading dimension of a; lda = max(1, n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for cgecon
DOUBLE PRECISION for zgecon.
Workspace array, DIMENSION at least max(1, 2*n).
Output Parameters
rcond REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond = 0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
LAPACK Routines: Linear Equations 3
421
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gecon interface are as follows:
a Holds the matrix A of size (n, n).
norm Must be '1', 'O', or 'I'. The default value is '1'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b or AH*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires
approximately 2*n2 floating-point operations for real flavors and 8*n2 for complex flavors.
?gbcon
Estimates the reciprocal of the condition number of a
band matrix in the 1-norm or the infinity-norm.
Syntax
Fortran 77:
call sgbcon( norm, n, kl, ku, ab, ldab, ipiv, anorm, rcond, work, iwork, info )
call dgbcon( norm, n, kl, ku, ab, ldab, ipiv, anorm, rcond, work, iwork, info )
call cgbcon( norm, n, kl, ku, ab, ldab, ipiv, anorm, rcond, work, rwork, info )
call zgbcon( norm, n, kl, ku, ab, ldab, ipiv, anorm, rcond, work, rwork, info )
Fortran 95:
call gbcon( ab, ipiv, anorm, rcond [,kl] [,norm] [,info] )
C:
lapack_int LAPACKE_sgbcon( int matrix_order, char norm, lapack_int n, lapack_int kl,
lapack_int ku, const float* ab, lapack_int ldab, const lapack_int* ipiv, float anorm,
float* rcond );
lapack_int LAPACKE_dgbcon( int matrix_order, char norm, lapack_int n, lapack_int kl,
lapack_int ku, const double* ab, lapack_int ldab, const lapack_int* ipiv, double
anorm, double* rcond );
lapack_int LAPACKE_cgbcon( int matrix_order, char norm, lapack_int n, lapack_int kl,
lapack_int ku, const lapack_complex_float* ab, lapack_int ldab, const lapack_int* ipiv,
float anorm, float* rcond );
lapack_int LAPACKE_zgbcon( int matrix_order, char norm, lapack_int n, lapack_int kl,
lapack_int ku, const lapack_complex_double* ab, lapack_int ldab, const lapack_int*
ipiv, double anorm, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
3 Intel® Math Kernel Library Reference Manual
422
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a general band matrix A in the 1-norm or
infinity-norm:
?1(A) = ||A||1||A-1||1 = ?8(AT) = ?8(AH)
?8(A) = ||A||8||A-1||8 = ?1(AT) = ?1(AH).
Before calling this routine:
• compute anorm (either ||A||1 = maxj Si |aij| or ||A||8 = maxi Sj |aij|)
• call ?gbtrf to compute the LU factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
norm CHARACTER*1. Must be '1' or 'O' or 'I'.
If norm = '1' or 'O', then the routine estimates the condition
number of matrix A in 1-norm.
If norm = 'I', then the routine estimates the condition number of
matrix A in infinity-norm.
n INTEGER. The order of the matrix A; n = 0.
kl INTEGER. The number of subdiagonals within the band of A; kl = 0.
ku INTEGER. The number of superdiagonals within the band of A; ku = 0.
ldab INTEGER. The leading dimension of the array ab. (ldab = 2*kl + ku
+1).
ipiv INTEGER. Array, DIMENSION at least max(1, n). The ipiv array, as
returned by ?gbtrf.
ab, work REAL for sgbcon
DOUBLE PRECISION for dgbcon
COMPLEX for cgbcon
DOUBLE COMPLEX for zgbcon.
Arrays: ab(ldab,*), work(*).
The array ab contains the factored band matrix A, as returned by ?
gbtrf.
The second dimension of ab must be at least max(1,n). The array
work is a workspace for the routine.
The dimension of work must be at least max(1, 3*n) for real flavors
and max(1, 2*n) for complex flavors.
anorm REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
The norm of the original matrix A (see Description).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for cgbcon
DOUBLE PRECISION for zgbcon.
Workspace array, DIMENSION at least max(1, 2*n).
LAPACK Routines: Linear Equations 3
423
Output Parameters
rcond REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gbcon interface are as follows:
ab Holds the array A of size (2*kl+ku+1,n).
ipiv Holds the vector of length n.
norm Must be '1', 'O', or 'I'. The default value is '1'.
kl If omitted, assumed kl = ku.
ku Restored as ku = lda-2*kl-1.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b or AH*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires
approximately 2n(ku + 2kl) floating-point operations for real flavors and 8n(ku + 2kl) for complex
flavors.
?gtcon
Estimates the reciprocal of the condition number of a
tridiagonal matrix using the factorization computed
by ?gttrf.
Syntax
Fortran 77:
call sgtcon( norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, iwork, info )
call dgtcon( norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, iwork, info )
call cgtcon( norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, info )
call zgtcon( norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, info )
Fortran 95:
call gtcon( dl, d, du, du2, ipiv, anorm, rcond [,norm] [,info] )
C:
lapack_int LAPACKE_sgtcon( char norm, lapack_int n, const float* dl, const float* d,
const float* du, const float* du2, const lapack_int* ipiv, float anorm, float* rcond );
3 Intel® Math Kernel Library Reference Manual
424
lapack_int LAPACKE_dgtcon( char norm, lapack_int n, const double* dl, const double* d,
const double* du, const double* du2, const lapack_int* ipiv, double anorm, double*
rcond );
lapack_int LAPACKE_cgtcon( char norm, lapack_int n, const lapack_complex_float* dl,
const lapack_complex_float* d, const lapack_complex_float* du, const
lapack_complex_float* du2, const lapack_int* ipiv, float anorm, float* rcond );
lapack_int LAPACKE_zgtcon( char norm, lapack_int n, const lapack_complex_double* dl,
const lapack_complex_double* d, const lapack_complex_double* du, const
lapack_complex_double* du2, const lapack_int* ipiv, double anorm, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a real or complex tridiagonal matrix A in the
1-norm or infinity-norm:
?1(A) = ||A||1||A-1||1
?8(A) = ||A||8||A-1||8
An estimate is obtained for ||A-1||, and the reciprocal of the condition number is computed as rcond =
1 / (||A|| ||A-1||).
Before calling this routine:
• compute anorm (either ||A||1 = maxj Si |aij| or ||A||8 = maxi Sj |aij|)
• call ?gttrf to compute the LU factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
norm CHARACTER*1. Must be '1' or 'O' or 'I'.
If norm = '1' or 'O', then the routine estimates the condition
number of matrix A in 1-norm.
If norm = 'I', then the routine estimates the condition number of
matrix A in infinity-norm.
n INTEGER. The order of the matrix A; n = 0.
dl,d,du,du2 REAL for sgtcon
DOUBLE PRECISION for dgtcon
COMPLEX for cgtcon
DOUBLE COMPLEX for zgtcon.
Arrays: dl(n -1), d(n), du(n -1), du2(n -2).
The array dl contains the (n - 1) multipliers that define the matrix L
from the LU factorization of A as computed by ?gttrf.
The array d contains the n diagonal elements of the upper triangular
matrix U from the LU factorization of A.
The array du contains the (n - 1) elements of the first superdiagonal
of U.
LAPACK Routines: Linear Equations 3
425
The array du2 contains the (n - 2) elements of the second
superdiagonal of U.
ipiv INTEGER.
Array, DIMENSION (n). The array of pivot indices, as returned by ?
gttrf.
anorm REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
The norm of the original matrix A (see Description).
work REAL for sgtcon
DOUBLE PRECISION for dgtcon
COMPLEX for cgtcon
DOUBLE COMPLEX for zgtcon.
Workspace array, DIMENSION (2*n).
iwork INTEGER. Workspace array, DIMENSION (n). Used for real flavors only.
Output Parameters
rcond REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond=0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gtcon interface are as follows:
dl Holds the vector of length (n-1).
d Holds the vector of length n.
du Holds the vector of length (n-1).
du2 Holds the vector of length (n-2).
ipiv Holds the vector of length n.
norm Must be '1', 'O', or 'I'. The default value is '1'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately 2n2
floating-point operations for real flavors and 8n2 for complex flavors.
?pocon
Estimates the reciprocal of the condition number of a
symmetric (Hermitian) positive-definite matrix.
3 Intel® Math Kernel Library Reference Manual
426
Syntax
Fortran 77:
call spocon( uplo, n, a, lda, anorm, rcond, work, iwork, info )
call dpocon( uplo, n, a, lda, anorm, rcond, work, iwork, info )
call cpocon( uplo, n, a, lda, anorm, rcond, work, rwork, info )
call zpocon( uplo, n, a, lda, anorm, rcond, work, rwork, info )
Fortran 95:
call pocon( a, anorm, rcond [,uplo] [,info] )
C:
lapack_int LAPACKE_spocon( int matrix_order, char uplo, lapack_int n, const float* a,
lapack_int lda, float anorm, float* rcond );
lapack_int LAPACKE_dpocon( int matrix_order, char uplo, lapack_int n, const double* a,
lapack_int lda, double anorm, double* rcond );
lapack_int LAPACKE_cpocon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_float* a, lapack_int lda, float anorm, float* rcond );
lapack_int LAPACKE_zpocon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_double* a, lapack_int lda, double anorm, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a symmetric (Hermitian) positive-definite
matrix A:
?1(A) = ||A||1 ||A-1||1 (since A is symmetric or Hermitian, ?8(A) = ?1(A)).
Before calling this routine:
• compute anorm (either ||A||1 = maxj Si |aij| or ||A||8 = maxi Sj |aij|)
• call ?potrf to compute the Cholesky factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of the matrix A; n = 0.
a, work REAL for spocon
DOUBLE PRECISION for dpocon
COMPLEX for cpocon
LAPACK Routines: Linear Equations 3
427
DOUBLE COMPLEX for zpocon.
Arrays: a(lda,*), work(*).
The array a contains the factored matrix A, as returned by ?potrf.
The second dimension of a must be at least max(1,n).
The array work is a workspace for the routine. The dimension of work
must be at least max(1, 3*n) for real flavors and max(1, 2*n) for
complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
anorm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
The norm of the original matrix A (see Description).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for cpocon
DOUBLE PRECISION for zpocon.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pocon interface are as follows:
a Holds the matrix A of size (n, n).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately 2n2
floating-point operations for real flavors and 8n2 for complex flavors.
?ppcon
Estimates the reciprocal of the condition number of a
packed symmetric (Hermitian) positive-definite
matrix.
Syntax
Fortran 77:
call sppcon( uplo, n, ap, anorm, rcond, work, iwork, info )
3 Intel® Math Kernel Library Reference Manual
428
call dppcon( uplo, n, ap, anorm, rcond, work, iwork, info )
call cppcon( uplo, n, ap, anorm, rcond, work, rwork, info )
call zppcon( uplo, n, ap, anorm, rcond, work, rwork, info )
Fortran 95:
call ppcon( ap, anorm, rcond [,uplo] [,info] )
C:
lapack_int LAPACKE_sppcon( int matrix_order, char uplo, lapack_int n, const float* ap,
float anorm, float* rcond );
lapack_int LAPACKE_dppcon( int matrix_order, char uplo, lapack_int n, const double* ap,
double anorm, double* rcond );
lapack_int LAPACKE_cppcon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_float* ap, float anorm, float* rcond );
lapack_int LAPACKE_zppcon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_double* ap, double anorm, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a packed symmetric (Hermitian) positivedefinite
matrix A:
?1(A) = ||A||1 ||A-1||1 (since A is symmetric or Hermitian, ?8(A) = ?1(A)).
Before calling this routine:
• compute anorm (either ||A||1 = maxj Si |aij| or ||A||8 = maxi Sj |aij|)
• call ?pptrf to compute the Cholesky factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of the matrix A; n = 0.
ap, work REAL for sppcon
DOUBLE PRECISION for dppcon
COMPLEX for cppcon
DOUBLE COMPLEX for zppcon.
Arrays: ap(*), work(*).
The array ap contains the packed factored matrix A, as returned by ?
pptrf. The dimension of ap must be at least max(1,n(n+1)/2).
LAPACK Routines: Linear Equations 3
429
The array work is a workspace for the routine. The dimension of work
must be at least max(1, 3*n) for real flavors and max(1, 2*n) for
complex flavors.
anorm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
The norm of the original matrix A (see Description).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for cppcon
DOUBLE PRECISION for zppcon.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine ppcon interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately 2n2
floating-point operations for real flavors and 8n2 for complex flavors.
?pbcon
Estimates the reciprocal of the condition number of a
symmetric (Hermitian) positive-definite band matrix.
Syntax
Fortran 77:
call spbcon( uplo, n, kd, ab, ldab, anorm, rcond, work, iwork, info )
call dpbcon( uplo, n, kd, ab, ldab, anorm, rcond, work, iwork, info )
call cpbcon( uplo, n, kd, ab, ldab, anorm, rcond, work, rwork, info )
call zpbcon( uplo, n, kd, ab, ldab, anorm, rcond, work, rwork, info )
3 Intel® Math Kernel Library Reference Manual
430
Fortran 95:
call pbcon( ab, anorm, rcond [,uplo] [,info] )
C:
lapack_int LAPACKE_spbcon( int matrix_order, char uplo, lapack_int n, lapack_int kd,
const float* ab, lapack_int ldab, float anorm, float* rcond );
lapack_int LAPACKE_dpbcon( int matrix_order, char uplo, lapack_int n, lapack_int kd,
const double* ab, lapack_int ldab, double anorm, double* rcond );
lapack_int LAPACKE_cpbcon( int matrix_order, char uplo, lapack_int n, lapack_int kd,
const lapack_complex_float* ab, lapack_int ldab, float anorm, float* rcond );
lapack_int LAPACKE_zpbcon( int matrix_order, char uplo, lapack_int n, lapack_int kd,
const lapack_complex_double* ab, lapack_int ldab, double anorm, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a symmetric (Hermitian) positive-definite
band matrix A:
?1(A) = ||A||1 ||A-1||1 (since A is symmetric or Hermitian, ?8(A) = ?1(A)).
Before calling this routine:
• compute anorm (either ||A||1 = maxj Si |aij| or ||A||8 = maxi Sj |aij|)
• call ?pbtrf to compute the Cholesky factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the upper triangular factor is stored in ab.
If uplo = 'L', the lower triangular factor is stored in ab.
n INTEGER. The order of the matrix A; n = 0.
kd INTEGER. The number of superdiagonals or subdiagonals in the matrix
A; kd = 0.
ldab INTEGER. The leading dimension of the array ab. (ldab = kd +1).
ab, work REAL for spbcon
DOUBLE PRECISION for dpbcon
COMPLEX for cpbcon
DOUBLE COMPLEX for zpbcon.
Arrays: ab(ldab,*), work(*).
The array ab contains the factored matrix A in band form, as returned
by ?pbtrf. The second dimension of ab must be at least max(1, n).
LAPACK Routines: Linear Equations 3
431
The array work is a workspace for the routine. The dimension of work
must be at least max(1, 3*n) for real flavors and max(1, 2*n) for
complex flavors.
anorm REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
The norm of the original matrix A (see Description).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for cpbcon
DOUBLE PRECISION for zpbcon.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pbcon interface are as follows:
ab Holds the array A of size (kd+1,n).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately
4*n(kd + 1) floating-point operations for real flavors and 16*n(kd + 1) for complex flavors.
?ptcon
Estimates the reciprocal of the condition number of a
symmetric (Hermitian) positive-definite tridiagonal
matrix.
Syntax
Fortran 77:
call sptcon( n, d, e, anorm, rcond, work, info )
call dptcon( n, d, e, anorm, rcond, work, info )
call cptcon( n, d, e, anorm, rcond, work, info )
call zptcon( n, d, e, anorm, rcond, work, info )
3 Intel® Math Kernel Library Reference Manual
432
Fortran 95:
call ptcon( d, e, anorm, rcond [,info] )
C:
lapack_int LAPACKE_sptcon( lapack_int n, const float* d, const float* e, float anorm,
float* rcond );
lapack_int LAPACKE_dptcon( lapack_int n, const double* d, const double* e, double
anorm, double* rcond );
lapack_int LAPACKE_cptcon( lapack_int n, const float* d, const lapack_complex_float* e,
float anorm, float* rcond );
lapack_int LAPACKE_zptcon( lapack_int n, const double* d, const lapack_complex_double*
e, double anorm, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the reciprocal of the condition number (in the 1-norm) of a real symmetric or complex
Hermitian positive-definite tridiagonal matrix using the factorization A = L*D*LT for real flavors and A =
L*D*LH for complex flavors or A = UT*D*U for real flavors and A = UH*D*U for complex flavors computed
by ?pttrf :
?1(A) = ||A||1 ||A-1||1 (since A is symmetric or Hermitian, ?8(A) = ?1(A)).
The norm ||A-1|| is computed by a direct method, and the reciprocal of the condition number is computed
as rcond = 1 / (||A|| ||A-1||).
Before calling this routine:
• compute anorm as ||A||1 = maxj Si |aij|
• call ?pttrf to compute the factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The order of the matrix A; n = 0.
d, work REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays, dimension (n).
The array d contains the n diagonal elements of the diagonal matrix D
from the factorization of A, as computed by ?pttrf ;
work is a workspace array.
e REAL for sptcon
DOUBLE PRECISION for dptcon
COMPLEX for cptcon
DOUBLE COMPLEX for zptcon.
Array, DIMENSION (n -1).
LAPACK Routines: Linear Equations 3
433
Contains off-diagonal elements of the unit bidiagonal factor U or L
from the factorization computed by ?pttrf .
anorm REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
The 1- norm of the original matrix A (see Description).
Output Parameters
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gtcon interface are as follows:
d Holds the vector of length n.
e Holds the vector of length (n-1).
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately
4*n(kd + 1) floating-point operations for real flavors and 16*n(kd + 1) for complex flavors.
?sycon
Estimates the reciprocal of the condition number of a
symmetric matrix.
Syntax
Fortran 77:
call ssycon( uplo, n, a, lda, ipiv, anorm, rcond, work, iwork, info )
call dsycon( uplo, n, a, lda, ipiv, anorm, rcond, work, iwork, info )
call csycon( uplo, n, a, lda, ipiv, anorm, rcond, work, info )
call zsycon( uplo, n, a, lda, ipiv, anorm, rcond, work, info )
Fortran 95:
call sycon( a, ipiv, anorm, rcond [,uplo] [,info] )
3 Intel® Math Kernel Library Reference Manual
434
C:
lapack_int LAPACKE_ssycon( int matrix_order, char uplo, lapack_int n, const float* a,
lapack_int lda, const lapack_int* ipiv, float anorm, float* rcond );
lapack_int LAPACKE_dsycon( int matrix_order, char uplo, lapack_int n, const double* a,
lapack_int lda, const lapack_int* ipiv, double anorm, double* rcond );
lapack_int LAPACKE_csycon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_float* a, lapack_int lda, const lapack_int* ipiv, float anorm, float*
rcond );
lapack_int LAPACKE_zsycon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_double* a, lapack_int lda, const lapack_int* ipiv, double anorm, double*
rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a symmetric matrix A:
?1(A) = ||A||1 ||A-1||1 (since A is symmetric, ?8(A) = ?1(A)).
Before calling this routine:
• compute anorm (either ||A||1 = maxj Si |aij| or ||A||8 = maxi Sj |aij|)
• call ?sytrf to compute the factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the upper triangular factor U of the
factorization A = P*U*D*UT*PT.
If uplo = 'L', the array a stores the lower triangular factor L of the
factorization A = P*L*D*LT*PT.
n INTEGER. The order of matrix A; n = 0.
a, work REAL for ssycon
DOUBLE PRECISION for dsycon
COMPLEX for csycon
DOUBLE COMPLEX for zsycon.
Arrays: a(lda,*), work(*).
The array a contains the factored matrix A, as returned by ?sytrf.
The second dimension of a must be at least max(1,n).
The array work is a workspace for the routine.
The dimension of work must be at least max(1, 2*n).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER. Array, DIMENSION at least max(1, n).
LAPACK Routines: Linear Equations 3
435
The array ipiv, as returned by ?sytrf.
anorm REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
The norm of the original matrix A (see Description).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
Output Parameters
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sycon interface are as follows:
a Holds the matrix A of size (n, n).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately 2n2
floating-point operations for real flavors and 8n2 for complex flavors.
?syconv
Converts a symmetric matrix given by a triangular
matrix factorization into two matrices and vice versa.
Syntax
Fortran 77:
call ssyconv( uplo, way, n, a, lda, ipiv, work, info )
call dsyconv( uplo, way, n, a, lda, ipiv, work, info )
call csyconv( uplo, way, n, a, lda, ipiv, work, info )
call zsyconv( uplo, way, n, a, lda, ipiv, work, info )
Fortran 95:
call sycon( a[,uplo][,way][,ipiv][,info] )
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
3 Intel® Math Kernel Library Reference Manual
436
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine converts matrix A, which results from a triangular matrix factorization, into matrices L and D and
vice versa. The routine gets non-diagonalized elements of D returned in the workspace and applies or
reverses permutation done with the triangular matrix factorization.
Input Parameters
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the details of the factorization are stored as an
upper or lower triangular matrix:
If uplo = 'U': the upper triangular, A = U*D*UT.
If uplo = 'L': the lower triangular, A = L*D*LT.
way CHARACTER*1. Must be 'C' or 'R'.
Indicates whether the routine converts or reverts the matrix:
way = 'C' means conversion.
way = 'R' means reversion.
n INTEGER. The order of matrix A; n = 0.
a REAL for ssyconv
DOUBLE PRECISION for dsyconv
COMPLEX for csyconv
DOUBLE COMPLEX for zsyconv
Array of DIMENSION (lda,n).
The block diagonal matrix D and the multipliers used to obtain the
factor U or L as computed by ?sytrf.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER. Array, DIMENSION at least max(1, n).
Details of the interchanges and the block structure of D, as returned
by ?sytrf.
work INTEGER. Workspace array, DIMENSION at least max(1, n).
Output Parameters
info INTEGER. If info = 0, the execution is successful.
If info < 0, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine syconv interface are as follows:
a Holds the matrix A of size (n, n).
uplo Must be 'U' or 'L'.
way Must be 'C' or 'R'.
ipiv Holds the vector of length n.
See Also
?sytrf
LAPACK Routines: Linear Equations 3
437
?hecon
Estimates the reciprocal of the condition number of a
Hermitian matrix.
Syntax
Fortran 77:
call checon( uplo, n, a, lda, ipiv, anorm, rcond, work, info )
call zhecon( uplo, n, a, lda, ipiv, anorm, rcond, work, info )
Fortran 95:
call hecon( a, ipiv, anorm, rcond [,uplo] [,info] )
C:
lapack_int LAPACKE_checon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_float* a, lapack_int lda, const lapack_int* ipiv, float anorm, float*
rcond );
lapack_int LAPACKE_zhecon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_double* a, lapack_int lda, const lapack_int* ipiv, double anorm, double*
rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a Hermitian matrix A:
?1(A) = ||A||1 ||A-1||1 (since A is Hermitian, ?8(A) = ?1(A)).
Before calling this routine:
• compute anorm (either ||A||1 =maxj Si |aij| or ||A||8 =maxi Sj |aij|)
• call ?hetrf to compute the factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the upper triangular factor U of the
factorization A = P*U*D*UH*PT.
If uplo = 'L', the array a stores the lower triangular factor L of the
factorization A = P*L*D*LH*PT.
n INTEGER. The order of matrix A; n = 0.
a, work COMPLEX for checon
DOUBLE COMPLEX for zhecon.
Arrays: a(lda,*), work(*).
3 Intel® Math Kernel Library Reference Manual
438
The array a contains the factored matrix A, as returned by ?hetrf.
The second dimension of a must be at least max(1,n).
The array work is a workspace for the routine.
The dimension of work must be at least max(1, 2*n).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER. Array, DIMENSION at least max(1, n).
The array ipiv, as returned by ?hetrf.
anorm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
The norm of the original matrix A (see Description).
Output Parameters
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hecon interface are as follows:
a Holds the matrix A of size (n, n).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 5 and never more than 11. Each solution requires approximately 8n2
floating-point operations.
?spcon
Estimates the reciprocal of the condition number of a
packed symmetric matrix.
Syntax
Fortran 77:
call sspcon( uplo, n, ap, ipiv, anorm, rcond, work, iwork, info )
call dspcon( uplo, n, ap, ipiv, anorm, rcond, work, iwork, info )
call cspcon( uplo, n, ap, ipiv, anorm, rcond, work, info )
call zspcon( uplo, n, ap, ipiv, anorm, rcond, work, info )
LAPACK Routines: Linear Equations 3
439
Fortran 95:
call spcon( ap, ipiv, anorm, rcond [,uplo] [,info] )
C:
lapack_int LAPACKE_sspcon( int matrix_order, char uplo, lapack_int n, const float* ap,
const lapack_int* ipiv, float anorm, float* rcond );
lapack_int LAPACKE_dspcon( int matrix_order, char uplo, lapack_int n, const double* ap,
const lapack_int* ipiv, double anorm, double* rcond );
lapack_int LAPACKE_cspcon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_float* ap, const lapack_int* ipiv, float anorm, float* rcond );
lapack_int LAPACKE_zspcon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_double* ap, const lapack_int* ipiv, double anorm, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a packed symmetric matrix A:
?1(A) = ||A||1 ||A-1||1 (since A is symmetric, ?8(A) = ?1(A)).
Before calling this routine:
• compute anorm (either ||A||1 = maxj Si |aij| or ||A||8 = maxi Sj |aij|)
• call ?sptrf to compute the factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array ap stores the packed upper triangular factor
U of the factorization A = P*U*D*UT*PT.
If uplo = 'L', the array ap stores the packed lower triangular factor
L of the factorization A = P*L*D*LT*PT.
n INTEGER. The order of matrix A; n = 0.
ap, work REAL for sspcon
DOUBLE PRECISION for dspcon
COMPLEX for cspcon
DOUBLE COMPLEX for zspcon.
Arrays: ap(*), work(*).
The array ap contains the packed factored matrix A, as returned by ?
sptrf. The dimension of ap must be at least max(1,n(n+1)/2).
The array work is a workspace for the routine.
The dimension of work must be at least max(1, 2*n).
ipiv INTEGER. Array, DIMENSION at least max(1, n).
The array ipiv, as returned by ?sptrf.
3 Intel® Math Kernel Library Reference Manual
440
anorm REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
The norm of the original matrix A (see Description).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
Output Parameters
rcond REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond = 0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine spcon interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately 2n2
floating-point operations for real flavors and 8n2 for complex flavors.
?hpcon
Estimates the reciprocal of the condition number of a
packed Hermitian matrix.
Syntax
Fortran 77:
call chpcon( uplo, n, ap, ipiv, anorm, rcond, work, info )
call zhpcon( uplo, n, ap, ipiv, anorm, rcond, work, info )
Fortran 95:
call hpcon( ap, ipiv, anorm, rcond [,uplo] [,info] )
C:
lapack_int LAPACKE_chpcon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_float* ap, const lapack_int* ipiv, float anorm, float* rcond );
lapack_int LAPACKE_zhpcon( int matrix_order, char uplo, lapack_int n, const
lapack_complex_double* ap, const lapack_int* ipiv, double anorm, double* rcond );
LAPACK Routines: Linear Equations 3
441
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a Hermitian matrix A:
?1(A) = ||A||1 ||A-1||1 (since A is Hermitian, ?8(A) = k1(A)).
Before calling this routine:
• compute anorm (either ||A||1 =maxj Si |aij| or ||A||8 =maxi Sj |aij|)
• call ?hptrf to compute the factorization of A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array ap stores the packed upper triangular factor
U of the factorization A = P*U*D*UT*PT.
If uplo = 'L', the array ap stores the packed lower triangular factor
L of the factorization A = P*L*D*LT*PT.
n INTEGER. The order of matrix A; n = 0.
ap, work COMPLEX for chpcon
DOUBLE COMPLEX for zhpcon.
Arrays: ap(*), work(*).
The array ap contains the packed factored matrix A, as returned by ?
hptrf. The dimension of ap must be at least max(1,n(n+1)/2).
The array work is a workspace for the routine.
The dimension of work must be at least max(1, 2*n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The array ipiv, as returned
by ?hptrf.
anorm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
The norm of the original matrix A (see Description).
Output Parameters
rcond REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
3 Intel® Math Kernel Library Reference Manual
442
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hbcon interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
ipiv Holds the vector of length n.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 5 and never more than 11. Each solution requires approximately 8n2
floating-point operations.
?trcon
Estimates the reciprocal of the condition number of a
triangular matrix.
Syntax
Fortran 77:
call strcon( norm, uplo, diag, n, a, lda, rcond, work, iwork, info )
call dtrcon( norm, uplo, diag, n, a, lda, rcond, work, iwork, info )
call ctrcon( norm, uplo, diag, n, a, lda, rcond, work, rwork, info )
call ztrcon( norm, uplo, diag, n, a, lda, rcond, work, rwork, info )
Fortran 95:
call trcon( a, rcond [,uplo] [,diag] [,norm] [,info] )
C:
lapack_int LAPACKE_strcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, const float* a, lapack_int lda, float* rcond );
lapack_int LAPACKE_dtrcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, const double* a, lapack_int lda, double* rcond );
lapack_int LAPACKE_ctrcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, const lapack_complex_float* a, lapack_int lda, float* rcond );
lapack_int LAPACKE_ztrcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, const lapack_complex_double* a, lapack_int lda, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a triangular matrix A in either the 1-norm or
infinity-norm:
?1(A) =||A||1 ||A-1||1 = ?8(AT) = ?8(AH)
LAPACK Routines: Linear Equations 3
443
?8 (A) =||A||8 ||A-1||8 =k1 (AT) = ?1 (AH) .
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
norm CHARACTER*1. Must be '1' or 'O' or 'I'.
If norm = '1' or 'O', then the routine estimates the condition
number of matrix A in 1-norm.
If norm = 'I', then the routine estimates the condition number of
matrix A in infinity-norm.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', the array a stores the upper triangle of A, other array
elements are not referenced.
If uplo = 'L', the array a stores the lower triangle of A, other array
elements are not referenced.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
If diag = 'U', then A is unit triangular: diagonal elements are
assumed to be 1 and not referenced in the array a.
n INTEGER. The order of the matrix A; n = 0.
a, work REAL for strcon
DOUBLE PRECISION for dtrcon
COMPLEX for ctrcon
DOUBLE COMPLEX for ztrcon.
Arrays: a(lda,*), work(*).
The array a contains the matrix A. The second dimension of a must be
at least max(1,n).
The array work is a workspace for the routine. The dimension of work
must be at least max(1, 3*n) for real flavors and max(1, 2*n) for
complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for ctrcon
DOUBLE PRECISION for ztrcon.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
rcond REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
3 Intel® Math Kernel Library Reference Manual
444
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine trcon interface are as follows:
a Holds the matrix A of size (n, n).
norm Must be '1', 'O', or 'I'. The default value is '1'.
uplo Must be 'U' or 'L'. The default value is 'U'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately n2
floating-point operations for real flavors and 4n2 operations for complex flavors.
?tpcon
Estimates the reciprocal of the condition number of a
packed triangular matrix.
Syntax
Fortran 77:
call stpcon( norm, uplo, diag, n, ap, rcond, work, iwork, info )
call dtpcon( norm, uplo, diag, n, ap, rcond, work, iwork, info )
call ctpcon( norm, uplo, diag, n, ap, rcond, work, rwork, info )
call ztpcon( norm, uplo, diag, n, ap, rcond, work, rwork, info )
Fortran 95:
call tpcon( ap, rcond [,uplo] [,diag] [,norm] [,info] )
C:
lapack_int LAPACKE_stpcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, const float* ap, float* rcond );
lapack_int LAPACKE_dtpcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, const double* ap, double* rcond );
lapack_int LAPACKE_ctpcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, const lapack_complex_float* ap, float* rcond );
lapack_int LAPACKE_ztpcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, const lapack_complex_double* ap, double* rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
LAPACK Routines: Linear Equations 3
445
The routine estimates the reciprocal of the condition number of a packed triangular matrix A in either the 1-
norm or infinity-norm:
?1(A) =||A||1 ||A-1||1 = ?8(AT) = ?8(AH)
?8(A) =||A||8 ||A-1||8 =?1 (AT) = ?1(AH) .
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
norm CHARACTER*1. Must be '1' or 'O' or 'I'.
If norm = '1' or 'O', then the routine estimates the condition
number of matrix A in 1-norm.
If norm = 'I', then the routine estimates the condition number of
matrix A in infinity-norm.
uplo CHARACTER*1. Must be 'U' or 'L'. Indicates whether A is upper or
lower triangular:
If uplo = 'U', the array ap stores the upper triangle of A in packed
form.
If uplo = 'L', the array ap stores the lower triangle of A in packed
form.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
If diag = 'U', then A is unit triangular: diagonal elements are
assumed to be 1 and not referenced in the array ap.
n INTEGER. The order of the matrix A; n = 0.
ap, work REAL for stpcon
DOUBLE PRECISION for dtpcon
COMPLEX for ctpcon
DOUBLE COMPLEX for ztpcon.
Arrays: ap(*), work(*).
The array ap contains the packed matrix A. The dimension of ap must
be at least max(1,n(n+1)/2). The array work is a workspace for the
routine.
The dimension of work must be at least max(1, 3*n) for real flavors
and max(1, 2*n) for complex flavors.
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for ctpcon
DOUBLE PRECISION for ztpcon.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
rcond REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
3 Intel® Math Kernel Library Reference Manual
446
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tpcon interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
norm Must be '1', 'O', or 'I'. The default value is '1'.
uplo Must be 'U' or 'L'. The default value is 'U'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately n2
floating-point operations for real flavors and 4n2 operations for complex flavors.
?tbcon
Estimates the reciprocal of the condition number of a
triangular band matrix.
Syntax
Fortran 77:
call stbcon( norm, uplo, diag, n, kd, ab, ldab, rcond, work, iwork, info )
call dtbcon( norm, uplo, diag, n, kd, ab, ldab, rcond, work, iwork, info )
call ctbcon( norm, uplo, diag, n, kd, ab, ldab, rcond, work, rwork, info )
call ztbcon( norm, uplo, diag, n, kd, ab, ldab, rcond, work, rwork, info )
Fortran 95:
call tbcon( ab, rcond [,uplo] [,diag] [,norm] [,info] )
C:
lapack_int LAPACKE_stbcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, lapack_int kd, const float* ab, lapack_int ldab, float* rcond );
lapack_int LAPACKE_dtbcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, lapack_int kd, const double* ab, lapack_int ldab, double* rcond );
lapack_int LAPACKE_ctbcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, lapack_int kd, const lapack_complex_float* ab, lapack_int ldab, float*
rcond );
lapack_int LAPACKE_ztbcon( int matrix_order, char norm, char uplo, char diag,
lapack_int n, lapack_int kd, const lapack_complex_double* ab, lapack_int ldab, double*
rcond );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
LAPACK Routines: Linear Equations 3
447
• C: mkl_lapacke.h
Description
The routine estimates the reciprocal of the condition number of a triangular band matrix A in either the 1-
norm or infinity-norm:
?1(A) =||A||1 ||A-1||1 = ?8(AT) = ?8(AH)
?8(A) =||A||8 ||A-1||8 =?1 (AT) = ?1(AH) .
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
norm CHARACTER*1. Must be '1' or 'O' or 'I'.
If norm = '1' or 'O', then the routine estimates the condition
number of matrix A in 1-norm.
If norm = 'I', then the routine estimates the condition number of
matrix A in infinity-norm.
uplo CHARACTER*1. Must be 'U' or 'L'. Indicates whether A is upper or
lower triangular:
If uplo = 'U', the array ap stores the upper triangle of A in packed
form.
If uplo = 'L', the array ap stores the lower triangle of A in packed
form.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
If diag = 'U', then A is unit triangular: diagonal elements are
assumed to be 1 and not referenced in the array ab.
n INTEGER. The order of the matrix A; n = 0.
kd INTEGER. The number of superdiagonals or subdiagonals in the matrix
A; kd = 0.
ab, work REAL for stbcon
DOUBLE PRECISION for dtbcon
COMPLEX for ctbcon
DOUBLE COMPLEX for ztbcon.
Arrays: ab(ldab,*), work(*).
The array ab contains the band matrix A. The second dimension of ab
must be at least max(1,n). The array work is a workspace for the
routine.
The dimension of work must be at least max(1, 3*n) for real flavors
and max(1, 2*n) for complex flavors.
ldab INTEGER. The leading dimension of the array ab. (ldab = kd +1).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for ctbcon
DOUBLE PRECISION for ztbcon.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
rcond REAL for single precision flavors.
3 Intel® Math Kernel Library Reference Manual
448
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal of the condition number. The routine
sets rcond =0 if the estimate underflows; in this case the matrix is
singular (to working precision). However, anytime rcond is small
compared to 1.0, for the working precision, the matrix may be poorly
conditioned or even singular.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tbcon interface are as follows:
ab Holds the array A of size (kd+1,n).
norm Must be '1', 'O', or 'I'. The default value is '1'.
uplo Must be 'U' or 'L'. The default value is 'U'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is
nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations
A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately
2*n(kd + 1) floating-point operations for real flavors and 8*n(kd + 1) operations for complex flavors.
Refining the Solution and Estimating Its Error
This section describes the LAPACK routines for refining the computed solution of a system of linear equations
and estimating the solution error. You can call these routines after factorizing the matrix of the system of
equations and computing the solution (see Routines for Matrix Factorization and Routines for Solving
Systems of Linear Equations).
?gerfs
Refines the solution of a system of linear equations
with a general matrix and estimates its error.
Syntax
Fortran 77:
call sgerfs( trans, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
iwork, info )
call dgerfs( trans, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
iwork, info )
call cgerfs( trans, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
rwork, info )
call zgerfs( trans, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
rwork, info )
Fortran 95:
call gerfs( a, af, ipiv, b, x [,trans] [,ferr] [,berr] [,info] )
LAPACK Routines: Linear Equations 3
449
C:
lapack_int LAPACKE_sgerfs( int matrix_order, char trans, lapack_int n, lapack_int nrhs,
const float* a, lapack_int lda, const float* af, lapack_int ldaf, const lapack_int*
ipiv, const float* b, lapack_int ldb, float* x, lapack_int ldx, float* ferr, float*
berr );
lapack_int LAPACKE_dgerfs( int matrix_order, char trans, lapack_int n, lapack_int nrhs,
const double* a, lapack_int lda, const double* af, lapack_int ldaf, const lapack_int*
ipiv, const double* b, lapack_int ldb, double* x, lapack_int ldx, double* ferr,
double* berr );
lapack_int LAPACKE_cgerfs( int matrix_order, char trans, lapack_int n, lapack_int nrhs,
const lapack_complex_float* a, lapack_int lda, const lapack_complex_float* af,
lapack_int ldaf, const lapack_int* ipiv, const lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_zgerfs( int matrix_order, char trans, lapack_int n, lapack_int nrhs,
const lapack_complex_double* a, lapack_int lda, const lapack_complex_double* af,
lapack_int ldaf, const lapack_int* ipiv, const lapack_complex_double* b, lapack_int
ldb, lapack_complex_double* x, lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B or AT*X
= B or AH*X = B with a general matrix A, with multiple right-hand sides. For each computed solution vector x,
the routine computes the component-wise backward error ß. This error is the smallest relative perturbation
in elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?getrf
• call the solver routine ?getrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
Indicates the form of the equations:
If trans = 'N', the system has the form A*X = B.
If trans = 'T', the system has the form AT*X = B.
If trans = 'C', the system has the form AH*X = B.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
3 Intel® Math Kernel Library Reference Manual
450
a,af,b,x,work REAL for sgerfs
DOUBLE PRECISION for dgerfs
COMPLEX for cgerfs
DOUBLE COMPLEX for zgerfs.
Arrays:
a(lda,*) contains the original matrix A, as supplied to ?getrf.
af(ldaf,*) contains the factored matrix A, as returned by ?getrf.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The second dimension of a and af must be at least max(1, n); the
second dimension of b and x must be at least max(1, nrhs); the
dimension of work must be at least max(1, 3*n) for real flavors and
max(1, 2*n) for complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n).
The ipiv array, as returned by ?getrf.
iwork INTEGER.
Workspace array, DIMENSION at least max(1, n).
rwork REAL for cgerfs
DOUBLE PRECISION for zgerfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gerfs interface are as follows:
a Holds the matrix A of size (n, n).
af Holds the matrix AF of size (n, n).
ipiv Holds the vector of length n.
b Holds the matrix B of size (n, nrhs).
x Holds the matrix X of size (n, nrhs).
ferr Holds the vector of length (nrhs).
LAPACK Routines: Linear Equations 3
451
berr Holds the vector of length (nrhs).
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
For each right-hand side, computation of the backward error involves a minimum of 4n2 floating-point
operations (for real flavors) or 16n2 operations (for complex flavors). In addition, each step of iterative
refinement involves 6n2 operations (for real flavors) or 24n2 operations (for complex flavors); the number of
iterations may range from 1 to 5. Estimating the forward error involves solving a number of systems of linear
equations A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires
approximately 2n2 floating-point operations for real flavors or 8n2 for complex flavors.
?gerfsx
Uses extra precise iterative refinement to improve the
solution to the system of linear equations with a
general matrix A and provides error bounds and
backward error estimates.
Syntax
Fortran 77:
call sgerfsx( trans, equed, n, nrhs, a, lda, af, ldaf, ipiv, r, c, b, ldb, x, ldx,
rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork,
info )
call dgerfsx( trans, equed, n, nrhs, a, lda, af, ldaf, ipiv, r, c, b, ldb, x, ldx,
rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork,
info )
call cgerfsx( trans, equed, n, nrhs, a, lda, af, ldaf, ipiv, r, c, b, ldb, x, ldx,
rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork,
info )
call zgerfsx( trans, equed, n, nrhs, a, lda, af, ldaf, ipiv, r, c, b, ldb, x, ldx,
rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork,
info )
C:
lapack_int LAPACKE_sgerfsx( int matrix_order, char trans, char equed, lapack_int n,
lapack_int nrhs, const float* a, lapack_int lda, const float* af, lapack_int ldaf,
const lapack_int* ipiv, const float* r, const float* c, const float* b, lapack_int
ldb, float* x, lapack_int ldx, float* rcond, float* berr, lapack_int n_err_bnds,
float* err_bnds_norm, float* err_bnds_comp, lapack_int nparams, float* params );
lapack_int LAPACKE_dgerfsx( int matrix_order, char trans, char equed, lapack_int n,
lapack_int nrhs, const double* a, lapack_int lda, const double* af, lapack_int ldaf,
const lapack_int* ipiv, const double* r, const double* c, const double* b, lapack_int
ldb, double* x, lapack_int ldx, double* rcond, double* berr, lapack_int n_err_bnds,
double* err_bnds_norm, double* err_bnds_comp, lapack_int nparams, double* params );
lapack_int LAPACKE_cgerfsx( int matrix_order, char trans, char equed, lapack_int n,
lapack_int nrhs, const lapack_complex_float* a, lapack_int lda, const
lapack_complex_float* af, lapack_int ldaf, const lapack_int* ipiv, const float* r,
3 Intel® Math Kernel Library Reference Manual
452
const float* c, const lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x,
lapack_int ldx, float* rcond, float* berr, lapack_int n_err_bnds, float*
err_bnds_norm, float* err_bnds_comp, lapack_int nparams, float* params );
lapack_int LAPACKE_zgerfsx( int matrix_order, char trans, char equed, lapack_int n,
lapack_int nrhs, const lapack_complex_double* a, lapack_int lda, const
lapack_complex_double* af, lapack_int ldaf, const lapack_int* ipiv, const double* r,
const double* c, const lapack_complex_double* b, lapack_int ldb, lapack_complex_double*
x, lapack_int ldx, double* rcond, double* berr, lapack_int n_err_bnds, double*
err_bnds_norm, double* err_bnds_comp, lapack_int nparams, double* params );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine improves the computed solution to a system of linear equations and provides error bounds and
backward error estimates for the solution. In addition to a normwise error bound, the code provides a
maximum componentwise error bound, if possible. See comments for err_bnds_norm and err_bnds_comp
for details of the error bounds.
The original system of linear equations may have been equilibrated before calling this routine, as described
by the parameters equed, r, and c below. In this case, the solution and error bounds returned are for the
original unequilibrated system.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
trans CHARACTER*1. Must be 'N', 'T', or 'C'.
Specifies the form of the system of equations:
If trans = 'N', the system has the form A*X = B (No transpose).
If trans = 'T', the system has the form A**T*X = B (Transpose).
If trans = 'C', the system has the form A**H*X = B (Conjugate
transpose = Transpose).
equed CHARACTER*1. Must be 'N', 'R', 'C', or 'B'.
Specifies the form of equilibration that was done to A before calling this
routine.
If equed = 'N', no equilibration was done.
If equed = 'R', row equilibration was done, that is, A has been
premultiplied by diag(r).
If equed = 'C', column equilibration was done, that is, A has been
postmultiplied by diag(c).
If equed = 'B', both row and column equilibration was done, that is, A has
been replaced by diag(r)*A*diag(c). The right-hand side B has been
changed accordingly.
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns of the
matrices B and X; nrhs = 0.
a, af, b, work REAL for sgerfsx
DOUBLE PRECISION for dgerfsx
LAPACK Routines: Linear Equations 3
453
COMPLEX for cgerfsx
DOUBLE COMPLEX for zgerfsx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the original n-by-n matrix A.
The array af contains the factored form of the matrix A, that is, the factors
L and U from the factorization A = P*L*U as computed by ?getrf.
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,4*n) for real flavors, and at least max(1,2*n) for complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). Contains the pivot indices as
computed by ?getrf; for row 1 = i = n, row i of the matrix was
interchanged with row ipiv(i).
r, c REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: r(n), c(n). The array r contains the row scale factors for A, and
the array c contains the column scale factors for A.
equed = 'R' or 'B', A is multiplied on the left by diag(r); if equed = 'N'
or 'C', r is not accessed.
If equed = 'R' or 'B', each element of r must be positive.
If equed = 'C' or 'B', A is multiplied on the right by diag(c); if equed =
'N' or 'R', c is not accessed.
If equed = 'C' or 'B', each element of c must be positive.
Each element of r or c should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
x REAL for sgerfsx
DOUBLE PRECISION for dgerfsx
COMPLEX for cgerfsx
DOUBLE COMPLEX for zgerfsx.
Array, DIMENSION (ldx,*).
The solution matrix X as computed by ?getrs
ldx INTEGER. The leading dimension of the output array x; ldx = max(1, n).
n_err_bnds INTEGER. Number of error bounds to return for each right hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry is filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
3 Intel® Math Kernel Library Reference Manual
454
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0
=0.0 No refinement is performed and no error bounds
are computed.
=1.0 Use the double-precision refinement algorithm,
possibly with doubled-single computations if the
compilation environment does not support
DOUBLE PRECISION.
(Other values are reserved for futute use.)
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for refinement.
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in real
flavors only.
rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Workspace array, DIMENSION at least max(1, 3*n); used in complex
flavors only.
Output Parameters
x REAL for sgerfsx
DOUBLE PRECISION for dgerfsx
COMPLEX for cgerfsx
DOUBLE COMPLEX for zgerfsx.
The improved solution matrix X.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
LAPACK Routines: Linear Equations 3
455
err_bnds_norm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
3 Intel® Math Kernel Library Reference Manual
456
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Output parameter only if the input contains erroneous values, namely, in
params(1), params(2), params(3). In such a case, the corresponding
elements of params are filled with default values on output.
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
LAPACK Routines: Linear Equations 3
457
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
?gbrfs
Refines the solution of a system of linear equations
with a general band matrix and estimates its error.
Syntax
Fortran 77:
call sgbrfs( trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, b, ldb, x, ldx, ferr,
berr, work, iwork, info )
call dgbrfs( trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, b, ldb, x, ldx, ferr,
berr, work, iwork, info )
call cgbrfs( trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, b, ldb, x, ldx, ferr,
berr, work, rwork, info )
call zgbrfs( trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, b, ldb, x, ldx, ferr,
berr, work, rwork, info )
Fortran 95:
call gbrfs( ab, afb, ipiv, b, x [,kl] [,trans] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_sgbrfs( int matrix_order, char trans, lapack_int n, lapack_int kl,
lapack_int ku, lapack_int nrhs, const float* ab, lapack_int ldab, const float* afb,
lapack_int ldafb, const lapack_int* ipiv, const float* b, lapack_int ldb, float* x,
lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dgbrfs( int matrix_order, char trans, lapack_int n, lapack_int kl,
lapack_int ku, lapack_int nrhs, const double* ab, lapack_int ldab, const double* afb,
lapack_int ldafb, const lapack_int* ipiv, const double* b, lapack_int ldb, double* x,
lapack_int ldx, double* ferr, double* berr );
lapack_int LAPACKE_cgbrfs( int matrix_order, char trans, lapack_int n, lapack_int kl,
lapack_int ku, lapack_int nrhs, const lapack_complex_float* ab, lapack_int ldab, const
lapack_complex_float* afb, lapack_int ldafb, const lapack_int* ipiv, const
lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx,
float* ferr, float* berr );
lapack_int LAPACKE_zgbrfs( int matrix_order, char trans, lapack_int n, lapack_int kl,
lapack_int ku, lapack_int nrhs, const lapack_complex_double* ab, lapack_int ldab, const
lapack_complex_double* afb, lapack_int ldafb, const lapack_int* ipiv, const
lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int ldx,
double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
3 Intel® Math Kernel Library Reference Manual
458
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B or AT*X
= B or AH*X = B with a band matrix A, with multiple right-hand sides. For each computed solution vector x,
the routine computes the component-wise backward error ß. This error is the smallest relative perturbation
in elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?gbtrf
• call the solver routine ?gbtrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
Indicates the form of the equations:
If trans = 'N', the system has the form A*X = B.
If trans = 'T', the system has the form AT*X = B.
If trans = 'C', the system has the form AH*X = B.
n INTEGER. The order of the matrix A; n = 0.
kl INTEGER. The number of sub-diagonals within the band of A; kl = 0.
ku INTEGER. The number of super-diagonals within the band of A; ku = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ab,afb,b,x,work REAL for sgbrfs
DOUBLE PRECISION for dgbrfs
COMPLEX for cgbrfs
DOUBLE COMPLEX for zgbrfs.
Arrays:
ab(ldab,*) contains the original band matrix A, as supplied to ?
gbtrf, but stored in rows from 1 to kl + ku + 1.
afb(ldafb,*) contains the factored band matrix A, as returned by ?
gbtrf.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The second dimension of ab and afb must be at least max(1, n); the
second dimension of b and x must be at least max(1, nrhs); the
dimension of work must be at least max(1, 3*n) for real flavors and
max(1, 2*n) for complex flavors.
ldab INTEGER. The leading dimension of ab.
ldafb INTEGER. The leading dimension of afb .
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
ipiv INTEGER.
LAPACK Routines: Linear Equations 3
459
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?gbtrf.
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for cgbrfs
DOUBLE PRECISION for zgbrfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info =0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gbrfs interface are as follows:
ab Holds the array A of size (kl+ku+1,n).
afb Holds the array AF of size (2*kl*ku+1,n).
ipiv Holds the vector of length n.
b Holds the matrix B of size (n, nrhs).
x Holds the matrix X of size (n, nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
kl If omitted, assumed kl = ku.
ku Restored as ku = lda-kl-1.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
For each right-hand side, computation of the backward error involves a minimum of 4n(kl + ku) floatingpoint
operations (for real flavors) or 16n(kl + ku) operations (for complex flavors). In addition, each step of
iterative refinement involves 2n(4kl + 3ku) operations (for real flavors) or 8n(4kl + 3ku) operations (for
complex flavors); the number of iterations may range from 1 to 5. Estimating the forward error involves
solving a number of systems of linear equations A*x = b; the number is usually 4 or 5 and never more than
11. Each solution requires approximately 2n2 floating-point operations for real flavors or 8n2 for complex
flavors.
3 Intel® Math Kernel Library Reference Manual
460
?gbrfsx
Uses extra precise iterative refinement to improve the
solution to the system of linear equations with a
banded matrix A and provides error bounds and
backward error estimates.
Syntax
Fortran 77:
call sgbrfsx( trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, r, c, b, ldb,
x, ldx, rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
iwork, info )
call dgbrfsx( trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, r, c, b, ldb,
x, ldx, rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
iwork, info )
call cgbrfsx( trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, r, c, b, ldb,
x, ldx, rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
rwork, info )
call zgbrfsx( trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, r, c, b, ldb,
x, ldx, rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
rwork, info )
C:
lapack_int LAPACKE_sgbrfsx( int matrix_order, char trans, char equed, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, const float* ab, lapack_int ldab, const
float* afb, lapack_int ldafb, const lapack_int* ipiv, const float* r, const float* c,
const float* b, lapack_int ldb, float* x, lapack_int ldx, float* rcond, float* berr,
lapack_int n_err_bnds, float* err_bnds_norm, float* err_bnds_comp, lapack_int nparams,
float* params );
lapack_int LAPACKE_dgbrfsx( int matrix_order, char trans, char equed, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, const double* ab, lapack_int ldab,
const double* afb, lapack_int ldafb, const lapack_int* ipiv, const double* r, const
double* c, const double* b, lapack_int ldb, double* x, lapack_int ldx, double* rcond,
double* berr, lapack_int n_err_bnds, double* err_bnds_norm, double* err_bnds_comp,
lapack_int nparams, double* params );
lapack_int LAPACKE_cgbrfsx( int matrix_order, char trans, char equed, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, const lapack_complex_float* ab,
lapack_int ldab, const lapack_complex_float* afb, lapack_int ldafb, const lapack_int*
ipiv, const float* r, const float* c, const lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* x, lapack_int ldx, float* rcond, float* berr, lapack_int
n_err_bnds, float* err_bnds_norm, float* err_bnds_comp, lapack_int nparams, float*
params );
lapack_int LAPACKE_zgbrfsx( int matrix_order, char trans, char equed, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, const lapack_complex_double* ab,
lapack_int ldab, const lapack_complex_double* afb, lapack_int ldafb, const lapack_int*
ipiv, const double* r, const double* c, const lapack_complex_double* b, lapack_int
ldb, lapack_complex_double* x, lapack_int ldx, double* rcond, double* berr, lapack_int
n_err_bnds, double* err_bnds_norm, double* err_bnds_comp, lapack_int nparams, double*
params );
LAPACK Routines: Linear Equations 3
461
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine improves the computed solution to a system of linear equations and provides error bounds and
backward error estimates for the solution. In addition to a normwise error bound, the code provides a
maximum componentwise error bound, if possible. See comments for err_bnds_norm and err_bnds_comp
for details of the error bounds.
The original system of linear equations may have been equilibrated before calling this routine, as described
by the parameters equed, r, and c below. In this case, the solution and error bounds returned are for the
original unequilibrated system.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
trans CHARACTER*1. Must be 'N', 'T', or 'C'.
Specifies the form of the system of equations:
If trans = 'N', the system has the form A*X = B (No transpose).
If trans = 'T', the system has the form A**T*X = B (Transpose).
If trans = 'C', the system has the form A**H*X = B (Conjugate
transpose = Transpose).
equed CHARACTER*1. Must be 'N', 'R', 'C', or 'B'.
Specifies the form of equilibration that was done to A before calling this
routine.
If equed = 'N', no equilibration was done.
If equed = 'R', row equilibration was done, that is, A has been
premultiplied by diag(r).
If equed = 'C', column equilibration was done, that is, A has been
postmultiplied by diag(c).
If equed = 'B', both row and column equilibration was done, that is, A has
been replaced by diag(r)*A*diag(c). The right-hand side B has been
changed accordingly.
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
kl INTEGER. The number of subdiagonals within the band of A; kl = 0.
ku INTEGER. The number of superdiagonals within the band of A; ku = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns of the
matrices B and X; nrhs = 0.
ab, afb, b, work REAL for sgbrfsx
DOUBLE PRECISION for dgbrfsx
COMPLEX for cgbrfsx
DOUBLE COMPLEX for zgbrfsx.
Arrays: ab(ldab,*), afb(ldafb,*), b(ldb,*), work(*).
The array ab contains the original matrix A in band storage, in rows 1 to kl
+ku+1. The j-th column of A is stored in the j-th column of the array ab as
follows:
ab(ku+1+i-j,j) = A(i,j) for max(1,j-ku) = i = min(n,j+kl).
3 Intel® Math Kernel Library Reference Manual
462
The array afb contains details of the LU factorization of the banded matrix
A as computed by ?gbtrf. U is stored as an upper triangular banded matrix
with kl + ku superdiagonals in rows 1 to kl + ku + 1. The multipliers used
during the factorization are stored in rows kl + ku + 2 to 2*kl + ku + 1.
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,4*n) for real flavors, and at least max(1,2*n) for complex flavors.
ldab INTEGER. The leading dimension of the array ab; ldab = kl+ku+1.
ldafb INTEGER. The leading dimension of the array afb; ldafb = 2*kl+ku+1.
ipiv INTEGER.
Array, DIMENSION at least max(1, n). Contains the pivot indices as
computed by ?gbtrf; for row 1 = i = n, row i of the matrix was
interchanged with row ipiv(i).
r, c REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: r(n), c(n). The array r contains the row scale factors for A, and
the array c contains the column scale factors for A.
If equed = 'R' or 'B', A is multiplied on the left by diag(r); if equed =
'N' or 'C', r is not accessed.
If equed = 'R' or 'B', each element of r must be positive.
If equed = 'C' or 'B', A is multiplied on the right by diag(c); if equed =
'N' or 'R', c is not accessed.
If equed = 'C' or 'B', each element of c must be positive.
Each element of r or c should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
x REAL for sgbrfsx
DOUBLE PRECISION for dgbrfsx
COMPLEX for cgbrfsx
DOUBLE COMPLEX for zgbrfsx.
Array, DIMENSION (ldx,*).
The solution matrix X as computed by sgbtrs/dgbtrs for real flavors or
cgbtrs/zgbtrs for complex flavors.
ldx INTEGER. The leading dimension of the output array x; ldx = max(1, n).
n_err_bnds INTEGER. Number of error bounds to return for each right-hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry will be filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
LAPACK Routines: Linear Equations 3
463
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0 (for single precision flavors), 1.0D+0 (for
double precision flavors).
=0.0 No refinement is performed and no error bounds
are computed.
=1.0 Use the double-precision refinement algorithm,
possibly with doubled-single computations if the
compilation environment does not support
DOUBLE PRECISION.
(Other values are reserved for futute use.)
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for refinement.
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in real
flavors only.
rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Workspace array, DIMENSION at least max(1, 3*n); used in complex
flavors only.
Output Parameters
x REAL for sgbrfsx
DOUBLE PRECISION for dgbrfsx
COMPLEX for cgbrfsx
DOUBLE COMPLEX for zgbrfsx.
The improved solution matrix X.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
3 Intel® Math Kernel Library Reference Manual
464
err_bnds_norm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the following three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
LAPACK Routines: Linear Equations 3
465
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Output parameter only if the input contains erroneous values, namely, in
params(1), params(2), params(3). In such a case, the corresponding
elements of params are filled with default values on output.
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
3 Intel® Math Kernel Library Reference Manual
466
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
?gtrfs
Refines the solution of a system of linear equations
with a tridiagonal matrix and estimates its error.
Syntax
Fortran 77:
call sgtrfs( trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x, ldx,
ferr, berr, work, iwork, info )
call dgtrfs( trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x, ldx,
ferr, berr, work, iwork, info )
call cgtrfs( trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x, ldx,
ferr, berr, work, rwork, info )
call zgtrfs( trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x, ldx,
ferr, berr, work, rwork, info )
Fortran 95:
call gtrfs( dl, d, du, dlf, df, duf, du2, ipiv, b, x [,trans] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_sgtrfs( int matrix_order, char trans, lapack_int n, lapack_int nrhs,
const float* dl, const float* d, const float* du, const float* dlf, const float* df,
const float* duf, const float* du2, const lapack_int* ipiv, const float* b, lapack_int
ldb, float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dgtrfs( int matrix_order, char trans, lapack_int n, lapack_int nrhs,
const double* dl, const double* d, const double* du, const double* dlf, const double*
df, const double* duf, const double* du2, const lapack_int* ipiv, const double* b,
lapack_int ldb, double* x, lapack_int ldx, double* ferr, double* berr );
lapack_int LAPACKE_cgtrfs( int matrix_order, char trans, lapack_int n, lapack_int nrhs,
const lapack_complex_float* dl, const lapack_complex_float* d, const
lapack_complex_float* du, const lapack_complex_float* dlf, const lapack_complex_float*
df, const lapack_complex_float* duf, const lapack_complex_float* du2, const lapack_int*
ipiv, const lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x,
lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_zgtrfs( int matrix_order, char trans, lapack_int n, lapack_int nrhs,
const lapack_complex_double* dl, const lapack_complex_double* d, const
lapack_complex_double* du, const lapack_complex_double* dlf, const
lapack_complex_double* df, const lapack_complex_double* duf, const
lapack_complex_double* du2, const lapack_int* ipiv, const lapack_complex_double* b,
lapack_int ldb, lapack_complex_double* x, lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
LAPACK Routines: Linear Equations 3
467
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B or AT*X
= B or AH*X = B with a tridiagonal matrix A, with multiple right-hand sides. For each computed solution
vector x, the routine computes the component-wise backward error ß. This error is the smallest relative
perturbation in elements of A and b such that x is the exact solution of the perturbed system:
|daij|/|aij| = ß|aij|, |dbi|/|bi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?gttrf
• call the solver routine ?gttrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
Indicates the form of the equations:
If trans = 'N', the system has the form A*X = B.
If trans = 'T', the system has the form AT*X = B.
If trans = 'C', the system has the form AH*X = B.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, that is, the number of
columns of the matrix B; nrhs = 0.
dl,d,du,dlf,
df,duf,du2,
b,x,work
REAL for sgtrfs
DOUBLE PRECISION for dgtrfs
COMPLEX for cgtrfs
DOUBLE COMPLEX for zgtrfs.
Arrays:
dl, dimension (n -1), contains the subdiagonal elements of A.
d, dimension (n), contains the diagonal elements of A.
du, dimension (n -1), contains the superdiagonal elements of A.
dlf, dimension (n -1), contains the (n - 1) multipliers that define the
matrix L from the LU factorization of A as computed by ?gttrf.
df, dimension (n), contains the n diagonal elements of the upper
triangular matrix U from the LU factorization of A.
duf, dimension (n -1), contains the (n - 1) elements of the first
superdiagonal of U.
du2, dimension (n -2), contains the (n - 2) elements of the second
superdiagonal of U.
b(ldb,nrhs) contains the right-hand side matrix B.
x(ldx,nrhs) contains the solution matrix X, as computed by ?gttrs.
work(*) is a workspace array; the dimension of work must be at least
max(1, 3*n) for real flavors and max(1, 2*n) for complex flavors.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
3 Intel® Math Kernel Library Reference Manual
468
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?gttrf.
iwork INTEGER. Workspace array, DIMENSION (n). Used for real flavors only.
rwork REAL for cgtrfs
DOUBLE PRECISION for zgtrfs.
Workspace array, DIMENSION (n). Used for complex flavors only.
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1,nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gtrfs interface are as follows:
dl Holds the vector of length (n-1).
d Holds the vector of length n.
du Holds the vector of length (n-1).
dlf Holds the vector of length (n-1).
df Holds the vector of length n.
duf Holds the vector of length (n-1).
du2 Holds the vector of length (n-2).
ipiv Holds the vector of length n.
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
?porfs
Refines the solution of a system of linear equations
with a symmetric (Hermitian) positive-definite matrix
and estimates its error.
Syntax
Fortran 77:
call sporfs( uplo, n, nrhs, a, lda, af, ldaf, b, ldb, x, ldx, ferr, berr, work, iwork,
info )
LAPACK Routines: Linear Equations 3
469
call dporfs( uplo, n, nrhs, a, lda, af, ldaf, b, ldb, x, ldx, ferr, berr, work, iwork,
info )
call cporfs( uplo, n, nrhs, a, lda, af, ldaf, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
call zporfs( uplo, n, nrhs, a, lda, af, ldaf, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
Fortran 95:
call porfs( a, af, b, x [,uplo] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_sporfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const float* a, lapack_int lda, const float* af, lapack_int ldaf, const float* b,
lapack_int ldb, float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dporfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const double* a, lapack_int lda, const double* af, lapack_int ldaf, const double* b,
lapack_int ldb, double* x, lapack_int ldx, double* ferr, double* berr );
lapack_int LAPACKE_cporfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_float* a, lapack_int lda, const lapack_complex_float* af,
lapack_int ldaf, const lapack_complex_float* b, lapack_int ldb, lapack_complex_float*
x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_zporfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_double* a, lapack_int lda, const lapack_complex_double* af,
lapack_int ldaf, const lapack_complex_double* b, lapack_int ldb, lapack_complex_double*
x, lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B with a
symmetric (Hermitian) positive definite matrix A, with multiple right-hand sides. For each computed solution
vector x, the routine computes the component-wise backward error ß. This error is the smallest relative
perturbation in elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?potrf
• call the solver routine ?potrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
3 Intel® Math Kernel Library Reference Manual
470
uplo CHARACTER*1. Must be 'U' or 'L'.
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
a,af,b,x,work REAL for sporfs
DOUBLE PRECISION for dporfs
COMPLEX for cporfs
DOUBLE COMPLEX for zporfs.
Arrays:
a(lda,*) contains the original matrix A, as supplied to ?potrf.
af(ldaf,*) contains the factored matrix A, as returned by ?potrf.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The second dimension of a and af must be at least max(1, n); the
second dimension of b and x must be at least max(1, nrhs); the
dimension of work must be at least max(1, 3*n) for real flavors and
max(1, 2*n) for complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for cporfs
DOUBLE PRECISION for zporfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine porfs interface are as follows:
a Holds the matrix A of size (n,n).
af Holds the matrix AF of size (n,n).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
LAPACK Routines: Linear Equations 3
471
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
For each right-hand side, computation of the backward error involves a minimum of 4n2 floating-point
operations (for real flavors) or 16n2 operations (for complex flavors). In addition, each step of iterative
refinement involves 6n2 operations (for real flavors) or 24n2 operations (for complex flavors); the number of
iterations may range from 1 to 5. Estimating the forward error involves solving a number of systems of linear
equations A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires
approximately 2n2 floating-point operations for real flavors or 8n2 for complex flavors.
?porfsx
Uses extra precise iterative refinement to improve the
solution to the system of linear equations with a
symmetric/Hermitian positive-definite matrix A and
provides error bounds and backward error estimates.
Syntax
Fortran 77:
call sporfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, s, b, ldb, x, ldx, rcond, berr,
n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info )
call dporfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, s, b, ldb, x, ldx, rcond, berr,
n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info )
call cporfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, s, b, ldb, x, ldx, rcond, berr,
n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info )
call zporfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, s, b, ldb, x, ldx, rcond, berr,
n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info )
C:
lapack_int LAPACKE_sporfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const float* a, lapack_int lda, const float* af, lapack_int ldaf,
const float* s, const float* b, lapack_int ldb, float* x, lapack_int ldx, float*
rcond, float* berr, lapack_int n_err_bnds, float* err_bnds_norm, float* err_bnds_comp,
lapack_int nparams, float* params );
lapack_int LAPACKE_dporfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const double* a, lapack_int lda, const double* af, lapack_int ldaf,
const double* s, const double* b, lapack_int ldb, double* x, lapack_int ldx, double*
rcond, double* berr, lapack_int n_err_bnds, double* err_bnds_norm, double*
err_bnds_comp, lapack_int nparams, double* params );
lapack_int LAPACKE_cporfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const lapack_complex_float* a, lapack_int lda, const
lapack_complex_float* af, lapack_int ldaf, const float* s, const lapack_complex_float*
b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx, float* rcond, float* berr,
lapack_int n_err_bnds, float* err_bnds_norm, float* err_bnds_comp, lapack_int nparams,
float* params );
3 Intel® Math Kernel Library Reference Manual
472
lapack_int LAPACKE_zporfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const lapack_complex_double* a, lapack_int lda, const
lapack_complex_double* af, lapack_int ldaf, const double* s, const
lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int ldx,
double* rcond, double* berr, lapack_int n_err_bnds, double* err_bnds_norm, double*
err_bnds_comp, lapack_int nparams, double* params );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine improves the computed solution to a system of linear equations and provides error bounds and
backward error estimates for the solution. In addition to a normwise error bound, the code provides a
maximum componentwise error bound, if possible. See comments for err_bnds_norm and err_bnds_comp
for details of the error bounds.
The original system of linear equations may have been equilibrated before calling this routine, as described
by the parameters equed and s below. In this case, the solution and error bounds returned are for the
original unequilibrated system.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
equed CHARACTER*1. Must be 'N' or 'Y'.
Specifies the form of equilibration that was done to A before calling this
routine.
If equed = 'N', no equilibration was done.
If equed = 'Y', both row and column equilibration was done, that is, A has
been replaced by diag(s)*A*diag(s). The right-hand side B has been
changed accordingly.
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns of the
matrices B and X; nrhs = 0.
a, af, b, work REAL for sporfsx
DOUBLE PRECISION for dporfsx
COMPLEX for cporfsx
DOUBLE COMPLEX for zporfsx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the symmetric/Hermitian matrix A as specified by
uplo. If uplo = 'U', the leading n-by-n upper triangular part of a contains
the upper triangular part of the matrix A and the strictly lower triangular
part of a is not referenced. If uplo = 'L', the leading n-by-n lower
LAPACK Routines: Linear Equations 3
473
triangular part of a contains the lower triangular part of the matrix A and
the strictly upper triangular part of a is not referenced. The second
dimension of a must be at least max(1,n).
The array af contains the triangular factor L or U from the Cholesky
factorization A = U**T*U or A = L*L**T as computed by spotrf for real
flavors or dpotrf for complex flavors.
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,4*n) for real flavors, and at least max(1,2*n) for complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n). The array s contains the scale factors for A.
If equed = 'N', s is not accessed.
If equed = 'Y', each element of s must be positive.
Each element of s should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
x REAL for sporfsx
DOUBLE PRECISION for dporfsx
COMPLEX for cporfsx
DOUBLE COMPLEX for zporfsx.
Array, DIMENSION (ldx,*).
The solution matrix X as computed by ?potrs
ldx INTEGER. The leading dimension of the output array x; ldx = max(1, n).
n_err_bnds INTEGER. Number of error bounds to return for each right hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry will be filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0 (for single precision flavors), 1.0D+0 (for
double precision flavors).
=0.0 No refinement is performed and no error bounds
are computed.
3 Intel® Math Kernel Library Reference Manual
474
=1.0 Use the double-precision refinement algorithm,
possibly with doubled-single computations if the
compilation environment does not support
DOUBLE PRECISION.
(Other values are reserved for futute use.)
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for refinement.
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in real
flavors only.
rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Workspace array, DIMENSION at least max(1, 3*n); used in complex
flavors only.
Output Parameters
x REAL for sporfsx
DOUBLE PRECISION for dporfsx
COMPLEX for cporfsx
DOUBLE COMPLEX for zporfsx.
The improved solution matrix X.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
err_bnds_norm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
LAPACK Routines: Linear Equations 3
475
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
3 Intel® Math Kernel Library Reference Manual
476
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Output parameter only if the input contains erroneous values. namely, in
params(1), params(2), params(3). In such a case, the corresponding
elements of params are filled with default values on output.
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
LAPACK Routines: Linear Equations 3
477
?pprfs
Refines the solution of a system of linear equations
with a packed symmetric (Hermitian) positive-definite
matrix and estimates its error.
Syntax
Fortran 77:
call spprfs( uplo, n, nrhs, ap, afp, b, ldb, x, ldx, ferr, berr, work, iwork, info )
call dpprfs( uplo, n, nrhs, ap, afp, b, ldb, x, ldx, ferr, berr, work, iwork, info )
call cpprfs( uplo, n, nrhs, ap, afp, b, ldb, x, ldx, ferr, berr, work, rwork, info )
call zpprfs( uplo, n, nrhs, ap, afp, b, ldb, x, ldx, ferr, berr, work, rwork, info )
Fortran 95:
call pprfs( ap, afp, b, x [,uplo] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_spprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const float* ap, const float* afp, const float* b, lapack_int ldb, float* x,
lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dpprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const double* ap, const double* afp, const double* b, lapack_int ldb, double* x,
lapack_int ldx, double* ferr, double* berr );
lapack_int LAPACKE_cpprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_float* ap, const lapack_complex_float* afp, const
lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx,
float* ferr, float* berr );
lapack_int LAPACKE_zpprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_double* ap, const lapack_complex_double* afp, const
lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int ldx,
double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B with a
packed symmetric (Hermitian)positive definite matrix A, with multiple right-hand sides. For each computed
solution vector x, the routine computes the component-wise backward error ß. This error is the smallest
relative perturbation in elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution
||x - xe||8/||x||8
where xe is the exact solution.
Before calling this routine:
3 Intel® Math Kernel Library Reference Manual
478
• call the factorization routine ?pptrf
• call the solver routine ?pptrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ap, afp, b, x, work REAL for spprfs
DOUBLE PRECISION for dpprfs
COMPLEX for cpprfs
DOUBLE COMPLEX for zpprfs.
Arrays:
ap(*) contains the original packed matrix A, as supplied to ?pptrf.
afp(*) contains the factored packed matrix A, as returned by ?
pptrf.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The dimension of arrays ap and afp must be at least max(1,n(n+1)/
2); the second dimension of b and x must be at least max(1, nrhs);
the dimension of work must be at least max(1, 3*n) for real flavors
and max(1, 2*n) for complex flavors.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for cpprfs
DOUBLE PRECISION for zpprfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pprfs interface are as follows:
LAPACK Routines: Linear Equations 3
479
ap Holds the array A of size (n*(n+1)/2).
afp Holds the array AF of size (n*(n+1)/2).
b Holds the matrix B of size (n, nrhs).
x Holds the matrix X of size (n, nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
For each right-hand side, computation of the backward error involves a minimum of 4n2 floating-point
operations (for real flavors) or 16n2 operations (for complex flavors). In addition, each step of iterative
refinement involves 6n2 operations (for real flavors) or 24n2 operations (for complex flavors); the number of
iterations may range from 1 to 5.
Estimating the forward error involves solving a number of systems of linear equations A*x = b; the number
of systems is usually 4 or 5 and never more than 11. Each solution requires approximately 2n2 floating-point
operations for real flavors or 8n2 for complex flavors.
?pbrfs
Refines the solution of a system of linear equations
with a band symmetric (Hermitian) positive-definite
matrix and estimates its error.
Syntax
Fortran 77:
call spbrfs( uplo, n, kd, nrhs, ab, ldab, afb, ldafb, b, ldb, x, ldx, ferr, berr,
work, iwork, info )
call dpbrfs( uplo, n, kd, nrhs, ab, ldab, afb, ldafb, b, ldb, x, ldx, ferr, berr,
work, iwork, info )
call cpbrfs( uplo, n, kd, nrhs, ab, ldab, afb, ldafb, b, ldb, x, ldx, ferr, berr,
work, rwork, info )
call zpbrfs( uplo, n, kd, nrhs, ab, ldab, afb, ldafb, b, ldb, x, ldx, ferr, berr,
work, rwork, info )
Fortran 95:
call pbrfs( ab, afb, b, x [,uplo] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_spbrfs( int matrix_order, char uplo, lapack_int n, lapack_int kd,
lapack_int nrhs, const float* ab, lapack_int ldab, const float* afb, lapack_int ldafb,
const float* b, lapack_int ldb, float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dpbrfs( int matrix_order, char uplo, lapack_int n, lapack_int kd,
lapack_int nrhs, const double* ab, lapack_int ldab, const double* afb, lapack_int
ldafb, const double* b, lapack_int ldb, double* x, lapack_int ldx, double* ferr,
double* berr );
3 Intel® Math Kernel Library Reference Manual
480
lapack_int LAPACKE_cpbrfs( int matrix_order, char uplo, lapack_int n, lapack_int kd,
lapack_int nrhs, const lapack_complex_float* ab, lapack_int ldab, const
lapack_complex_float* afb, lapack_int ldafb, const lapack_complex_float* b, lapack_int
ldb, lapack_complex_float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_zpbrfs( int matrix_order, char uplo, lapack_int n, lapack_int kd,
lapack_int nrhs, const lapack_complex_double* ab, lapack_int ldab, const
lapack_complex_double* afb, lapack_int ldafb, const lapack_complex_double* b,
lapack_int ldb, lapack_complex_double* x, lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B with a
symmetric (Hermitian) positive definite band matrix A, with multiple right-hand sides. For each computed
solution vector x, the routine computes the component-wise backward error ß. This error is the smallest
relative perturbation in elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?pbtrf
• call the solver routine ?pbtrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of the matrix A; n = 0.
kd INTEGER. The number of superdiagonals or subdiagonals in the matrix
A; kd = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ab,afb,b,x,work REAL for spbrfs
DOUBLE PRECISION for dpbrfs
COMPLEX for cpbrfs
DOUBLE COMPLEX for zpbrfs.
Arrays:
ab(ldab,*) contains the original band matrix A, as supplied to ?
pbtrf.
afb(ldafb,*) contains the factored band matrix A, as returned by ?
pbtrf.
LAPACK Routines: Linear Equations 3
481
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The second dimension of ab and afb must be at least max(1, n); the
second dimension of b and x must be at least max(1, nrhs); the
dimension of work must be at least max(1, 3*n) for real flavors and
max(1, 2*n) for complex flavors.
ldab INTEGER. The leading dimension of ab; ldab = kd + 1.
ldafb INTEGER. The leading dimension of afb; ldafb = kd + 1.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for cpbrfs
DOUBLE PRECISION for zpbrfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pbrfs interface are as follows:
ab Holds the array A of size (kd+1, n).
afb Holds the array AF of size (kd+1, n).
b Holds the matrix B of size (n, nrhs).
x Holds the matrix X of size (n, nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
For each right-hand side, computation of the backward error involves a minimum of 8n*kd floating-point
operations (for real flavors) or 32n*kd operations (for complex flavors). In addition, each step of iterative
refinement involves 12n*kd operations (for real flavors) or 48n*kd operations (for complex flavors); the
number of iterations may range from 1 to 5.
3 Intel® Math Kernel Library Reference Manual
482
Estimating the forward error involves solving a number of systems of linear equations A*x = b; the number
is usually 4 or 5 and never more than 11. Each solution requires approximately 4n*kd floating-point
operations for real flavors or 16n*kd for complex flavors.
?ptrfs
Refines the solution of a system of linear equations
with a symmetric (Hermitian) positive-definite
tridiagonal matrix and estimates its error.
Syntax
Fortran 77:
call sptrfs( n, nrhs, d, e, df, ef, b, ldb, x, ldx, ferr, berr, work, info )
call dptrfs( n, nrhs, d, e, df, ef, b, ldb, x, ldx, ferr, berr, work, info )
call cptrfs( uplo, n, nrhs, d, e, df, ef, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
call zptrfs( uplo, n, nrhs, d, e, df, ef, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
Fortran 95:
call ptrfs( d, df, e, ef, b, x [,ferr] [,berr] [,info] )
call ptrfs( d, df, e, ef, b, x [,uplo] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_sptrfs( int matrix_order, lapack_int n, lapack_int nrhs, const
float* d, const float* e, const float* df, const float* ef, const float* b, lapack_int
ldb, float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dptrfs( int matrix_order, lapack_int n, lapack_int nrhs, const
double* d, const double* e, const double* df, const double* ef, const double* b,
lapack_int ldb, double* x, lapack_int ldx, double* ferr, double* berr );
lapack_int LAPACKE_cptrfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const float* d, const lapack_complex_float* e, const float* df, const
lapack_complex_float* ef, const lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_zptrfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const double* d, const lapack_complex_double* e, const double* df, const
lapack_complex_double* ef, const lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* x, lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
LAPACK Routines: Linear Equations 3
483
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B with a
symmetric (Hermitian) positive definite tridiagonal matrix A, with multiple right-hand sides. For each
computed solution vector x, the routine computes the component-wise backward error ß. This error is the
smallest relative perturbation in elements of A and b such that x is the exact solution of the perturbed
system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?pttrf
• call the solver routine ?pttrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Used for complex flavors only. Must be 'U' or 'L'.
Specifies whether the superdiagonal or the subdiagonal of the
tridiagonal matrix A is stored and how A is factored:
If uplo = 'U', the array e stores the superdiagonal of A, and A is
factored as UH*D*U.
If uplo = 'L', the array e stores the subdiagonal of A, and A is
factored as L*D*LH.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
d, df, rwork REAL for single precision flavors DOUBLE PRECISION for double
precision flavors
Arrays: d(n), df(n), rwork(n).
The array d contains the n diagonal elements of the tridiagonal matrix
A.
The array df contains the n diagonal elements of the diagonal matrix
D from the factorization of A as computed by ?pttrf.
The array rwork is a workspace array used for complex flavors only.
e,ef,b,x,work REAL for sptrfs
DOUBLE PRECISION for dptrfs
COMPLEX for cptrfs
DOUBLE COMPLEX for zptrfs.
Arrays: e(n -1), ef(n -1), b(ldb,nrhs), x(ldx,nrhs), work(*).
The array e contains the (n - 1) off-diagonal elements of the
tridiagonal matrix A (see uplo).
The array ef contains the (n - 1) off-diagonal elements of the unit
bidiagonal factor U or L from the factorization computed by ?pttrf
(see uplo).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
The array x contains the solution matrix X as computed by ?pttrs.
The array work is a workspace array. The dimension of work must be
at least 2*n for real flavors, and at least n for complex flavors.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
3 Intel® Math Kernel Library Reference Manual
484
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine ptrfs interface are as follows:
d Holds the vector of length n.
df Holds the vector of length n.
e Holds the vector of length (n-1).
ef Holds the vector of length (n-1).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Used in complex flavors only. Must be 'U' or 'L'. The default value is
'U'.
?syrfs
Refines the solution of a system of linear equations
with a symmetric matrix and estimates its error.
Syntax
Fortran 77:
call ssyrfs( uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
iwork, info )
call dsyrfs( uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
iwork, info )
call csyrfs( uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
rwork, info )
call zsyrfs( uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
rwork, info )
Fortran 95:
call syrfs( a, af, ipiv, b, x [,uplo] [,ferr] [,berr] [,info] )
LAPACK Routines: Linear Equations 3
485
C:
lapack_int LAPACKE_ssyrfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const float* a, lapack_int lda, const float* af, lapack_int ldaf, const lapack_int*
ipiv, const float* b, lapack_int ldb, float* x, lapack_int ldx, float* ferr, float*
berr );
lapack_int LAPACKE_dsyrfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const double* a, lapack_int lda, const double* af, lapack_int ldaf, const lapack_int*
ipiv, const double* b, lapack_int ldb, double* x, lapack_int ldx, double* ferr,
double* berr );
lapack_int LAPACKE_csyrfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_float* a, lapack_int lda, const lapack_complex_float* af,
lapack_int ldaf, const lapack_int* ipiv, const lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_zsyrfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_double* a, lapack_int lda, const lapack_complex_double* af,
lapack_int ldaf, const lapack_int* ipiv, const lapack_complex_double* b, lapack_int
ldb, lapack_complex_double* x, lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B with a
symmetric full-storage matrix A, with multiple right-hand sides. For each computed solution vector x, the
routine computes the component-wise backward error ß. This error is the smallest relative perturbation in
elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?sytrf
• call the solver routine ?sytrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
a,af,b,x,work REAL for ssyrfs
DOUBLE PRECISION for dsyrfs
3 Intel® Math Kernel Library Reference Manual
486
COMPLEX for csyrfs
DOUBLE COMPLEX for zsyrfs.
Arrays:
a(lda,*) contains the original matrix A, as supplied to ?sytrf.
af(ldaf,*) contains the factored matrix A, as returned by ?sytrf.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The second dimension of a and af must be at least max(1, n); the
second dimension of b and x must be at least max(1, nrhs); the
dimension of work must be at least max(1, 3*n) for real flavors and
max(1, 2*n) for complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?sytrf.
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for csyrfs
DOUBLE PRECISION for zsyrfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine syrfs interface are as follows:
a Holds the matrix A of size (n,n).
af Holds the matrix AF of size (n,n).
ipiv Holds the vector of length n.
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
LAPACK Routines: Linear Equations 3
487
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
For each right-hand side, computation of the backward error involves a minimum of 4n2 floating-point
operations (for real flavors) or 16n2 operations (for complex flavors). In addition, each step of iterative
refinement involves 6n2 operations (for real flavors) or 24n2 operations (for complex flavors); the number of
iterations may range from 1 to 5. Estimating the forward error involves solving a number of systems of linear
equations A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires
approximately 2n2 floating-point operations for real flavors or 8n2 for complex flavors.
?syrfsx
Uses extra precise iterative refinement to improve the
solution to the system of linear equations with a
symmetric indefinite matrix A and provides error
bounds and backward error estimates.
Syntax
Fortran 77:
call ssyrfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv, s, b, ldb, x, ldx, rcond,
berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info )
call dsyrfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv, s, b, ldb, x, ldx, rcond,
berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info )
call csyrfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv, s, b, ldb, x, ldx, rcond,
berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info )
call zsyrfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv, s, b, ldb, x, ldx, rcond,
berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info )
C:
lapack_int LAPACKE_ssyrfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const float* a, lapack_int lda, const float* af, lapack_int ldaf,
const lapack_int* ipiv, const float* s, const float* b, lapack_int ldb, float* x,
lapack_int ldx, float* rcond, float* berr, lapack_int n_err_bnds, float*
err_bnds_norm, float* err_bnds_comp, lapack_int nparams, float* params );
lapack_int LAPACKE_dsyrfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const double* a, lapack_int lda, const double* af, lapack_int ldaf,
const lapack_int* ipiv, const double* s, const double* b, lapack_int ldb, double* x,
lapack_int ldx, double* rcond, double* berr, lapack_int n_err_bnds, double*
err_bnds_norm, double* err_bnds_comp, lapack_int nparams, double* params );
lapack_int LAPACKE_csyrfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const lapack_complex_float* a, lapack_int lda, const
lapack_complex_float* af, lapack_int ldaf, const lapack_int* ipiv, const float* s,
const lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx,
float* rcond, float* berr, lapack_int n_err_bnds, float* err_bnds_norm, float*
err_bnds_comp, lapack_int nparams, float* params );
lapack_int LAPACKE_zsyrfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const lapack_complex_double* a, lapack_int lda, const
lapack_complex_double* af, lapack_int ldaf, const lapack_int* ipiv, const double* s,
3 Intel® Math Kernel Library Reference Manual
488
const lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int
ldx, double* rcond, double* berr, lapack_int n_err_bnds, double* err_bnds_norm,
double* err_bnds_comp, lapack_int nparams, double* params );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine improves the computed solution to a system of linear equations when the coefficient matrix is
symmetric indefinite, and provides error bounds and backward error estimates for the solution. In addition to
a normwise error bound, the code provides a maximum componentwise error bound, if possible. See
comments for err_bnds_norm and err_bnds_comp for details of the error bounds.
The original system of linear equations may have been equilibrated before calling this routine, as described
by the parameters equed and s below. In this case, the solution and error bounds returned are for the
original unequilibrated system.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
equed CHARACTER*1. Must be 'N' or 'Y'.
Specifies the form of equilibration that was done to A before calling this
routine.
If equed = 'N', no equilibration was done.
If equed = 'Y', both row and column equilibration was done, that is, A has
been replaced by diag(s)*A*diag(s). The right-hand side B has been
changed accordingly.
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns of the
matrices B and X; nrhs = 0.
a, af, b, work REAL for ssyrfsx
DOUBLE PRECISION for dsyrfsx
COMPLEX for csyrfsx
DOUBLE COMPLEX for zsyrfsx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the symmetric/Hermitian matrix A as specified by
uplo. If uplo = 'U', the leading n-by-n upper triangular part of a contains
the upper triangular part of the matrix A and the strictly lower triangular
part of a is not referenced. If uplo = 'L', the leading n-by-n lower
triangular part of a contains the lower triangular part of the matrix A and
the strictly upper triangular part of a is not referenced. The second
dimension of a must be at least max(1,n).
LAPACK Routines: Linear Equations 3
489
The array af contains the triangular factor L or U from the Cholesky
factorization A = U**T*U or A = L*L**T as computed by ssytrf for real
flavors or dsytrf for complex flavors.
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,4*n) for real flavors, and at least max(1,2*n) for complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). Contains details of the interchanges
and the block structure of D as determined by ssytrf for real flavors or
dsytrf for complex flavors.
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n). The array s contains the scale factors for A.
If equed = 'N', s is not accessed.
If equed = 'Y', each element of s must be positive.
Each element of s should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
x REAL for ssyrfsx
DOUBLE PRECISION for dsyrfsx
COMPLEX for csyrfsx
DOUBLE COMPLEX for zsyrfsx.
Array, DIMENSION (ldx,*).
The solution matrix X as computed by ?sytrs
ldx INTEGER. The leading dimension of the output array x; ldx = max(1, n).
n_err_bnds INTEGER. Number of error bounds to return for each right hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry will be filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0 (for single precision flavors), 1.0D+0 (for
double precision flavors).
=0.0 No refinement is performed and no error bounds
are computed.
3 Intel® Math Kernel Library Reference Manual
490
=1.0 Use the double-precision refinement algorithm,
possibly with doubled-single computations if the
compilation environment does not support
DOUBLE PRECISION.
(Other values are reserved for futute use.)
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for refinement.
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in real
flavors only.
rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Workspace array, DIMENSION at least max(1, 3*n); used in complex
flavors only.
Output Parameters
x REAL for ssyrfsx
DOUBLE PRECISION for dsyrfsx
COMPLEX for csyrfsx
DOUBLE COMPLEX for zsyrfsx.
The improved solution matrix X.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
err_bnds_norm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
LAPACK Routines: Linear Equations 3
491
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
3 Intel® Math Kernel Library Reference Manual
492
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Output parameter only if the input contains erroneous values, namely, in
params(1), params(2), params(3). In such a case, the corresponding
elements of params are filled with default values on output.
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
LAPACK Routines: Linear Equations 3
493
?herfs
Refines the solution of a system of linear equations
with a complex Hermitian matrix and estimates its
error.
Syntax
Fortran 77:
call cherfs( uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
rwork, info )
call zherfs( uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work,
rwork, info )
Fortran 95:
call herfs( a, af, ipiv, b, x [,uplo] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_cherfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_float* a, lapack_int lda, const lapack_complex_float* af,
lapack_int ldaf, const lapack_int* ipiv, const lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_zherfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_double* a, lapack_int lda, const lapack_complex_double* af,
lapack_int ldaf, const lapack_int* ipiv, const lapack_complex_double* b, lapack_int
ldb, lapack_complex_double* x, lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B with a
complex Hermitian full-storage matrix A, with multiple right-hand sides. For each computed solution vector x,
the routine computes the component-wise backward error ß. This error is the smallest relative perturbation
in elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?hetrf
• call the solver routine ?hetrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
3 Intel® Math Kernel Library Reference Manual
494
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
a,af,b,x,work COMPLEX for cherfs
DOUBLE COMPLEX for zherfs.
Arrays:
a(lda,*) contains the original matrix A, as supplied to ?hetrf.
af(ldaf,*) contains the factored matrix A, as returned by ?hetrf.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The second dimension of a and af must be at least max(1, n); the
second dimension of b and x must be at least max(1, nrhs); the
dimension of work must be at least max(1, 2*n).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?hetrf.
rwork REAL for cherfs
DOUBLE PRECISION for zherfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for cherfs
DOUBLE PRECISION for zherfs.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine herfs interface are as follows:
a Holds the matrix A of size (n,n).
af Holds the matrix AF of size (n,n).
ipiv Holds the vector of length n.
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
ferr Holds the vector of length (nrhs).
LAPACK Routines: Linear Equations 3
495
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
For each right-hand side, computation of the backward error involves a minimum of 16n2 operations. In
addition, each step of iterative refinement involves 24n2 operations; the number of iterations may range
from 1 to 5.
Estimating the forward error involves solving a number of systems of linear equations A*x = b; the number
is usually 4 or 5 and never more than 11. Each solution requires approximately 8n2 floating-point operations.
The real counterpart of this routine is ?ssyrfs/?dsyrfs
?herfsx
Uses extra precise iterative refinement to improve the
solution to the system of linear equations with a
symmetric indefinite matrix A and provides error
bounds and backward error estimates.
Syntax
Fortran 77:
call cherfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv, s, b, ldb, x, ldx, rcond,
berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info )
call zherfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv, s, b, ldb, x, ldx, rcond,
berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info )
C:
lapack_int LAPACKE_cherfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const lapack_complex_float* a, lapack_int lda, const
lapack_complex_float* af, lapack_int ldaf, const lapack_int* ipiv, const float* s,
const lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx,
float* rcond, float* berr, lapack_int n_err_bnds, float* err_bnds_norm, float*
err_bnds_comp, lapack_int nparams, float* params );
lapack_int LAPACKE_zherfsx( int matrix_order, char uplo, char equed, lapack_int n,
lapack_int nrhs, const lapack_complex_double* a, lapack_int lda, const
lapack_complex_double* af, lapack_int ldaf, const lapack_int* ipiv, const double* s,
const lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int
ldx, double* rcond, double* berr, lapack_int n_err_bnds, double* err_bnds_norm,
double* err_bnds_comp, lapack_int nparams, double* params );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
3 Intel® Math Kernel Library Reference Manual
496
The routine improves the computed solution to a system of linear equations when the coefficient matrix is
Hermitian indefinite, and provides error bounds and backward error estimates for the solution. In addition to
a normwise error bound, the code provides a maximum componentwise error bound, if possible. See
comments for err_bnds_norm and err_bnds_comp for details of the error bounds.
The original system of linear equations may have been equilibrated before calling this routine, as described
by the parameters equed and s below. In this case, the solution and error bounds returned are for the
original unequilibrated system.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
equed CHARACTER*1. Must be 'N' or 'Y'.
Specifies the form of equilibration that was done to A before calling this
routine.
If equed = 'N', no equilibration was done.
If equed = 'Y', both row and column equilibration was done, that is, A has
been replaced by diag(s)*A*diag(s). The right-hand side B has been
changed accordingly.
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns of the
matrices B and X; nrhs = 0.
a, af, b, work COMPLEX for cherfsx
DOUBLE COMPLEX for zherfsx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the Hermitian matrix A as specified by uplo. If uplo =
'U', the leading n-by-n upper triangular part of a contains the upper
triangular part of the matrix A and the strictly lower triangular part of a is
not referenced. If uplo = 'L', the leading n-by-n lower triangular part of a
contains the lower triangular part of the matrix A and the strictly upper
triangular part of a is not referenced. The second dimension of a must be at
least max(1,n).
The factored form of the matrix A. The array af contains the block diagonal
matrix D and the multipliers used to obtain the factor U or L from the
factorization A = U*D*U**T or A = L*D*L**T as computed by ssytrf for
cherfsx or dsytrf for zherfsx.
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,2*n).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ipiv INTEGER.
LAPACK Routines: Linear Equations 3
497
Array, DIMENSION at least max(1, n). Contains details of the interchanges
and the block structure of D as determined by ssytrf for real flavors or
dsytrf for complex flavors.
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n). The array s contains the scale factors for A.
If equed = 'N', s is not accessed.
If equed = 'Y', each element of s must be positive.
Each element of s should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
x COMPLEX for cherfsx
DOUBLE COMPLEX for zherfsx.
Array, DIMENSION (ldx,*).
The solution matrix X as computed by ?hetrs
ldx INTEGER. The leading dimension of the output array x; ldx = max(1, n).
n_err_bnds INTEGER. Number of error bounds to return for each right hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry will be filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0 (for cherfsx), 1.0D+0 (for zherfsx).
=0.0 No refinement is performed and no error bounds
are computed.
=1.0 Use the double-precision refinement algorithm,
possibly with doubled-single computations if the
compilation environment does not support
DOUBLE PRECISION.
(Other values are reserved for futute use.)
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for refinement.
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
3 Intel® Math Kernel Library Reference Manual
498
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
rwork REAL for cherfsx
DOUBLE PRECISION for zherfsx.
Workspace array, DIMENSION at least max(1, 3*n).
Output Parameters
x COMPLEX for cherfsx
DOUBLE COMPLEX for zherfsx.
The improved solution matrix X.
rcond REAL for cherfsx
DOUBLE PRECISION for zherfsx.
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
berr REAL for cherfsx
DOUBLE PRECISION for zherfsx.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
err_bnds_norm REAL for cherfsx
DOUBLE PRECISION for zherfsx.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for cherfsx and
sqrt(n)*dlamch(e) for zherfsx.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for cherfsx and sqrt(n)*dlamch(e) for
zherfsx. This error bound should only be
trusted if the previous boolean is true.
LAPACK Routines: Linear Equations 3
499
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for cherfsx and
sqrt(n)*dlamch(e) for zherfsx to determine
if the error estimate is "guaranteed". These
reciprocal condition numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for cherfsx
DOUBLE PRECISION for zherfsx.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for cherfsx and
sqrt(n)*dlamch(e) for zherfsx.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for cherfsx and sqrt(n)*dlamch(e) for
zherfsx. This error bound should only be
trusted if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for cherfsx and
sqrt(n)*dlamch(e) for zherfsx to determine
if the error estimate is "guaranteed". These
3 Intel® Math Kernel Library Reference Manual
500
reciprocal condition numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Output parameter only if the input contains erroneous values, namely, in
params(1), params(2), params(3). In such a case, the corresponding
elements of params are filled with default values on output.
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
?sprfs
Refines the solution of a system of linear equations
with a packed symmetric matrix and estimates the
solution error.
Syntax
Fortran 77:
call ssprfs( uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr, berr, work, iwork,
info )
call dsprfs( uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr, berr, work, iwork,
info )
call csprfs( uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
call zsprfs( uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
Fortran 95:
call sprfs( ap, afp, ipiv, b, x [,uplo] [,ferr] [,berr] [,info] )
LAPACK Routines: Linear Equations 3
501
C:
lapack_int LAPACKE_ssprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const float* ap, const float* afp, const lapack_int* ipiv, const float* b, lapack_int
ldb, float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dsprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const double* ap, const double* afp, const lapack_int* ipiv, const double* b,
lapack_int ldb, double* x, lapack_int ldx, double* ferr, double* berr );
lapack_int LAPACKE_csprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_float* ap, const lapack_complex_float* afp, const lapack_int*
ipiv, const lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x,
lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_zsprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_double* ap, const lapack_complex_double* afp, const lapack_int*
ipiv, const lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x,
lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B with a
packed symmetric matrix A, with multiple right-hand sides. For each computed solution vector x, the routine
computes the component-wise backward error ß. This error is the smallest relative perturbation in elements
of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?sptrf
• call the solver routine ?sptrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ap,afp,b,x,work REAL for ssprfs
DOUBLE PRECISION for dsprfs
COMPLEX for csprfs
DOUBLE COMPLEX for zsprfs.
3 Intel® Math Kernel Library Reference Manual
502
Arrays:
ap(*) contains the original packed matrix A, as supplied to ?sptrf.
afp(*) contains the factored packed matrix A, as returned by ?
sptrf.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The dimension of arrays ap and afp must be at least max(1, n(n
+1)/2); the second dimension of b and x must be at least max(1,
nrhs); the dimension of work must be at least max(1, 3*n) for real
flavors and max(1, 2*n) for complex flavors.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?sptrf.
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for csprfs
DOUBLE PRECISION for zsprfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sprfs interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
afp Holds the array AF of size (n*(n+1)/2).
ipiv Holds the vector of length n.
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
LAPACK Routines: Linear Equations 3
503
For each right-hand side, computation of the backward error involves a minimum of 4n2 floating-point
operations (for real flavors) or 16n2 operations (for complex flavors). In addition, each step of iterative
refinement involves 6n2 operations (for real flavors) or 24n2 operations (for complex flavors); the number of
iterations may range from 1 to 5.
Estimating the forward error involves solving a number of systems of linear equations A*x = b; the number
of systems is usually 4 or 5 and never more than 11. Each solution requires approximately 2n2 floating-point
operations for real flavors or 8n2 for complex flavors.
?hprfs
Refines the solution of a system of linear equations
with a packed complex Hermitian matrix and
estimates the solution error.
Syntax
Fortran 77:
call chprfs( uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
call zhprfs( uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
Fortran 95:
call hprfs( ap, afp, ipiv, b, x [,uplo] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_chprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_float* ap, const lapack_complex_float* afp, const lapack_int*
ipiv, const lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x,
lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_zhprfs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
const lapack_complex_double* ap, const lapack_complex_double* afp, const lapack_int*
ipiv, const lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x,
lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations A*X = B with a
packed complex Hermitian matrix A, with multiple right-hand sides. For each computed solution vector x, the
routine computes the component-wise backward error ß. This error is the smallest relative perturbation in
elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
Finally, the routine estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine:
• call the factorization routine ?hptrf
3 Intel® Math Kernel Library Reference Manual
504
• call the solver routine ?hptrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ap,afp,b,x,work COMPLEX for chprfs
DOUBLE COMPLEX for zhprfs.
Arrays:
ap(*) contains the original packed matrix A, as supplied to ?hptrf.
afp(*) contains the factored packed matrix A, as returned by ?
hptrf.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The dimension of arrays ap and afp must be at least max(1,n(n+1)/
2); the second dimension of b and x must be at least max(1,nrhs);
the dimension of work must be at least max(1, 2*n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?hptrf.
rwork REAL for chprfs
DOUBLE PRECISION for zhprfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x The refined solution matrix X.
ferr, berr REAL for chprfs.
DOUBLE PRECISION for zhprfs.
Arrays, DIMENSION at least max(1,nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hprfs interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
LAPACK Routines: Linear Equations 3
505
afp Holds the array AF of size (n*(n+1)/2).
ipiv Holds the vector of length n.
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
For each right-hand side, computation of the backward error involves a minimum of 16n2 operations. In
addition, each step of iterative refinement involves 24n2 operations; the number of iterations may range
from 1 to 5.
Estimating the forward error involves solving a number of systems of linear equations A*x = b; the number
is usually 4 or 5 and never more than 11. Each solution requires approximately 8n2 floating-point operations.
The real counterpart of this routine is ?ssprfs/?dsprfs.
?trrfs
Estimates the error in the solution of a system of
linear equations with a triangular matrix.
Syntax
Fortran 77:
call strrfs( uplo, trans, diag, n, nrhs, a, lda, b, ldb, x, ldx, ferr, berr, work,
iwork, info )
call dtrrfs( uplo, trans, diag, n, nrhs, a, lda, b, ldb, x, ldx, ferr, berr, work,
iwork, info )
call ctrrfs( uplo, trans, diag, n, nrhs, a, lda, b, ldb, x, ldx, ferr, berr, work,
rwork, info )
call ztrrfs( uplo, trans, diag, n, nrhs, a, lda, b, ldb, x, ldx, ferr, berr, work,
rwork, info )
Fortran 95:
call trrfs( a, b, x [,uplo] [,trans] [,diag] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_strrfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const float* a, lapack_int lda, const float* b,
lapack_int ldb, const float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dtrrfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const double* a, lapack_int lda, const double* b,
lapack_int ldb, const double* x, lapack_int ldx, double* ferr, double* berr );
lapack_int LAPACKE_ctrrfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const lapack_complex_float* a, lapack_int lda, const
lapack_complex_float* b, lapack_int ldb, const lapack_complex_float* x, lapack_int ldx,
float* ferr, float* berr );
3 Intel® Math Kernel Library Reference Manual
506
lapack_int LAPACKE_ztrrfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const lapack_complex_double* a, lapack_int lda, const
lapack_complex_double* b, lapack_int ldb, const lapack_complex_double* x, lapack_int
ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the errors in the solution to a system of linear equations A*X = B or AT*X = B or AH*X
= B with a triangular matrix A, with multiple right-hand sides. For each computed solution vector x, the
routine computes the component-wise backward error ß. This error is the smallest relative perturbation in
elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
The routine also estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine, call the solver routine ?trtrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', then A is upper triangular.
If uplo = 'L', then A is lower triangular.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
Indicates the form of the equations:
If trans = 'N', the system has the form A*X = B.
If trans = 'T', the system has the form AT*X = B.
If trans = 'C', the system has the form AH*X = B.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
If diag = 'U', then A is unit triangular: diagonal elements of A are
assumed to be 1 and not referenced in the array a.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
a, b, x, work REAL for strrfs
DOUBLE PRECISION for dtrrfs
COMPLEX for ctrrfs
DOUBLE COMPLEX for ztrrfs.
Arrays:
a(lda,*) contains the upper or lower triangular matrix A, as specified
by uplo.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
LAPACK Routines: Linear Equations 3
507
work(*) is a workspace array.
The second dimension of a must be at least max(1,n); the second
dimension of b and x must be at least max(1,nrhs); the dimension of
work must be at least max(1,3*n) for real flavors and max(1,2*n)
for complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for ctrrfs
DOUBLE PRECISION for ztrrfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
ferr, berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine trrfs interface are as follows:
a Holds the matrix A of size (n,n).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
A call to this routine involves, for each right-hand side, solving a number of systems of linear equations A*x
= b; the number of systems is usually 4 or 5 and never more than 11. Each solution requires approximately
n2 floating-point operations for real flavors or 4n2 for complex flavors.
?tprfs
Estimates the error in the solution of a system of
linear equations with a packed triangular matrix.
3 Intel® Math Kernel Library Reference Manual
508
Syntax
Fortran 77:
call stprfs( uplo, trans, diag, n, nrhs, ap, b, ldb, x, ldx, ferr, berr, work, iwork,
info )
call dtprfs( uplo, trans, diag, n, nrhs, ap, b, ldb, x, ldx, ferr, berr, work, iwork,
info )
call ctprfs( uplo, trans, diag, n, nrhs, ap, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
call ztprfs( uplo, trans, diag, n, nrhs, ap, b, ldb, x, ldx, ferr, berr, work, rwork,
info )
Fortran 95:
call tprfs( ap, b, x [,uplo] [,trans] [,diag] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_stprfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const float* ap, const float* b, lapack_int ldb, const
float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dtprfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const double* ap, const double* b, lapack_int ldb,
const double* x, lapack_int ldx, double* ferr, double* berr );
lapack_int LAPACKE_ctprfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const lapack_complex_float* ap, const
lapack_complex_float* b, lapack_int ldb, const lapack_complex_float* x, lapack_int ldx,
float* ferr, float* berr );
lapack_int LAPACKE_ztprfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const lapack_complex_double* ap, const
lapack_complex_double* b, lapack_int ldb, const lapack_complex_double* x, lapack_int
ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the errors in the solution to a system of linear equations A*X = B or AT*X = B or AH*X
= B with a packed triangular matrix A, with multiple right-hand sides. For each computed solution vector x,
the routine computes the component-wise backward error ß. This error is the smallest relative perturbation
in elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
The routine also estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine, call the solver routine ?tptrs.
LAPACK Routines: Linear Equations 3
509
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', then A is upper triangular.
If uplo = 'L', then A is lower triangular.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
Indicates the form of the equations:
If trans = 'N', the system has the form A*X = B.
If trans = 'T', the system has the form AT*X = B.
If trans = 'C', the system has the form AH*X = B.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', A is not a unit triangular matrix.
If diag = 'U', A is unit triangular: diagonal elements of A are
assumed to be 1 and not referenced in the array ap.
n INTEGER. The order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ap, b, x, work REAL for stprfs
DOUBLE PRECISION for dtprfs
COMPLEX for ctprfs
DOUBLE COMPLEX for ztprfs.
Arrays:
ap(*) contains the upper or lower triangular matrix A, as specified by
uplo.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The dimension of ap must be at least max(1,n(n+1)/2); the second
dimension of b and x must be at least max(1,nrhs); the dimension of
work must be at least max(1,3*n) for real flavors and max(1,2*n)
for complex flavors.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for ctprfs
DOUBLE PRECISION for ztprfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
ferr, berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
3 Intel® Math Kernel Library Reference Manual
510
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tprfs interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
A call to this routine involves, for each right-hand side, solving a number of systems of linear equations A*x
= b; the number of systems is usually 4 or 5 and never more than 11. Each solution requires approximately
n2 floating-point operations for real flavors or 4n2 for complex flavors.
?tbrfs
Estimates the error in the solution of a system of
linear equations with a triangular band matrix.
Syntax
Fortran 77:
call stbrfs( uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, x, ldx, ferr, berr,
work, iwork, info )
call dtbrfs( uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, x, ldx, ferr, berr,
work, iwork, info )
call ctbrfs( uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, x, ldx, ferr, berr,
work, rwork, info )
call ztbrfs( uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, x, ldx, ferr, berr,
work, rwork, info )
Fortran 95:
call tbrfs( ab, b, x [,uplo] [,trans] [,diag] [,ferr] [,berr] [,info] )
C:
lapack_int LAPACKE_stbrfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int kd, lapack_int nrhs, const float* ab, lapack_int ldab, const
float* b, lapack_int ldb, const float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_dtbrfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int kd, lapack_int nrhs, const double* ab, lapack_int ldab, const
double* b, lapack_int ldb, const double* x, lapack_int ldx, double* ferr, double*
berr );
LAPACK Routines: Linear Equations 3
511
lapack_int LAPACKE_ctbrfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int kd, lapack_int nrhs, const lapack_complex_float* ab,
lapack_int ldab, const lapack_complex_float* b, lapack_int ldb, const
lapack_complex_float* x, lapack_int ldx, float* ferr, float* berr );
lapack_int LAPACKE_ztbrfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int kd, lapack_int nrhs, const lapack_complex_double* ab,
lapack_int ldab, const lapack_complex_double* b, lapack_int ldb, const
lapack_complex_double* x, lapack_int ldx, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine estimates the errors in the solution to a system of linear equations A*X = B or AT*X = B or AH*X
= B with a triangular band matrix A, with multiple right-hand sides. For each computed solution vector x, the
routine computes the component-wise backward error ß. This error is the smallest relative perturbation in
elements of A and b such that x is the exact solution of the perturbed system:
|daij| = ß|aij|, |dbi| = ß|bi| such that (A + dA)x = (b + db).
The routine also estimates the component-wise forward error in the computed solution ||x - xe||8/||
x||8 (here xe is the exact solution).
Before calling this routine, call the solver routine ?tbtrs.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', then A is upper triangular.
If uplo = 'L', then A is lower triangular.
trans CHARACTER*1. Must be 'N' or 'T' or 'C'.
Indicates the form of the equations:
If trans = 'N', the system has the form A*X = B.
If trans = 'T', the system has the form AT*X = B.
If trans = 'C', the system has the form AH*X = B.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', A is not a unit triangular matrix.
If diag = 'U', A is unit triangular: diagonal elements of A are
assumed to be 1 and not referenced in the array ab.
n INTEGER. The order of the matrix A; n = 0.
kd INTEGER. The number of super-diagonals or sub-diagonals in the
matrix A; kd = 0.
nrhs INTEGER. The number of right-hand sides; nrhs = 0.
ab, b, x, work REAL for stbrfs
DOUBLE PRECISION for dtbrfs
COMPLEX for ctbrfs
3 Intel® Math Kernel Library Reference Manual
512
DOUBLE COMPLEX for ztbrfs.
Arrays:
ab(ldab,*) contains the upper or lower triangular matrix A, as
specified by uplo, in band storage format.
b(ldb,*) contains the right-hand side matrix B.
x(ldx,*) contains the solution matrix X.
work(*) is a workspace array.
The second dimension of a must be at least max(1,n); the second
dimension of b and x must be at least max(1,nrhs). The dimension
of work must be at least max(1,3*n) for real flavors and max(1,2*n)
for complex flavors.
ldab INTEGER. The leading dimension of the array ab; ldab = kd +1.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n).
rwork REAL for ctbrfs
DOUBLE PRECISION for ztbrfs.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
ferr, berr REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and backward errors, respectively, for each solution
vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tbrfs interface are as follows:
ab Holds the array A of size (kd+1,n).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
The bounds returned in ferr are not rigorous, but in practice they almost always overestimate the actual
error.
LAPACK Routines: Linear Equations 3
513
A call to this routine involves, for each right-hand side, solving a number of systems of linear equations A*x
= b; the number of systems is usually 4 or 5 and never more than 11. Each solution requires approximately
2n*kd floating-point operations for real flavors or 8n*kd operations for complex flavors.
Routines for Matrix Inversion
It is seldom necessary to compute an explicit inverse of a matrix. In particular, do not attempt to solve a
system of equations Ax = b by first computing A-1 and then forming the matrix-vector product x = A-1b.
Call a solver routine instead (see Routines for Solving Systems of Linear Equations); this is more efficient
and more accurate.
However, matrix inversion routines are provided for the rare occasions when an explicit inverse matrix is
needed.
?getri
Computes the inverse of an LU-factored general
matrix.
Syntax
Fortran 77:
call sgetri( n, a, lda, ipiv, work, lwork, info )
call dgetri( n, a, lda, ipiv, work, lwork, info )
call cgetri( n, a, lda, ipiv, work, lwork, info )
call zgetri( n, a, lda, ipiv, work, lwork, info )
Fortran 95:
call getri( a, ipiv [,info] )
C:
lapack_int LAPACKE_getri( int matrix_order, lapack_int n, * a, lapack_int
lda, const lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a general matrix A. Before calling this routine, call ?getrf to
factorize A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The order of the matrix A; n = 0.
a, work REAL for sgetri
DOUBLE PRECISION for dgetri
COMPLEX for cgetri
3 Intel® Math Kernel Library Reference Manual
514
DOUBLE COMPLEX for zgetri.
Arrays: a(lda,*), work(*).
a(lda,*) contains the factorization of the matrix A, as returned by ?
getrf: A = P*L*U.
The second dimension of a must be at least max(1,n).
work(*) is a workspace array of dimension at least max(1,lwork).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n).
The ipiv array, as returned by ?getrf.
lwork INTEGER. The size of the work array; lwork = n.
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the
first entry of the work array, and no error message related to lwork is
issued by xerbla.
See Application Notes below for the suggested value of lwork.
Output Parameters
a Overwritten by the n-by-n matrix inv(A).
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent
runs.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of the factor U is zero, U is
singular, and the inversion could not be completed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine getri interface are as follows:
a Holds the matrix A of size (n,n).
ipiv Holds the vector of length n.
Application Notes
For better performance, try using lwork = n*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
LAPACK Routines: Linear Equations 3
515
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The computed inverse X satisfies the following error bound:
|XA - I| = c(n)e|X|P|L||U|,
where c(n) is a modest linear function of n; e is the machine precision; I denotes the identity matrix; P, L,
and U are the factors of the matrix factorization A = P*L*U.
The total number of floating-point operations is approximately (4/3)n3 for real flavors and (16/3)n3 for
complex flavors.
?potri
Computes the inverse of a symmetric (Hermitian)
positive-definite matrix.
Syntax
Fortran 77:
call spotri( uplo, n, a, lda, info )
call dpotri( uplo, n, a, lda, info )
call cpotri( uplo, n, a, lda, info )
call zpotri( uplo, n, a, lda, info )
Fortran 95:
call potri( a [,uplo] [,info] )
C:
lapack_int LAPACKE_potri( int matrix_order, char uplo, lapack_int n, * a,
lapack_int lda );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a symmetric positive definite or, for complex flavors, Hermitian
positive-definite matrix A. Before calling this routine, call ?potrf to factorize A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', then A is upper triangular.
If uplo = 'L', then A is lower triangular.
n INTEGER. The order of the matrix A; n = 0.
a REAL for spotri
DOUBLE PRECISION for dpotri
3 Intel® Math Kernel Library Reference Manual
516
COMPLEX for cpotri
DOUBLE COMPLEX for zpotri.
Array a(lda,*). Contains the factorization of the matrix A, as
returned by ?potrf.
The second dimension of a must be at least max(1, n).
lda INTEGER. The leading dimension of a; lda = max(1, n).
Output Parameters
a Overwritten by the n-by-n matrix inv(A).
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of the Cholesky factor (and
therefore the factor itself) is zero, and the inversion could not be
completed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine potri interface are as follows:
a Holds the matrix A of size (n,n).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed inverse X satisfies the following error bounds:
||XA - I||2 = c(n)e?2(A), ||AX - I||2 = c(n)e?2(A),
where c(n) is a modest linear function of n, and e is the machine precision; I denotes the identity matrix.
The 2-norm ||A||2 of a matrix A is defined by ||A||2 = maxx·x=1(Ax·Ax)1/2, and the condition number
?2(A) is defined by ?2(A) = ||A||2 ||A-1||2.
The total number of floating-point operations is approximately (2/3)n3 for real flavors and (8/3)n3 for
complex flavors.
?pftri
Computes the inverse of a symmetric (Hermitian)
positive-definite matrix in RFP format using the
Cholesky factorization.
Syntax
Fortran 77:
call spftri( transr, uplo, n, a, info )
call dpftri( transr, uplo, n, a, info )
call cpftri( transr, uplo, n, a, info )
call zpftri( transr, uplo, n, a, info )
LAPACK Routines: Linear Equations 3
517
C:
lapack_int LAPACKE_pftri( int matrix_order, char transr, char uplo, lapack_int n,
* a );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a symmetric positive definite or, for complex data, Hermitian
positive-definite matrix A using the Cholesky factorization:
A = UT*U for real data, A = UH*U for complex data if uplo='U'
A = L*LT for real data, A = L*LH for complex data if uplo='L'
Before calling this routine, call ?pftrf to factorize A.
The matrix A is in the Rectangular Full Packed (RFP) format. For the description of the RFP format, see Matrix
Storage Schemes.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
transr CHARACTER*1. Must be 'N', 'T' (for real data) or 'C' (for complex
data).
If transr = 'N', the Normal transr of RFP A is stored.
If transr = 'T', the Transpose transr of RFP A is stored.
If transr = 'C', the Conjugate-Transpose transr of RFP A is stored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of the RFP matrix
A is stored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A.
n INTEGER. The order of the matrix A; n = 0.
a REAL for spftri
DOUBLE PRECISION for dpftri
COMPLEX for cpftri
DOUBLE COMPLEX for zpftri.
Array, DIMENSION (n*(n+1)/2). The array a contains the matrix A in
the RFP format.
Output Parameters
a The symmetric/Hermitian inverse of the original matrix in the same
storage format.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
3 Intel® Math Kernel Library Reference Manual
518
If info = i, the (i,i) element of the factor U or L is zero, and the
inverse could not be computed.
?pptri
Computes the inverse of a packed symmetric
(Hermitian) positive-definite matrix
Syntax
Fortran 77:
call spptri( uplo, n, ap, info )
call dpptri( uplo, n, ap, info )
call cpptri( uplo, n, ap, info )
call zpptri( uplo, n, ap, info )
Fortran 95:
call pptri( ap [,uplo] [,info] )
C:
lapack_int LAPACKE_pptri( int matrix_order, char uplo, lapack_int n, *
ap );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a symmetric positive definite or, for complex flavors, Hermitian
positive-definite matrix A in packed form. Before calling this routine, call ?pptrf to factorize A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular factor is stored in ap:
If uplo = 'U', then the upper triangular factor is stored.
If uplo = 'L', then the lower triangular factor is stored.
n INTEGER. The order of the matrix A; n = 0.
ap REAL for spptri
DOUBLE PRECISION for dpptri
COMPLEX for cpptri
DOUBLE COMPLEX for zpptri.
Array, DIMENSION at least max(1, n(n+1)/2).
Contains the factorization of the packed matrix A, as returned by ?
pptrf.
The dimension ap must be at least max(1,n(n+1)/2).
LAPACK Routines: Linear Equations 3
519
Output Parameters
ap Overwritten by the packed n-by-n matrix inv(A).
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of the Cholesky factor (and
therefore the factor itself) is zero, and the inversion could not be
completed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pptri interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed inverse X satisfies the following error bounds:
||XA - I||2 = c(n)e?2(A), ||AX - I||2 = c(n)e?2(A),
where c(n) is a modest linear function of n, and e is the machine precision; I denotes the identity matrix.
The 2-norm ||A||2 of a matrix A is defined by ||A||2 =maxx·x=1(Ax·Ax)1/2, and the condition number
?2(A) is defined by ?2(A) = ||A||2 ||A-1||2 .
The total number of floating-point operations is approximately (2/3)n3 for real flavors and (8/3)n3 for
complex flavors.
?sytri
Computes the inverse of a symmetric matrix.
Syntax
Fortran 77:
call ssytri( uplo, n, a, lda, ipiv, work, info )
call dsytri( uplo, n, a, lda, ipiv, work, info )
call csytri( uplo, n, a, lda, ipiv, work, info )
call zsytri( uplo, n, a, lda, ipiv, work, info )
Fortran 95:
call sytri( a, ipiv [,uplo] [,info] )
C:
lapack_int LAPACKE_sytri( int matrix_order, char uplo, lapack_int n, * a,
lapack_int lda, const lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
3 Intel® Math Kernel Library Reference Manual
520
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a symmetric matrix A. Before calling this routine, call ?sytrf to
factorize A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the Bunch-Kaufman factorization A
= P*U*D*UT*PT.
If uplo = 'L', the array a stores the Bunch-Kaufman factorization A
= P*L*D*LT*PT.
n INTEGER. The order of the matrix A; n = 0.
a, work REAL for ssytri
DOUBLE PRECISION for dsytri
COMPLEX for csytri
DOUBLE COMPLEX for zsytri.
Arrays:
a(lda,*) contains the factorization of the matrix A, as returned by ?
sytrf.
The second dimension of a must be at least max(1,n).
work(*) is a workspace array.
The dimension of work must be at least max(1,2*n).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n).
The ipiv array, as returned by ?sytrf.
Output Parameters
a Overwritten by the n-by-n matrix inv(A).
info INTEGER.
If info = 0, the execution is successful.
If info =-i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of D is zero, D is singular, and
the inversion could not be completed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sytri interface are as follows:
a Holds the matrix A of size (n,n).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
LAPACK Routines: Linear Equations 3
521
Application Notes
The computed inverse X satisfies the following error bounds:
|D*UT*PT*X*P*U - I| = c(n)e(|D||UT|PT|X|P|U| + |D||D-1|)
for uplo = 'U', and
|D*LT*PT*X*P*L - I| = c(n)e(|D||LT|PT|X|P|L| + |D||D-1|)
for uplo = 'L'. Here c(n) is a modest linear function of n, and e is the machine precision; I denotes the
identity matrix.
The total number of floating-point operations is approximately (2/3)n3 for real flavors and (8/3)n3 for
complex flavors.
?hetri
Computes the inverse of a complex Hermitian matrix.
Syntax
Fortran 77:
call chetri( uplo, n, a, lda, ipiv, work, info )
call zhetri( uplo, n, a, lda, ipiv, work, info )
Fortran 95:
call hetri( a, ipiv [,uplo] [,info] )
C:
lapack_int LAPACKE_hetri( int matrix_order, char uplo, lapack_int n, * a,
lapack_int lda, const lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a complex Hermitian matrix A. Before calling this routine, call ?
hetrf to factorize A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the Bunch-Kaufman factorization A
= P*U*D*UH*PT.
If uplo = 'L', the array a stores the Bunch-Kaufman factorization A
= P*L*D*LH*PT.
n INTEGER. The order of the matrix A; n = 0.
a, work COMPLEX for chetri
3 Intel® Math Kernel Library Reference Manual
522
DOUBLE COMPLEX for zhetri.
Arrays:
a(lda,*) contains the factorization of the matrix A, as returned by ?
hetrf.
The second dimension of a must be at least max(1,n).
work(*) is a workspace array.
The dimension of work must be at least max(1,n).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?hetrf.
Output Parameters
a Overwritten by the n-by-n matrix inv(A).
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of D is zero, D is singular, and
the inversion could not be completed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hetri interface are as follows:
a Holds the matrix A of size (n,n).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed inverse X satisfies the following error bounds:
|D*UH*PT*X*P*U - I| = c(n)e(|D||UH|PT|X|P|U| + |D||D-1|)
for uplo = 'U', and
|D*LH*PT*X*P*L - I| = c(n)e(|D||LH|PT|X|P|L| + |D||D-1|)
for uplo = 'L'. Here c(n) is a modest linear function of n, and e is the machine precision; I denotes the
identity matrix.
The total number of floating-point operations is approximately (2/3)n3 for real flavors and (8/3)n3 for
complex flavors.
The real counterpart of this routine is ?sytri.
?sytri2
Computes the inverse of a symmetric indefinite matrix
through setting the leading dimension of the
workspace and calling ?sytri2x.
LAPACK Routines: Linear Equations 3
523
Syntax
Fortran 77:
call ssytri2( uplo, n, a, lda, ipiv, work, lwork, info )
call dsytri2( uplo, n, a, lda, ipiv, work, lwork, info )
call csytri2( uplo, n, a, lda, ipiv, work, lwork, info )
call zsytri2( uplo, n, a, lda, ipiv, work, lwork, info )
Fortran 95:
call sytri2( a,ipiv[,uplo][,info] )
C:
lapack_int LAPACKE_sytri2( int matrix_order, char uplo, lapack_int n, * a,
lapack_int lda, const lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a symmetric indefinite matrix A using the factorization A =
U*D*UT or A = L*D*LT computed by ?sytrf.
The ?sytri2 routine sets the leading dimension of the workspace before calling ?sytri2x that actually
computes the inverse.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the factorization A = U*D*UT.
If uplo = 'L', the array a stores the factorization A = L*D*LT.
n INTEGER. The order of the matrix A; n = 0.
a, work REAL for ssytri2
DOUBLE PRECISION for dsytri2
COMPLEX for csytri2
DOUBLE COMPLEX for zsytri2
Arrays:
a(lda,*) contains the block diagonal matrix D and the multipliers used
to obtain the factor U or L as returned by ?sytrf.
The second dimension of a must be at least max(1,n).
work is a workspace array of (n+nb+1)*(nb+3) dimension.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n).
Details of the interchanges and the block structure of D as returned
by ?sytrf.
3 Intel® Math Kernel Library Reference Manual
524
lwork INTEGER. The dimension of the work array.
lwork = (n+nb+1)*(nb+3)
where
nb is the block size parameter as returned by sytrf.
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the
first entry of the work array, and no error message related to lwork
is issued by xerbla.
Output Parameters
a If info = 0, the symmetric inverse of the original matrix.
If info = 'U', the upper triangular part of the inverse is formed and
the part of A below the diagonal is not referenced.
If info = 'L', the lower triangular part of the inverse is formed and
the part of A above the diagonal is not referenced.
info INTEGER.
If info = 0, the execution is successful.
If info =-i, the i-th parameter had an illegal value.
If info = i, D(i,i) = 0; D is singular and its inversion could not be
computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sytri2 interface are as follows:
a Holds the matrix A of size (n,n).
ipiv Holds the vector of length n.
uplo Indicates how the matrix A has been factored. Must be 'U' or 'L'.
See Also
?sytrf
?sytri2x
?hetri2
Computes the inverse of a Hermitian indefinite matrix
through setting the leading dimension of the
workspace and calling ?hetri2x.
Syntax
Fortran 77:
call chetri2( uplo, n, a, lda, ipiv, work, lwork, info )
call zhetri2( uplo, n, a, lda, ipiv, work, lwork, info )
Fortran 95:
call hetri2( a,ipiv[,uplo][,info] )
C:
lapack_int LAPACKE_hetri2( int matrix_order, char uplo, lapack_int n, * a,
lapack_int lda, const lapack_int* ipiv );
LAPACK Routines: Linear Equations 3
525
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a Hermitian indefinite matrix A using the factorization A =
U*D*UH or A = L*D*LH computed by ?hetrf.
The ?hetri2 routine sets the leading dimension of the workspace before calling ?hetri2x that actually
computes the inverse.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the factorization A = U*D*UH.
If uplo = 'L', the array a stores the factorization A = L*D*LH.
n INTEGER. The order of the matrix A; n = 0.
a, work COMPLEX for chetri2
DOUBLE COMPLEX for zhetri2
Arrays:
a(lda,*) contains the block diagonal matrix D and the multipliers used
to obtain the factor U or L as returned by ?sytrf.
The second dimension of a must be at least max(1,n).
work is a workspace array of (n+nb+1)*(nb+3) dimension.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n).
Details of the interchanges and the block structure of D as returned
by ?hetrf.
lwork INTEGER. The dimension of the work array.
lwork = (n+nb+1)*(nb+3)
where
nb is the block size parameter as returned by hetrf.
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the
first entry of the work array, and no error message related to lwork
is issued by xerbla.
Output Parameters
a If info = 0, the inverse of the original matrix.
If info = 'U', the upper triangular part of the inverse is formed and
the part of A below the diagonal is not referenced.
If info = 'L', the lower triangular part of the inverse is formed and
the part of A above the diagonal is not referenced.
info INTEGER.
If info = 0, the execution is successful.
3 Intel® Math Kernel Library Reference Manual
526
If info =-i, the i-th parameter had an illegal value.
If info = i, D(i,i) = 0; D is singular and its inversion could not be
computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hetri2 interface are as follows:
a Holds the matrix A of size (n,n).
ipiv Holds the vector of length n.
uplo Indicates how the input matrix A has been factored. Must be 'U' or
'L'.
See Also
?hetrf
?hetri2x
?sytri2x
Computes the inverse of a symmetric indefinite matrix
after ?sytri2 sets the leading dimension of the
workspace.
Syntax
Fortran 77:
call ssytri2x( uplo, n, a, lda, ipiv, work, nb, info )
call dsytri2x( uplo, n, a, lda, ipiv, work, nb, info )
call csytri2x( uplo, n, a, lda, ipiv, work, nb, info )
call zsytri2x( uplo, n, a, lda, ipiv, work, nb, info )
Fortran 95:
call sytri2x( a,ipiv,nb[,uplo][,info] )
C:
lapack_int LAPACKE_sytri2x( int matrix_order, char uplo, lapack_int n, *
a, lapack_int lda, const lapack_int* ipiv, lapack_int nb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a symmetric indefinite matrix A using the factorization A =
U*D*UT or A = L*D*LT computed by ?sytrf.
The ?sytri2x actually computes the inverse after the ?sytri2 routine sets the leading dimension of the
workspace before calling ?sytri2x.
LAPACK Routines: Linear Equations 3
527
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the factorization A = U*D*UT.
If uplo = 'L', the array a stores the factorization A = L*D*LT.
n INTEGER. The order of the matrix A; n = 0.
a, work REAL for ssytri2x
DOUBLE PRECISION for dsytri2x
COMPLEX for csytri2x
DOUBLE COMPLEX for zsytri2x
Arrays:
a(lda,*) contains the nb (block size) diagonal matrix D and the
multipliers used to obtain the factor U or L as returned by ?sytrf.
The second dimension of a must be at least max(1,n).
work is a workspace array of the dimension (n+nb+1)*(nb+3)
where
nb is the block size as set by ?sytrf.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n).
Details of the interchanges and the nb structure of D as returned by ?
sytrf.
nb INTEGER. Block size.
Output Parameters
a If info = 0, the symmetric inverse of the original matrix.
If info = 'U', the upper triangular part of the inverse is formed and
the part of A below the diagonal is not referenced.
If info = 'L', the lower triangular part of the inverse is formed and
the part of A above the diagonal is not referenced.
info INTEGER.
If info = 0, the execution is successful.
If info =-i, the i-th parameter had an illegal value.
If info = i, Dii= 0; D is singular and its inversion could not be
computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sytri2x interface are as follows:
a Holds the matrix A of size (n,n).
ipiv Holds the vector of length n.
nb Holds the block size.
3 Intel® Math Kernel Library Reference Manual
528
uplo Indicates how the input matrix A has been factored. Must be 'U' or
'L'.
See Also
?sytrf
?sytri2
?hetri2x
Computes the inverse of a Hermitian indefinite matrix
after ?hetri2 sets the leading dimension of the
workspace.
Syntax
Fortran 77:
call chetri2x( uplo, n, a, lda, ipiv, work, nb, info )
call zhetri2x( uplo, n, a, lda, ipiv, work, nb, info )
Fortran 95:
call hetri2x( a,ipiv,nb[,uplo][,info] )
C:
lapack_int LAPACKE_hetri2x( int matrix_order, char uplo, lapack_int n, *
a, lapack_int lda, const lapack_int* ipiv,lapack_int nb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a Hermitian indefinite matrix A using the factorization A =
U*D*UH or A = L*D*LH computed by ?hetrf.
The ?hetri2x actually computes the inverse after the ?hetri2 routine sets the leading dimension of the
workspace before calling ?hetri2x.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array a stores the factorization A = U*D*UH.
If uplo = 'L', the array a stores the factorization A = L*D*LH.
n INTEGER. The order of the matrix A; n = 0.
a, work COMPLEX for chetri2x
DOUBLE COMPLEX for zhetri2x
Arrays:
a(lda,*) contains the nb (block size) diagonal matrix D and the
multipliers used to obtain the factor U or L as returned by ?hetrf.
LAPACK Routines: Linear Equations 3
529
The second dimension of a must be at least max(1,n).
work is a workspace array of the dimension (n+nb+1)*(nb+3)
where
nb is the block size as set by ?hetrf.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n).
Details of the interchanges and the nb structure of D as returned by ?
hetrf.
nb INTEGER. Block size.
Output Parameters
a If info = 0, the symmetric inverse of the original matrix.
If info = 'U', the upper triangular part of the inverse is formed and
the part of A below the diagonal is not referenced.
If info = 'L', the lower triangular part of the inverse is formed and
the part of A above the diagonal is not referenced.
info INTEGER.
If info = 0, the execution is successful.
If info =-i, the i-th parameter had an illegal value.
If info = i, Dii= 0; D is singular and its inversion could not be
computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hetri2x interface are as follows:
a Holds the matrix A of size (n,n).
ipiv Holds the vector of length n.
nb Holds the block size.
uplo Indicates how the input matrix A has been factored. Must be 'U' or
'L'.
See Also
?hetrf
?hetri2
?sptri
Computes the inverse of a symmetric matrix using
packed storage.
Syntax
Fortran 77:
call ssptri( uplo, n, ap, ipiv, work, info )
call dsptri( uplo, n, ap, ipiv, work, info )
call csptri( uplo, n, ap, ipiv, work, info )
call zsptri( uplo, n, ap, ipiv, work, info )
3 Intel® Math Kernel Library Reference Manual
530
Fortran 95:
call sptri( ap, ipiv [,uplo] [,info] )
C:
lapack_int LAPACKE_sptri( int matrix_order, char uplo, lapack_int n, * ap,
const lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a packed symmetric matrix A. Before calling this routine, call ?
sptrf to factorize A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array ap stores the Bunch-Kaufman factorization A
= P*U*D*UT*PT.
If uplo = 'L', the array ap stores the Bunch-Kaufman factorization A
= P*L*D*LT*PT.
n INTEGER. The order of the matrix A; n = 0.
ap, work REAL for ssptri
DOUBLE PRECISION for dsptri
COMPLEX for csptri
DOUBLE COMPLEX for zsptri.
Arrays:
ap(*) contains the factorization of the matrix A, as returned by ?
sptrf.
The dimension of ap must be at least max(1,n(n+1)/2).
work(*) is a workspace array.
The dimension of work must be at least max(1,n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The ipiv array, as returned
by ?sptrf.
Output Parameters
ap Overwritten by the n-by-n matrix inv(A) in packed form.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of D is zero, D is singular, and
the inversion could not be completed.
LAPACK Routines: Linear Equations 3
531
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sptri interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed inverse X satisfies the following error bounds:
|D*UT*PT*X*P*U - I| = c(n)e(|D||UT|PT|X|P|U| + |D||D-1|)
for uplo = 'U', and
|D*LT*PT*X*P*L - I| = c(n)e(|D||LT|PT|X|P|L| + |D||D-1|)
for uplo = 'L'. Here c(n) is a modest linear function of n, and e is the machine precision; I denotes the
identity matrix.
The total number of floating-point operations is approximately (2/3)n3 for real flavors and (8/3)n3 for
complex flavors.
?hptri
Computes the inverse of a complex Hermitian matrix
using packed storage.
Syntax
Fortran 77:
call chptri( uplo, n, ap, ipiv, work, info )
call zhptri( uplo, n, ap, ipiv, work, info )
Fortran 95:
call hptri( ap, ipiv [,uplo] [,info] )
C:
lapack_int LAPACKE_hptri( int matrix_order, char uplo, lapack_int n, * ap,
const lapack_int* ipiv );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a complex Hermitian matrix A using packed storage. Before
calling this routine, call ?hptrf to factorize A.
3 Intel® Math Kernel Library Reference Manual
532
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates how the input matrix A has been factored:
If uplo = 'U', the array ap stores the packed Bunch-Kaufman
factorization A = P*U*D*UH*PT.
If uplo = 'L', the array ap stores the packed Bunch-Kaufman
factorization A = P*L*D*LH*PT.
n INTEGER. The order of the matrix A; n = 0.
ap, work COMPLEX for chptri
DOUBLE COMPLEX for zhptri.
Arrays:
ap(*) contains the factorization of the matrix A, as returned by ?
hptrf.
The dimension of ap must be at least max(1,n(n+1)/2).
work(*) is a workspace array.
The dimension of work must be at least max(1,n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n).
The ipiv array, as returned by ?hptrf.
Output Parameters
ap Overwritten by the n-by-n matrix inv(A).
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of D is zero, D is singular, and
the inversion could not be completed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hptri interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
The computed inverse X satisfies the following error bounds:
|D*UH*PT*X*P*U - I| = c(n)e(|D||UH|PT|X|P|U| + |D||D-1|)
for uplo = 'U', and
|D*LH*PT*X*PL - I| = c(n)e(|D||LH|PT|X|P|L| + |D||D-1|)
for uplo = 'L'. Here c(n) is a modest linear function of n, and e is the machine precision; I denotes the
identity matrix.
LAPACK Routines: Linear Equations 3
533
The total number of floating-point operations is approximately (2/3)n3 for real flavors and (8/3)n3 for
complex flavors.
The real counterpart of this routine is ?sptri.
?trtri
Computes the inverse of a triangular matrix.
Syntax
Fortran 77:
call strtri( uplo, diag, n, a, lda, info )
call dtrtri( uplo, diag, n, a, lda, info )
call ctrtri( uplo, diag, n, a, lda, info )
call ztrtri( uplo, diag, n, a, lda, info )
Fortran 95:
call trtri( a [,uplo] [,diag] [,info] )
C:
lapack_int LAPACKE_trtri( int matrix_order, char uplo, char diag, lapack_int n,
* a, lapack_int lda );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a triangular matrix A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', then A is upper triangular.
If uplo = 'L', then A is lower triangular.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
If diag = 'U', A is unit triangular: diagonal elements of A are
assumed to be 1 and not referenced in the array a.
n INTEGER. The order of the matrix A; n = 0.
a REAL for strtri
DOUBLE PRECISION for dtrtri
COMPLEX for ctrtri
DOUBLE COMPLEX for ztrtri.
Array: DIMENSION (,*).
3 Intel® Math Kernel Library Reference Manual
534
Contains the matrix A.
The second dimension of a must be at least max(1,n).
lda INTEGER. The first dimension of a; lda = max(1, n).
Output Parameters
a Overwritten by the n-by-n matrix inv(A).
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of A is zero, A is singular, and
the inversion could not be completed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine trtri interface are as follows:
a Holds the matrix A of size (n,n).
uplo Must be 'U' or 'L'. The default value is 'U'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
The computed inverse X satisfies the following error bounds:
|XA - I| = c(n)e |X||A|
|XA - I| = c(n)e |A-1||A||X|,
where c(n) is a modest linear function of n; e is the machine precision; I denotes the identity matrix.
The total number of floating-point operations is approximately (1/3)n3 for real flavors and (4/3)n3 for
complex flavors.
?tftri
Computes the inverse of a triangular matrix stored in
the Rectangular Full Packed (RFP) format.
Syntax
Fortran 77:
call stftri( transr, uplo, diag, n, a, info )
call dtftri( transr, uplo, diag, n, a, info )
call ctftri( transr, uplo, diag, n, a, info )
call ztftri( transr, uplo, diag, n, a, info )
C:
lapack_int LAPACKE_tftri( int matrix_order, char transr, char uplo, char diag,
lapack_int n, * a );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
LAPACK Routines: Linear Equations 3
535
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
Computes the inverse of a triangular matrix A stored in the Rectangular Full Packed (RFP) format. For the
description of the RFP format, see Matrix Storage Schemes.
This is the block version of the algorithm, calling Level 3 BLAS.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
transr CHARACTER*1. Must be 'N', 'T' (for real data) or 'C' (for complex
data).
If transr = 'N', the Normal transr of RFP A is stored.
If transr = 'T', the Transpose transr of RFP A is stored.
If transr = 'C', the Conjugate-Transpose transr of RFP A is stored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of RFP A is
stored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
If diag = 'U', A is unit triangular: diagonal elements of A are
assumed to be 1 and not referenced in the array a.
n INTEGER. The order of the matrix A; n = 0.
a REAL for stftri
DOUBLE PRECISION for dtftri
COMPLEX for ctftri
DOUBLE COMPLEX for ztftri.
Array, DIMENSION (n*(n+1)/2). The array a contains the matrix A in
the RFP format.
Output Parameters
a The (triangular) inverse of the original matrix in the same storage
format.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, A(i,i) is exactly zero. The triangular matrix is singular
and its inverse cannot be computed.
?tptri
Computes the inverse of a triangular matrix using
packed storage.
3 Intel® Math Kernel Library Reference Manual
536
Syntax
Fortran 77:
call stptri( uplo, diag, n, ap, info )
call dtptri( uplo, diag, n, ap, info )
call ctptri( uplo, diag, n, ap, info )
call ztptri( uplo, diag, n, ap, info )
Fortran 95:
call tptri( ap [,uplo] [,diag] [,info] )
C:
lapack_int LAPACKE_tptri( int matrix_order, char uplo, char diag, lapack_int n,
* ap );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes the inverse inv(A) of a packed triangular matrix A.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether A is upper or lower triangular:
If uplo = 'U', then A is upper triangular.
If uplo = 'L', then A is lower triangular.
diag CHARACTER*1. Must be 'N' or 'U'.
If diag = 'N', then A is not a unit triangular matrix.
If diag = 'U', A is unit triangular: diagonal elements of A are
assumed to be 1 and not referenced in the array ap.
n INTEGER. The order of the matrix A; n = 0.
ap REAL for stptri
DOUBLE PRECISION for dtptri
COMPLEX for ctptri
DOUBLE COMPLEX for ztptri.
Array, DIMENSION at least max(1,n(n+1)/2).
Contains the packed triangular matrix A.
Output Parameters
ap Overwritten by the packed n-by-n matrix inv(A) .
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
LAPACK Routines: Linear Equations 3
537
If info = i, the i-th diagonal element of A is zero, A is singular, and
the inversion could not be completed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine tptri interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
uplo Must be 'U' or 'L'. The default value is 'U'.
diag Must be 'N' or 'U'. The default value is 'N'.
Application Notes
The computed inverse X satisfies the following error bounds:
|XA - I| = c(n)e |X||A|
|X - A-1| = c(n)e |A-1||A||X|,
where c(n) is a modest linear function of n; e is the machine precision; I denotes the identity matrix.
The total number of floating-point operations is approximately (1/3)n3 for real flavors and (4/3)n3 for
complex flavors.
Routines for Matrix Equilibration
Routines described in this section are used to compute scaling factors needed to equilibrate a matrix. Note
that these routines do not actually scale the matrices.
?geequ
Computes row and column scaling factors intended to
equilibrate a general matrix and reduce its condition
number.
Syntax
Fortran 77:
call sgeequ( m, n, a, lda, r, c, rowcnd, colcnd, amax, info )
call dgeequ( m, n, a, lda, r, c, rowcnd, colcnd, amax, info )
call cgeequ( m, n, a, lda, r, c, rowcnd, colcnd, amax, info )
call zgeequ( m, n, a, lda, r, c, rowcnd, colcnd, amax, info )
Fortran 95:
call geequ( a, r, c [,rowcnd] [,colcnd] [,amax] [,info] )
C:
lapack_int LAPACKE_sgeequ( int matrix_order, lapack_int m, lapack_int n, const float*
a, lapack_int lda, float* r, float* c, float* rowcnd, float* colcnd, float* amax );
lapack_int LAPACKE_dgeequ( int matrix_order, lapack_int m, lapack_int n, const double*
a, lapack_int lda, double* r, double* c, double* rowcnd, double* colcnd, double*
amax );
3 Intel® Math Kernel Library Reference Manual
538
lapack_int LAPACKE_cgeequ( int matrix_order, lapack_int m, lapack_int n, const
lapack_complex_float* a, lapack_int lda, float* r, float* c, float* rowcnd, float*
colcnd, float* amax );
lapack_int LAPACKE_zgeequ( int matrix_order, lapack_int m, lapack_int n, const
lapack_complex_double* a, lapack_int lda, double* r, double* c, double* rowcnd,
double* colcnd, double* amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate an m-by-n matrix A and reduce its
condition number. The output array r returns the row scale factors and the array c the column scale factors.
These factors are chosen to try to make the largest element in each row and column of the matrix B with
elements bij=r(i)*aij*c(j) have absolute value 1.
See ?laqge auxiliary function that uses scaling factors computed by ?geequ.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows of the matrix A; m = 0.
n INTEGER. The number of columns of the matrix A; n = 0.
a REAL for sgeequ
DOUBLE PRECISION for dgeequ
COMPLEX for cgeequ
DOUBLE COMPLEX for zgeequ.
Array: DIMENSION (lda,*).
Contains the m-by-n matrix A whose equilibration factors are to be
computed.
The second dimension of a must be at least max(1,n).
lda INTEGER. The leading dimension of a; lda = max(1, m).
Output Parameters
r, c REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: r(m), c(n).
If info = 0, or info > m, the array r contains the row scale factors
of the matrix A.
If info = 0, the array c contains the column scale factors of the
matrix A.
rowcnd REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0 or info > m, rowcnd contains the ratio of the smallest
r(i) to the largest r(i).
colcnd REAL for single precision flavors
LAPACK Routines: Linear Equations 3
539
DOUBLE PRECISION for double precision flavors.
If info = 0, colcnd contains the ratio of the smallest c(i) to the
largest c(i).
amax REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Absolute value of the largest element of the matrix A.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i and
i = m, the i-th row of A is exactly zero;
i > m, the (i-m)th column of A is exactly zero.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine geequ interface are as follows:
a Holds the matrix A of size (m, n).
r Holds the vector of length (m).
c Holds the vector of length n.
Application Notes
All the components of r and c are restricted to be between SMLNUM = smallest safe number and BIGNUM=
largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number of A but
works well in practice.
SMLNUM and BIGNUM are parameters representing machine precision. You can use the ?lamch routines to
compute them. For example, compute single precision (real and complex) values of SMLNUM and BIGNUM as
follows:
SMLNUM = slamch ('s')
BIGNUM = 1 / SMLNUM
If rowcnd = 0.1 and amax is neither too large nor too small, it is not worth scaling by r.
If colcnd = 0.1, it is not worth scaling by c.
If amax is very close to overflow or very close to underflow, the matrix A should be scaled.
?geequb
Computes row and column scaling factors restricted to
a power of radix to equilibrate a general matrix and
reduce its condition number.
Syntax
Fortran 77:
call sgeequb( m, n, a, lda, r, c, rowcnd, colcnd, amax, info )
call dgeequb( m, n, a, lda, r, c, rowcnd, colcnd, amax, info )
call cgeequb( m, n, a, lda, r, c, rowcnd, colcnd, amax, info )
call zgeequb( m, n, a, lda, r, c, rowcnd, colcnd, amax, info )
3 Intel® Math Kernel Library Reference Manual
540
C:
lapack_int LAPACKE_sgeequb( int matrix_order, lapack_int m, lapack_int n, const float*
a, lapack_int lda, float* r, float* c, float* rowcnd, float* colcnd, float* amax );
lapack_int LAPACKE_dgeequb( int matrix_order, lapack_int m, lapack_int n, const double*
a, lapack_int lda, double* r, double* c, double* rowcnd, double* colcnd, double*
amax );
lapack_int LAPACKE_cgeequb( int matrix_order, lapack_int m, lapack_int n, const
lapack_complex_float* a, lapack_int lda, float* r, float* c, float* rowcnd, float*
colcnd, float* amax );
lapack_int LAPACKE_zgeequb( int matrix_order, lapack_int m, lapack_int n, const
lapack_complex_double* a, lapack_int lda, double* r, double* c, double* rowcnd,
double* colcnd, double* amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate an m-by-n general matrix A and reduce
its condition number. The output array r returns the row scale factors and the array c - the column scale
factors. These factors are chosen to try to make the largest element in each row and column of the matrix B
with elements b(ij)=r(i)*a(ij)*c(j) have an absolute value of at most the radix.
r(i) and c(j) are restricted to be a power of the radix between SMLNUM = smallest safe number and
BIGNUM = largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number
of a but works well in practice.
SMLNUM and BIGNUM are parameters representing machine precision. You can use the ?lamch routines to
compute them. For example, compute single precision (real and complex) values of SMLNUM and BIGNUM as
follows:
SMLNUM = slamch ('s')
BIGNUM = 1 / SMLNUM
This routine differs from ?geequ by restricting the scaling factors to a power of the radix. Except for overand
underflow, scaling by these factors introduces no additional rounding errors. However, the scaled entries'
magnitudes are no longer equal to approximately 1 but lie between sqrt(radix) and 1/sqrt(radix).
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows of the matrix A; m = 0.
n INTEGER. The number of columns of the matrix A; n = 0.
a REAL for sgeequb
DOUBLE PRECISION for dgeequb
COMPLEX for cgeequb
DOUBLE COMPLEX for zgeequb.
Array: DIMENSION (lda,*).
LAPACK Routines: Linear Equations 3
541
Contains the m-by-n matrix A whose equilibration factors are to be
computed.
The second dimension of a must be at least max(1,n).
lda INTEGER. The leading dimension of a; lda = max(1, m).
Output Parameters
r, c REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: r(m), c(n).
If info = 0, or info > m, the array r contains the row scale factors
for the matrix A.
If info = 0, the array c contains the column scale factors for the
matrix A.
rowcnd REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0 or info > m, rowcnd contains the ratio of the smallest
r(i) to the largest r(i). If rowcnd = 0.1, and amax is neither too
large nor too small, it is not worth scaling by r.
colcnd REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0, colcnd contains the ratio of the smallest c(i) to the
largest c(i). If colcnd = 0.1, it is not worth scaling by c.
amax REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Absolute value of the largest element of the matrix A. If amax is very
close to overflow or very close to underflow, the matrix should be
scaled.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i and
i = m, the i-th row of A is exactly zero;
i > m, the (i-m)-th column of A is exactly zero.
?gbequ
Computes row and column scaling factors intended to
equilibrate a banded matrix and reduce its condition
number.
Syntax
Fortran 77:
call sgbequ( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
call dgbequ( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
call cgbequ( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
call zgbequ( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
Fortran 95:
call gbequ( ab, r, c [,kl] [,rowcnd] [,colcnd] [,amax] [,info] )
3 Intel® Math Kernel Library Reference Manual
542
C:
lapack_int LAPACKE_sgbequ( int matrix_order, lapack_int m, lapack_int n, lapack_int kl,
lapack_int ku, const float* ab, lapack_int ldab, float* r, float* c, float* rowcnd,
float* colcnd, float* amax );
lapack_int LAPACKE_dgbequ( int matrix_order, lapack_int m, lapack_int n, lapack_int kl,
lapack_int ku, const double* ab, lapack_int ldab, double* r, double* c, double*
rowcnd, double* colcnd, double* amax );
lapack_int LAPACKE_cgbequ( int matrix_order, lapack_int m, lapack_int n, lapack_int kl,
lapack_int ku, const lapack_complex_float* ab, lapack_int ldab, float* r, float* c,
float* rowcnd, float* colcnd, float* amax );
lapack_int LAPACKE_zgbequ( int matrix_order, lapack_int m, lapack_int n, lapack_int kl,
lapack_int ku, const lapack_complex_double* ab, lapack_int ldab, double* r, double* c,
double* rowcnd, double* colcnd, double* amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate an m-by-n band matrix A and reduce
its condition number. The output array r returns the row scale factors and the array c the column scale
factors. These factors are chosen to try to make the largest element in each row and column of the matrix B
with elements bij=r(i)*aij*c(j) have absolute value 1.
See ?laqgb auxiliary function that uses scaling factors computed by ?gbequ.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows of the matrix A; m = 0.
n INTEGER. The number of columns of the matrix A; n = 0.
kl INTEGER. The number of subdiagonals within the band of A; kl = 0.
ku INTEGER. The number of superdiagonals within the band of A; ku =
0.
ab REAL for sgbequ
DOUBLE PRECISION for dgbequ
COMPLEX for cgbequ
DOUBLE COMPLEX for zgbequ.
Array, DIMENSION (ldab,*).
Contains the original band matrix A stored in rows from 1 to kl + ku
+ 1.
The second dimension of ab must be at least max(1,n).
ldab INTEGER. The leading dimension of ab; ldab = kl+ku+1.
Output Parameters
r, c REAL for single precision flavors
LAPACK Routines: Linear Equations 3
543
DOUBLE PRECISION for double precision flavors.
Arrays: r(m), c(n).
If info = 0, or info > m, the array r contains the row scale factors
of the matrix A.
If info = 0, the array c contains the column scale factors of the
matrix A.
rowcnd REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0 or info > m, rowcnd contains the ratio of the smallest
r(i) to the largest r(i).
colcnd REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0, colcnd contains the ratio of the smallest c(i) to the
largest c(i).
amax REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Absolute value of the largest element of the matrix A.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i and
i = m, the i-th row of A is exactly zero;
i > m, the (i-m)th column of A is exactly zero.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gbequ interface are as follows:
ab Holds the array A of size (kl+ku+1,n).
r Holds the vector of length (m).
c Holds the vector of length n.
kl If omitted, assumed kl = ku.
ku Restored as ku = lda-kl-1.
Application Notes
All the components of r and c are restricted to be between SMLNUM = smallest safe number and BIGNUM=
largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number of A but
works well in practice.
SMLNUM and BIGNUM are parameters representing machine precision. You can use the ?lamch routines to
compute them. For example, compute single precision (real and complex) values of SMLNUM and BIGNUM as
follows:
SMLNUM = slamch ('s')
BIGNUM = 1 / SMLNUM
If rowcnd = 0.1 and amax is neither too large nor too small, it is not worth scaling by r.
If colcnd = 0.1, it is not worth scaling by c.
If amax is very close to overflow or very close to underflow, the matrix A should be scaled.
3 Intel® Math Kernel Library Reference Manual
544
?gbequb
Computes row and column scaling factors restricted to
a power of radix to equilibrate a banded matrix and
reduce its condition number.
Syntax
Fortran 77:
call sgbequb( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
call dgbequb( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
call cgbequb( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
call zgbequb( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
C:
lapack_int LAPACKE_sgbequb( int matrix_order, lapack_int m, lapack_int n, lapack_int
kl, lapack_int ku, const float* ab, lapack_int ldab, float* r, float* c, float*
rowcnd, float* colcnd, float* amax );
lapack_int LAPACKE_dgbequb( int matrix_order, lapack_int m, lapack_int n, lapack_int
kl, lapack_int ku, const double* ab, lapack_int ldab, double* r, double* c, double*
rowcnd, double* colcnd, double* amax );
lapack_int LAPACKE_cgbequb( int matrix_order, lapack_int m, lapack_int n, lapack_int
kl, lapack_int ku, const lapack_complex_float* ab, lapack_int ldab, float* r, float*
c, float* rowcnd, float* colcnd, float* amax );
lapack_int LAPACKE_zgbequb( int matrix_order, lapack_int m, lapack_int n, lapack_int
kl, lapack_int ku, const lapack_complex_double* ab, lapack_int ldab, double* r,
double* c, double* rowcnd, double* colcnd, double* amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate an m-by-n banded matrix A and reduce
its condition number. The output array r returns the row scale factors and the array c - the column scale
factors. These factors are chosen to try to make the largest element in each row and column of the matrix B
with elements b(ij)=r(i)*a(ij)*c(j) have an absolute value of at most the radix.
r(i) and c(j) are restricted to be a power of the radix between SMLNUM = smallest safe number and BIGNUM
= largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number of a
but works well in practice.
SMLNUM and BIGNUM are parameters representing machine precision. You can use the ?lamch routines to
compute them. For example, compute single precision (real and complex) values of SMLNUM and BIGNUM as
follows:
SMLNUM = slamch ('s')
BIGNUM = 1 / SMLNUM
This routine differs from ?gbequ by restricting the scaling factors to a power of the radix. Except for overand
underflow, scaling by these factors introduces no additional rounding errors. However, the scaled entries'
magnitudes are no longer equal to approximately 1 but lie between sqrt(radix) and 1/sqrt(radix).
LAPACK Routines: Linear Equations 3
545
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows of the matrix A; m = 0.
n INTEGER. The number of columns of the matrix A; n = 0.
kl INTEGER. The number of subdiagonals within the band of A; kl = 0.
ku INTEGER. The number of superdiagonals within the band of A; ku =
0.
ab REAL for sgbequb
DOUBLE PRECISION for dgbequb
COMPLEX for cgbequb
DOUBLE COMPLEX for zgbequb.
Array: DIMENSION (ldab,*).
Contains the original banded matrix A stored in rows from 1 to kl +
ku + 1. The j-th column of A is stored in the j-th column of the array
ab as follows:
ab(ku+1+i-j,j) = a(i,j) for max(1,j-ku) = i = min(n,j+kl).
The second dimension of ab must be at least max(1,n).
ldab INTEGER. The leading dimension of a; ldab = max(1, m).
Output Parameters
r, c REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: r(m), c(n).
If info = 0, or info > m, the array r contains the row scale factors
for the matrix A.
If info = 0, the array c contains the column scale factors for the
matrix A.
rowcnd REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0 or info > m, rowcnd contains the ratio of the smallest
r(i) to the largest r(i). If rowcnd = 0.1, and amax is neither too
large nor too small, it is not worth scaling by r.
colcnd REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0, colcnd contains the ratio of the smallest c(i) to the
largest c(i). If colcnd = 0.1, it is not worth scaling by c.
amax REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Absolute value of the largest element of the matrix A. If amax is very
close to overflow or underflow, the matrix should be scaled.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of A is nonpositive.
i = m, the i-th row of A is exactly zero;
i > m, the (i-m)-th column of A is exactly zero.
3 Intel® Math Kernel Library Reference Manual
546
?poequ
Computes row and column scaling factors intended to
equilibrate a symmetric (Hermitian) positive definite
matrix and reduce its condition number.
Syntax
Fortran 77:
call spoequ( n, a, lda, s, scond, amax, info )
call dpoequ( n, a, lda, s, scond, amax, info )
call cpoequ( n, a, lda, s, scond, amax, info )
call zpoequ( n, a, lda, s, scond, amax, info )
Fortran 95:
call poequ( a, s [,scond] [,amax] [,info] )
C:
lapack_int LAPACKE_spoequ( int matrix_order, lapack_int n, const float* a, lapack_int
lda, float* s, float* scond, float* amax );
lapack_int LAPACKE_dpoequ( int matrix_order, lapack_int n, const double* a, lapack_int
lda, double* s, double* scond, double* amax );
lapack_int LAPACKE_cpoequ( int matrix_order, lapack_int n, const lapack_complex_float*
a, lapack_int lda, float* s, float* scond, float* amax );
lapack_int LAPACKE_zpoequ( int matrix_order, lapack_int n, const lapack_complex_double*
a, lapack_int lda, double* s, double* scond, double* amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate a symmetric (Hermitian) positivedefinite
matrix A and reduce its condition number (with respect to the two-norm). The output array s returns
scale factors computed as
These factors are chosen so that the scaled matrix B with elements bij=s(i)*aij*s(j) has diagonal
elements equal to 1.
This choice of s puts the condition number of B within a factor n of the smallest possible condition number
over all possible diagonal scalings.
See ?laqsy auxiliary function that uses scaling factors computed by ?poequ.
LAPACK Routines: Linear Equations 3
547
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The order of the matrix A; n = 0.
a REAL for spoequ
DOUBLE PRECISION for dpoequ
COMPLEX for cpoequ
DOUBLE COMPLEX for zpoequ.
Array: DIMENSION (lda,*).
Contains the n-by-n symmetric or Hermitian positive definite matrix A
whose scaling factors are to be computed. Only the diagonal elements
of A are referenced.
The second dimension of a must be at least max(1,n).
lda INTEGER. The leading dimension of a; lda = max(1,n).
Output Parameters
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n).
If info = 0, the array s contains the scale factors for A.
scond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0, scond contains the ratio of the smallest s(i) to the
largest s(i).
amax REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Absolute value of the largest element of the matrix A.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of A is nonpositive.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine poequ interface are as follows:
a Holds the matrix A of size (n,n).
s Holds the vector of length n.
Application Notes
If scond = 0.1 and amax is neither too large nor too small, it is not worth scaling by s.
If amax is very close to overflow or very close to underflow, the matrix A should be scaled.
3 Intel® Math Kernel Library Reference Manual
548
?poequb
Computes row and column scaling factors intended to
equilibrate a symmetric (Hermitian) positive definite
matrix and reduce its condition number.
Syntax
Fortran 77:
call spoequb( n, a, lda, s, scond, amax, info )
call dpoequb( n, a, lda, s, scond, amax, info )
call cpoequb( n, a, lda, s, scond, amax, info )
call zpoequb( n, a, lda, s, scond, amax, info )
C:
lapack_int LAPACKE_spoequb( int matrix_order, lapack_int n, const float* a, lapack_int
lda, float* s, float* scond, float* amax );
lapack_int LAPACKE_dpoequb( int matrix_order, lapack_int n, const double* a, lapack_int
lda, double* s, double* scond, double* amax );
lapack_int LAPACKE_cpoequb( int matrix_order, lapack_int n, const lapack_complex_float*
a, lapack_int lda, float* s, float* scond, float* amax );
lapack_int LAPACKE_zpoequb( int matrix_order, lapack_int n, const
lapack_complex_double* a, lapack_int lda, double* s, double* scond, double* amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate a symmetric (Hermitian) positivedefinite
matrix A and reduce its condition number (with respect to the two-norm).
These factors are chosen so that the scaled matrix B with elements b(i,j)=s(i)*a(i,j)*s(j) has
diagonal elements equal to 1. s(i) is a power of two nearest to, but not exceeding 1/sqrt(A(i,i)).
This choice of s puts the condition number of B within a factor n of the smallest possible condition number
over all possible diagonal scalings.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The order of the matrix A; n = 0.
a REAL for spoequb
DOUBLE PRECISION for dpoequb
COMPLEX for cpoequb
DOUBLE COMPLEX for zpoequb.
Array: DIMENSION (lda,*).
LAPACK Routines: Linear Equations 3
549
Contains the n-by-n symmetric or Hermitian positive definite matrix A
whose scaling factors are to be computed. Only the diagonal elements
of A are referenced.
The second dimension of a must be at least max(1,n).
lda INTEGER. The leading dimension of a; lda = max(1, m).
Output Parameters
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n).
If info = 0, the array s contains the scale factors for A.
scond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0, scond contains the ratio of the smallest s(i) to the
largest s(i). If scond = 0.1, and amax is neither too large nor too
small, it is not worth scaling by s.
amax REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Absolute value of the largest element of the matrix A. If amax is very
close to overflow or underflow, the matrix should be scaled.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of A is nonpositive.
?ppequ
Computes row and column scaling factors intended to
equilibrate a symmetric (Hermitian) positive definite
matrix in packed storage and reduce its condition
number.
Syntax
Fortran 77:
call sppequ( uplo, n, ap, s, scond, amax, info )
call dppequ( uplo, n, ap, s, scond, amax, info )
call cppequ( uplo, n, ap, s, scond, amax, info )
call zppequ( uplo, n, ap, s, scond, amax, info )
Fortran 95:
call ppequ( ap, s [,scond] [,amax] [,uplo] [,info] )
C:
lapack_int LAPACKE_sppequ( int matrix_order, char uplo, lapack_int n, const float* ap,
float* s, float* scond, float* amax );
lapack_int LAPACKE_dppequ( int matrix_order, char uplo, lapack_int n, const double* ap,
double* s, double* scond, double* amax );
lapack_int LAPACKE_cppequ( int matrix_order, char uplo, lapack_int n, const
lapack_complex_float* ap, float* s, float* scond, float* amax );
3 Intel® Math Kernel Library Reference Manual
550
lapack_int LAPACKE_zppequ( int matrix_order, char uplo, lapack_int n, const
lapack_complex_double* ap, double* s, double* scond, double* amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate a symmetric (Hermitian) positive
definite matrix A in packed storage and reduce its condition number (with respect to the two-norm). The
output array s returns scale factors computed as
These factors are chosen so that the scaled matrix B with elements bij=s(i)*aij*s(j) has diagonal
elements equal to 1.
This choice of s puts the condition number of B within a factor n of the smallest possible condition number
over all possible diagonal scalings.
See ?laqsp auxiliary function that uses scaling factors computed by ?ppequ.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is packed in
the array ap:
If uplo = 'U', the array ap stores the upper triangular part of the
matrix A.
If uplo = 'L', the array ap stores the lower triangular part of the
matrix A.
n INTEGER. The order of matrix A; n = 0.
ap REAL for sppequ
DOUBLE PRECISION for dppequ
COMPLEX for cppequ
DOUBLE COMPLEX for zppequ.
Array, DIMENSION at least max(1,n(n+1)/2). The array ap contains
the upper or the lower triangular part of the matrix A (as specified by
uplo) in packed storage (see Matrix Storage Schemes).
Output Parameters
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n).
If info = 0, the array s contains the scale factors for A.
LAPACK Routines: Linear Equations 3
551
scond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0, scond contains the ratio of the smallest s(i) to the
largest s(i).
amax REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Absolute value of the largest element of the matrix A.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of A is nonpositive.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine ppequ interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
s Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
If scond = 0.1 and amax is neither too large nor too small, it is not worth scaling by s.
If amax is very close to overflow or very close to underflow, the matrix A should be scaled.
?pbequ
Computes row and column scaling factors intended to
equilibrate a symmetric (Hermitian) positive-definite
band matrix and reduce its condition number.
Syntax
Fortran 77:
call spbequ( uplo, n, kd, ab, ldab, s, scond, amax, info )
call dpbequ( uplo, n, kd, ab, ldab, s, scond, amax, info )
call cpbequ( uplo, n, kd, ab, ldab, s, scond, amax, info )
call zpbequ( uplo, n, kd, ab, ldab, s, scond, amax, info )
Fortran 95:
call pbequ( ab, s [,scond] [,amax] [,uplo] [,info] )
C:
lapack_int LAPACKE_spbequ( int matrix_order, char uplo, lapack_int n, lapack_int kd,
const float* ab, lapack_int ldab, float* s, float* scond, float* amax );
lapack_int LAPACKE_dpbequ( int matrix_order, char uplo, lapack_int n, lapack_int kd,
const double* ab, lapack_int ldab, double* s, double* scond, double* amax );
lapack_int LAPACKE_cpbequ( int matrix_order, char uplo, lapack_int n, lapack_int kd,
const lapack_complex_float* ab, lapack_int ldab, float* s, float* scond, float* amax );
3 Intel® Math Kernel Library Reference Manual
552
lapack_int LAPACKE_zpbequ( int matrix_order, char uplo, lapack_int n, lapack_int kd,
const lapack_complex_double* ab, lapack_int ldab, double* s, double* scond, double*
amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate a symmetric (Hermitian) positive
definite matrix A in packed storage and reduce its condition number (with respect to the two-norm). The
output array s returns scale factors computed as
These factors are chosen so that the scaled matrix B with elements bij=s(i)*aij*s(j) has diagonal
elements equal to 1. This choice of s puts the condition number of B within a factor n of the smallest possible
condition number over all possible diagonal scalings.
See ?laqsb auxiliary function that uses scaling factors computed by ?pbequ.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is packed in
the array ab:
If uplo = 'U', the array ab stores the upper triangular part of the
matrix A.
If uplo = 'L', the array ab stores the lower triangular part of the
matrix A.
n INTEGER. The order of matrix A; n = 0.
kd INTEGER. The number of superdiagonals or subdiagonals in the matrix
A; kd = 0.
ab REAL for spbequ
DOUBLE PRECISION for dpbequ
COMPLEX for cpbequ
DOUBLE COMPLEX for zpbequ.
Array, DIMENSION (ldab,*).
The array ap contains either the upper or the lower triangular part of
the matrix A (as specified by uplo) in band storage (see Matrix
Storage Schemes).
The second dimension of ab must be at least max(1, n).
ldab INTEGER. The leading dimension of the array ab; ldab = kd +1.
LAPACK Routines: Linear Equations 3
553
Output Parameters
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n).
If info = 0, the array s contains the scale factors for A.
scond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
If info = 0, scond contains the ratio of the smallest s(i) to the
largest s(i).
amax REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Absolute value of the largest element of the matrix A.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of A is nonpositive.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pbequ interface are as follows:
ab Holds the array A of size (kd+1,n).
s Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
If scond = 0.1 and amax is neither too large nor too small, it is not worth scaling by s.
If amax is very close to overflow or very close to underflow, the matrix A should be scaled.
?syequb
Computes row and column scaling factors intended to
equilibrate a symmetric indefinite matrix and reduce
its condition number.
Syntax
Fortran 77:
call ssyequb( uplo, n, a, lda, s, scond, amax, work, info )
call dsyequb( uplo, n, a, lda, s, scond, amax, work, info )
call csyequb( uplo, n, a, lda, s, scond, amax, work, info )
call zsyequb( uplo, n, a, lda, s, scond, amax, work, info )
C:
lapack_int LAPACKE_ssyequb( int matrix_order, char uplo, lapack_int n, const float* a,
lapack_int lda, float* s, float* scond, float* amax );
lapack_int LAPACKE_dsyequb( int matrix_order, char uplo, lapack_int n, const double* a,
lapack_int lda, double* s, double* scond, double* amax );
3 Intel® Math Kernel Library Reference Manual
554
lapack_int LAPACKE_csyequb( int matrix_order, char uplo, lapack_int n, const
lapack_complex_float* a, lapack_int lda, float* s, float* scond, float* amax );
lapack_int LAPACKE_zsyequb( int matrix_order, char uplo, lapack_int n, const
lapack_complex_double* a, lapack_int lda, double* s, double* scond, double* amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate a symmetric indefinite matrix A and
reduce its condition number (with respect to the two-norm).
The array s contains the scale factors, s(i) = 1/sqrt(A(i,i)). These factors are chosen so that the
scaled matrix B with elements b(i,j)=s(i)*a(i,j)*s(j) has ones on the diagonal.
This choice of s puts the condition number of B within a factor n of the smallest possible condition number
over all possible diagonal scalings.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A.
n INTEGER. The order of the matrix A; n = 0.
a, work REAL for ssyequb
DOUBLE PRECISION for dsyequb
COMPLEX for csyequb
DOUBLE COMPLEX for zsyequb.
Array a: DIMENSION (lda,*).
Contains the n-by-n symmetric indefinite matrix A whose scaling
factors are to be computed. Only the diagonal elements of A are
referenced.
The second dimension of a must be at least max(1,n).
work(*) is a workspace array. The dimension of work is at least
max(1,3*n).
lda INTEGER. The leading dimension of a; lda = max(1, m).
Output Parameters
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n).
If info = 0, the array s contains the scale factors for A.
scond REAL for single precision flavors
LAPACK Routines: Linear Equations 3
555
DOUBLE PRECISION for double precision flavors.
If info = 0, scond contains the ratio of the smallest s(i) to the
largest s(i). If scond = 0.1, and amax is neither too large nor too
small, it is not worth scaling by s.
amax REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Absolute value of the largest element of the matrix A. If amax is very
close to overflow or underflow, the matrix should be scaled.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of A is nonpositive.
?heequb
Computes row and column scaling factors intended to
equilibrate a Hermitian indefinite matrix and reduce its
condition number.
Syntax
Fortran 77:
call cheequb( uplo, n, a, lda, s, scond, amax, work, info )
call zheequb( uplo, n, a, lda, s, scond, amax, work, info )
C:
lapack_int LAPACKE_cheequb( int matrix_order, char uplo, lapack_int n, const
lapack_complex_float* a, lapack_int lda, float* s, float* scond, float* amax );
lapack_int LAPACKE_zheequb( int matrix_order, char uplo, lapack_int n, const
lapack_complex_double* a, lapack_int lda, double* s, double* scond, double* amax );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine computes row and column scalings intended to equilibrate a Hermitian indefinite matrix A and
reduce its condition number (with respect to the two-norm).
The array s contains the scale factors, s(i) = 1/sqrt(A(i,i)). These factors are chosen so that the
scaled matrix B with elements b(i,j)=s(i)*a(i,j)*s(j) has ones on the diagonal.
This choice of s puts the condition number of B within a factor n of the smallest possible condition number
over all possible diagonal scalings.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
3 Intel® Math Kernel Library Reference Manual
556
If uplo = 'U', the array a stores the upper triangular part of the
matrix A.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A.
n INTEGER. The order of the matrix A; n = 0.
a, work COMPLEX for cheequb
DOUBLE COMPLEX for zheequb.
Array a: DIMENSION (lda,*).
Contains the n-by-n symmetric indefinite matrix A whose scaling
factors are to be computed. Only the diagonal elements of A are
referenced.
The second dimension of a must be at least max(1,n).
work(*) is a workspace array. The dimension of work is at least
max(1,3*n).
lda INTEGER. The leading dimension of a; lda = max(1, m).
Output Parameters
s REAL for cheequb
DOUBLE PRECISION for zheequb.
Array, DIMENSION (n).
If info = 0, the array s contains the scale factors for A.
scond REAL for cheequb
DOUBLE PRECISION for zheequb.
If info = 0, scond contains the ratio of the smallest s(i) to the
largest s(i). If scond = 0.1, and amax is neither too large nor too
small, it is not worth scaling by s.
amax REAL for cheequb
DOUBLE PRECISION for zheequb.
Absolute value of the largest element of the matrix A. If amax is very
close to overflow or underflow, the matrix should be scaled.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the i-th diagonal element of A is nonpositive.
Driver Routines
Table "Driver Routines for Solving Systems of Linear Equations" lists the LAPACK driver routines for solving
systems of linear equations with real or complex matrices.
Driver Routines for Solving Systems of Linear Equations
Matrix type, storage
scheme
Simple Driver Expert Driver Expert Driver using
Extra-Precise
Interative Refinement
general ?gesv ?gesvx ?gesvxx
general band ?gbsv ?gbsvx ?gbsvxx
general tridiagonal ?gtsv ?gtsvx
LAPACK Routines: Linear Equations 3
557
Matrix type, storage
scheme
Simple Driver Expert Driver Expert Driver using
Extra-Precise
Interative Refinement
diagonally dominant
tridiagonal
?dtsvb
symmetric/Hermitian
positive-definite
?posv ?posvx ?posvxx
symmetric/Hermitian
positive-definite,
storage
?ppsv ?ppsvx
symmetric/Hermitian
positive-definite, band
?pbsv ?pbsvx
symmetric/Hermitian
positive-definite,
tridiagonal
?ptsv ?ptsvx
symmetric/Hermitian
indefinite
?sysv/?hesv ?sysvx/?hesvx ?sysvxx/?hesvxx
symmetric/Hermitian
indefinite, packed
storage
?spsv/?hpsv ?spsvx/?hpsvx
complex symmetric ?sysv ?sysvx
complex symmetric,
packed storage
?spsv ?spsvx
In this table ? stands for s (single precision real), d (double precision real), c (single precision complex), or z
(double precision complex). In the description of ?gesv and ?posv routines, the ? sign stands for combined
character codes ds and zc for the mixed precision subroutines.
?gesv
Computes the solution to the system of linear
equations with a square matrix A and multiple righthand
sides.
Syntax
Fortran 77:
call sgesv( n, nrhs, a, lda, ipiv, b, ldb, info )
call dgesv( n, nrhs, a, lda, ipiv, b, ldb, info )
call cgesv( n, nrhs, a, lda, ipiv, b, ldb, info )
call zgesv( n, nrhs, a, lda, ipiv, b, ldb, info )
call dsgesv( n, nrhs, a, lda, ipiv, b, ldb, x, ldx, work, swork, iter, info )
call zcgesv( n, nrhs, a, lda, ipiv, b, ldb, x, ldx, work, swork, rwork, iter, info )
Fortran 95:
call gesv( a, b [,ipiv] [,info] )
3 Intel® Math Kernel Library Reference Manual
558
C:
lapack_int LAPACKE_gesv( int matrix_order, lapack_int n, lapack_int nrhs,
* a, lapack_int lda, lapack_int* ipiv, * b, lapack_int ldb );
lapack_int LAPACKE_dsgesv( int matrix_order, lapack_int n, lapack_int nrhs, double* a,
lapack_int lda, lapack_int* ipiv, double* b, lapack_int ldb, double* x, lapack_int
ldx, lapack_int* iter );
lapack_int LAPACKE_zcgesv( int matrix_order, lapack_int n, lapack_int nrhs,
lapack_complex_double* a, lapack_int lda, lapack_int* ipiv, lapack_complex_double* b,
lapack_int ldb, lapack_complex_double* x, lapack_int ldx, lapack_int* iter );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the system of linear equations A*X = B, where A is an n-by-n matrix, the columns of
matrix B are individual right-hand sides, and the columns of X are the corresponding solutions.
The LU decomposition with partial pivoting and row interchanges is used to factor A as A = P*L*U, where P
is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then
used to solve the system of equations A*X = B.
The dsgesv and zcgesv are mixed precision iterative refinement subroutines for exploiting fast single
precision hardware. They first attempt to factorize the matrix in single precision (dsgesv) or single complex
precision (zcgesv) and use this factorization within an iterative refinement procedure to produce a solution
with double precision (dsgesv) / double complex precision (zcgesv) normwise backward error quality (see
below). If the approach fails, the method switches to a double precision or double complex precision
factorization respectively and computes the solution.
The iterative refinement is not going to be a winning strategy if the ratio single precision performance over
double precision performance is too small. A reasonable strategy should take the number of right-hand sides
and the size of the matrix into account. This might be done with a call to ilaenv in the future. At present,
iterative refinement is implemented.
The iterative refinement process is stopped if
iter > itermax
or for all the right-hand sides:
rnmr < sqrt(n)*xnrm*anrm*eps*bwdmax
where
• iter is the number of the current iteration in the iterativerefinement process
• rnmr is the infinity-norm of the residual
• xnrm is the infinity-norm of the solution
• anrm is the infinity-operator-norm of the matrix A
• eps is the machine epsilon returned by dlamch (‘Epsilon’).
The values itermax and bwdmax are fixed to 30 and 1.0d+00 respectively.
LAPACK Routines: Linear Equations 3
559
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The number of linear equations, that is, the order of the
matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, that is, the number of
columns of the matrix B; nrhs = 0.
a, b REAL for sgesv
DOUBLE PRECISION for dgesv and dsgesv
COMPLEX for cgesv
DOUBLE COMPLEX for zgesv and zcgesv.
Arrays: a(lda,*), b(ldb,*).
The array a contains the n-by-n coefficient matrix A.
The array b contains the n-by-nrhs matrix of right hand side matrix B.
The second dimension of a must be at least max(1, n), the second
dimension of b at least max(1,nrhs).
lda INTEGER. The leading dimension of the array a; lda = max(1, n).
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
ldx INTEGER. The leading dimension of the array x; ldx = max(1, n).
work DOUBLE PRECISION for dsgesv
DOUBLE COMPLEX for zcgesv.
Workspace array, DIMENSION at least max(1,n*nrhs). This array is
used to hold the residual vectors.
swork REAL for dsgesv
COMPLEX for zcgesv.
Workspace array, DIMENSION at least max(1,n*(n+nrhs)). This
array is used to use the single precision matrix and the right-hand
sides or solutions in single precision.
rwork DOUBLE PRECISION. Workspace array, DIMENSION at least max(1,n).
Output Parameters
a Overwritten by the factors L and U from the factorization of A =
P*L*U; the unit diagonal elements of L are not stored.
If iterative refinement has been successfully used (info= 0 and
iter= 0), then A is unchanged.
If double precision factorization has been used (info= 0 and iter <
0), then the array A contains the factors L and U from the factorization
A = P*L*U; the unit diagonal elements of L are not stored.
b Overwritten by the solution matrix X for dgesv, sgesv,zgesv,zgesv.
Unchanged for dsgesv and zcgesv.
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The pivot indices that define
the permutation matrix P; row i of the matrix was interchanged with
row ipiv(i). Corresponds to the single precision factorization (if
info= 0 and iter = 0) or the double precision factorization (if info=
0 and iter < 0).
x DOUBLE PRECISION for dsgesv
3 Intel® Math Kernel Library Reference Manual
560
DOUBLE COMPLEX for zcgesv.
Array, DIMENSION (ldx, nrhs). If info = 0, contains the n-by-nrhs
solution matrix X.
iter INTEGER.
If iter < 0: iterative refinement has failed, double precision
factorization has been performed
• If iter = -1: the routine fell back to full precision for
implementation- or machine-specific reason
• If iter = -2: narrowing the precision induced an overflow, the
routine fell back to full precision
• If iter = -3: failure of sgetrf for dsgesv, or cgetrf for zcgesv
• If iter = -31: stop the iterative refinement after the 30th
iteration.
If iter > 0: iterative refinement has been successfully used. Returns
the number of iterations.
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, U(i, i) (computed in double precision for mixed
precision subroutines) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution could
not be computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gesv interface are as follows:
a Holds the matrix A of size (n,n).
b Holds the matrix B of size (n,nrhs).
ipiv Holds the vector of length n.
NOTE Fortran 95 Interface is so far not available for the mixed precision subroutines dsgesv/zcgesv.
See Also
ilaenv
?lamch
?getrf
?gesvx
Computes the solution to the system of linear
equations with a square matrix A and multiple righthand
sides, and provides error bounds on the solution.
Syntax
Fortran 77:
call sgesvx( fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, ferr, berr, work, iwork, info )
LAPACK Routines: Linear Equations 3
561
call dgesvx( fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, ferr, berr, work, iwork, info )
call cgesvx( fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, ferr, berr, work, rwork, info )
call zgesvx( fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, ferr, berr, work, rwork, info )
Fortran 95:
call gesvx( a, b, x [,af] [,ipiv] [,fact] [,trans] [,equed] [,r] [,c] [,ferr] [,berr]
[,rcond] [,rpvgrw] [,info] )
C:
lapack_int LAPACKE_sgesvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, float* a, lapack_int lda, float* af, lapack_int ldaf, lapack_int*
ipiv, char* equed, float* r, float* c, float* b, lapack_int ldb, float* x, lapack_int
ldx, float* rcond, float* ferr, float* berr, float* rpivot );
lapack_int LAPACKE_dgesvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, double* a, lapack_int lda, double* af, lapack_int ldaf, lapack_int*
ipiv, char* equed, double* r, double* c, double* b, lapack_int ldb, double* x,
lapack_int ldx, double* rcond, double* ferr, double* berr, double* rpivot );
lapack_int LAPACKE_cgesvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, lapack_complex_float* a, lapack_int lda, lapack_complex_float* af,
lapack_int ldaf, lapack_int* ipiv, char* equed, float* r, float* c,
lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx,
float* rcond, float* ferr, float* berr, float* rpivot );
lapack_int LAPACKE_zgesvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, lapack_complex_double* a, lapack_int lda, lapack_complex_double* af,
lapack_int ldaf, lapack_int* ipiv, char* equed, double* r, double* c,
lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int ldx,
double* rcond, double* ferr, double* berr, double* rpivot );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the LU factorization to compute the solution to a real or complex system of linear equations
A*X = B, where A is an n-by-n matrix, the columns of matrix B are individual right-hand sides, and the
columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?gesvx performs the following steps:
1. If fact = 'E', real scaling factors r and c are computed to equilibrate the system:
trans = 'N': diag(r)*A*diag(c)*inv(diag(c))*X = diag(r)*B
trans = 'T': (diag(r)*A*diag(c))T*inv(diag(r))*X = diag(c)*B
trans = 'C': (diag(r)*A*diag(c))H*inv(diag(r))*X = diag(c)*B
3 Intel® Math Kernel Library Reference Manual
562
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration
is used, A is overwritten by diag(r)*A*diag(c) and B by diag(r)*B (if trans='N') or diag(c)*B (if
trans = 'T' or 'C').
2. If fact = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact =
'E') as A = P*L*U, where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper
triangular.
3. If some Ui,i= 0, so that U is exactly singular, then the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the
condition number is less than machine precision, info = n + 1 is returned as a warning, but the routine
still goes on to solve for X and compute error bounds as described below.
4. The system of equations is solved for X using the factored form of A.
5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
6. If equilibration was used, the matrix X is premultiplied by diag(c) (if trans = 'N') or diag(r) (if
trans = 'T' or 'C') so that it solves the original system before equilibration.
Input Parameters
The data types are given for the Fortran interface, except for rpivot. A placeholder, if present,
is used for the C interface data types in the C interface section above. See the C Interface Conventions
section for the C interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether or not the factored form of the matrix A is supplied
on entry, and if not, whether the matrix A should be equilibrated
before it is factored.
If fact = 'F': on entry, af and ipiv contain the factored form of A.
If equed is not 'N', the matrix A has been equilibrated with scaling
factors given by r and c.
a, af, and ipiv are not modified.
If fact = 'N', the matrix A will be copied to af and factored.
If fact = 'E', the matrix A will be equilibrated if necessary, then
copied to af and factored.
trans CHARACTER*1. Must be 'N', 'T', or 'C'.
Specifies the form of the system of equations:
If trans = 'N', the system has the form A*X = B (No transpose).
If trans = 'T', the system has the form AT*X = B (Transpose).
If trans = 'C', the system has the form AH*X = B (Transpose for
real flavors, conjugate transpose for complex flavors).
n INTEGER. The number of linear equations; the order of the matrix A; n
= 0.
nrhs INTEGER. The number of right hand sides; the number of columns of
the matrices B and X; nrhs = 0.
a, af, b, work REAL for sgesvx
DOUBLE PRECISION for dgesvx
COMPLEX for cgesvx
DOUBLE COMPLEX for zgesvx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the matrix A. If fact = 'F' and equed is not
'N', then A must have been equilibrated by the scaling factors in r
and/or c. The second dimension of a must be at least max(1,n).
LAPACK Routines: Linear Equations 3
563
The array af is an input argument if fact = 'F'. It contains the
factored form of the matrix A, that is, the factors L and U from the
factorization A = P*L*U as computed by ?getrf. If equed is not 'N',
then af is the factored form of the equilibrated matrix A. The second
dimension of af must be at least max(1,n).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1, nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,4*n) for real flavors, and at least max(1,2*n) for complex
flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The array ipiv is an input
argument if fact = 'F'. It contains the pivot indices from the
factorization A = P*L*U as computed by ?getrf; row i of the matrix
was interchanged with row ipiv(i).
equed CHARACTER*1. Must be 'N', 'R', 'C', or 'B'.
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
If equed = 'N', no equilibration was done (always true if fact =
'N').
If equed = 'R', row equilibration was done, that is, A has been
premultiplied by diag(r).
If equed = 'C', column equilibration was done, that is, A has been
postmultiplied by diag(c).
If equed = 'B', both row and column equilibration was done, that is,
A has been replaced by diag(r)*A*diag(c).
r, c REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: r(n), c(n). The array r contains the row scale factors for A,
and the array c contains the column scale factors for A. These arrays
are input arguments if fact = 'F' only; otherwise they are output
arguments.
If equed = 'R' or 'B', A is multiplied on the left by diag(r); if
equed = 'N' or 'C', r is not accessed.
If fact = 'F' and equed = 'R' or 'B', each element of r must be
positive.
If equed = 'C' or 'B', A is multiplied on the right by diag(c); if
equed = 'N' or 'R', c is not accessed.
If fact = 'F' and equed = 'C' or 'B', each element of c must be
positive.
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,
n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in
real flavors only.
rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
3 Intel® Math Kernel Library Reference Manual
564
Workspace array, DIMENSION at least max(1, 2*n); used in complex
flavors only.
Output Parameters
x REAL for sgesvx
DOUBLE PRECISION for dgesvx
COMPLEX for cgesvx
DOUBLE COMPLEX for zgesvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X to the original system of equations. Note that A and B are modified
on exit if equed ? 'N', and the solution to the equilibrated system
is:
diag(C)-1*X, if trans = 'N' and equed = 'C' or 'B';
diag(R)-1*X, if trans = 'T' or 'C' and equed = 'R' or 'B'. The
second dimension of x must be at least max(1,nrhs).
a Array a is not modified on exit if fact = 'F' or 'N', or if fact =
'E' and equed = 'N'. If equed ? 'N', A is scaled on exit as follows:
equed = 'R': A = diag(R)*A
equed = 'C': A = A*diag(c)
equed = 'B': A = diag(R)*A*diag(c).
af If fact = 'N' or 'E', then af is an output argument and on exit
returns the factors L and U from the factorization A = PLU of the
original matrix A (if fact = 'N') or of the equilibrated matrix A (if
fact = 'E'). See the description of a for the form of the equilibrated
matrix.
b Overwritten by diag(r)*B if trans = 'N' and equed = 'R'or 'B';
overwritten by diag(c)*B if trans = 'T' or 'C' and equed = 'C'
or 'B';
not changed if equed = 'N'.
r, c These arrays are output arguments if fact ? 'F'. See the
description of r, c in Input Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal condition number of the matrix A after
equilibration (if done). If rcond is less than the machine precision, in
particular, if rcond = 0, the matrix is singular to working precision.
This condition is indicated by a return code of info > 0.
ferr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x (j) (the j-th column
of the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
largest element in x(j). The estimate is as reliable as the estimate
for rcond, and is almost always a slight overestimate of the true
error.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
LAPACK Routines: Linear Equations 3
565
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
ipiv If fact = 'N' or 'E', then ipiv is an output argument and on exit
contains the pivot indices from the factorization A = P*L*U of the
original matrix A (if fact = 'N') or of the equilibrated matrix A (if
fact = 'E').
equed If fact ? 'F', then equed is an output argument. It specifies the
form of equilibration that was done (see the description of equed in
Input Arguments section).
work, rwork, rpivot On exit, work(1) for real flavors, or rwork(1) for complex flavors
(the Fortran interface) and rpivot (the C interface), contains the
reciprocal pivot growth factor norm(A)/norm(U). The "max absolute
element" norm is used. If work(1) for real flavors, or rwork(1) for
complex flavors is much less than 1, then the stability of the LU
factorization of the (equilibrated) matrix A could be poor. This also
means that the solution x, condition estimator rcond, and forward
error bound ferr could be unreliable. If factorization fails with 0 <
info = n, then work(1) for real flavors, or rwork(1) for complex
flavors contains the reciprocal pivot growth factor for the leading info
columns of A.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, then U(i, i) is exactly zero. The factorization
has been completed, but the factor U is exactly singular, so the
solution and error bounds could not be computed; rcond = 0 is
returned.
If info = i, and i = n+1, then U is nonsingular, but rcond is less
than machine precision, meaning that the matrix is singular to
working precision. Nevertheless, the solution and error bounds are
computed because there are a number of situations where the
computed solution can be more accurate than the value of rcond
would suggest.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gesvx interface are as follows:
a Holds the matrix A of size (n,n).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
af Holds the matrix AF of size (n,n).
ipiv Holds the vector of length n.
r Holds the vector of length n. Default value for each element is r(i) =
1.0_WP.
c Holds the vector of length n. Default value for each element is c(i) =
1.0_WP.
3 Intel® Math Kernel Library Reference Manual
566
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
fact Must be 'N', 'E', or 'F'. The default value is 'N'. If fact = 'F',
then both arguments af and ipiv must be present; otherwise, an
error is returned.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
equed Must be 'N', 'B', 'C', or 'R'. The default value is 'N'.
rpvgrw Real value that contains the reciprocal pivot growth factor norm(A)/
norm(U).
?gesvxx
Uses extra precise iterative refinement to compute the
solution to the system of linear equations with a
square matrix A and multiple right-hand sides
Syntax
Fortran 77:
call sgesvxx( fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params,
work, iwork, info )
call dgesvxx( fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params,
work, iwork, info )
call cgesvxx( fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params,
work, rwork, info )
call zgesvxx( fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x,
ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params,
work, rwork, info )
C:
lapack_int LAPACKE_sgesvxx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, float* a, lapack_int lda, float* af, lapack_int ldaf, lapack_int*
ipiv, char* equed, float* r, float* c, float* b, lapack_int ldb, float* x, lapack_int
ldx, float* rcond, float* rpvgrw, float* berr, lapack_int n_err_bnds, float*
err_bnds_norm, float* err_bnds_comp, lapack_int nparams, const float* params );
lapack_int LAPACKE_dgesvxx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, double* a, lapack_int lda, double* af, lapack_int ldaf, lapack_int*
ipiv, char* equed, double* r, double* c, double* b, lapack_int ldb, double* x,
lapack_int ldx, double* rcond, double* rpvgrw, double* berr, lapack_int n_err_bnds,
double* err_bnds_norm, double* err_bnds_comp, lapack_int nparams, const double*
params );
lapack_int LAPACKE_cgesvxx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, lapack_complex_float* a, lapack_int lda, lapack_complex_float* af,
lapack_int ldaf, lapack_int* ipiv, char* equed, float* r, float* c,
lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx,
float* rcond, float* rpvgrw, float* berr, lapack_int n_err_bnds, float* err_bnds_norm,
float* err_bnds_comp, lapack_int nparams, const float* params );
LAPACK Routines: Linear Equations 3
567
lapack_int LAPACKE_zgesvxx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, lapack_complex_double* a, lapack_int lda, lapack_complex_double* af,
lapack_int ldaf, lapack_int* ipiv, char* equed, double* r, double* c,
lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int ldx,
double* rcond, double* rpvgrw, double* berr, lapack_int n_err_bnds, double*
err_bnds_norm, double* err_bnds_comp, lapack_int nparams, const double* params );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the LU factorization to compute the solution to a real or complex system of linear equations
A*X = B, where A is an n-by-n matrix, the columns of the matrix B are individual right-hand sides, and the
columns of X are the corresponding solutions.
Both normwise and maximum componentwise error bounds are also provided on request. The routine returns
a solution with a small guaranteed error (O(eps), where eps is the working machine precision) unless the
matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers are also
calculated and returned.
The routine accepts user-provided factorizations and equilibration factors; see definitions of the fact and
equed options. Solving with refinement and using a factorization from a previous call of the routine also
produces a solution with O(eps) errors or warnings but that may not be true for general user-provided
factorizations and equilibration factors if they differ from what the routine would itself produce.
The routine ?gesvxx performs the following steps:
1. If fact = 'E', scaling factors r and c are computed to equilibrate the system:
trans = 'N': diag(r)*A*diag(c)*inv(diag(c))*X = diag(r)*B
trans = 'T': (diag(r)*A*diag(c))T*inv(diag(r))*X = diag(c)*B
trans = 'C': (diag(r)*A*diag(c))H*inv(diag(r))*X = diag(c)*B
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration
is used, A is overwritten by diag(r)*A*diag(c) and B by diag(r)*B (if trans='N') or diag(c)*B (if
trans = 'T' or 'C').
2. If fact = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact =
'E') as A = P*L*U, where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper
triangular.
3. If some Ui,i= 0, so that U is exactly singular, then the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A (see the rcond parameter). If
the reciprocal of the condition number is less than machine precision, the routine still goes on to solve for
X and compute error bounds.
4. The system of equations is solved for X using the factored form of A.
5. By default, unless params(la_linrx_itref_i) is set to zero, the routine applies iterative refinement to
improve the computed solution matrix and calculate error bounds. Refinement calculates the residual to at
least twice the working precision.
6. If equilibration was used, the matrix X is premultiplied by diag(c) (if trans = 'N') or diag(r) (if
trans = 'T' or 'C') so that it solves the original system before equilibration.
3 Intel® Math Kernel Library Reference Manual
568
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether or not the factored form of the matrix A is supplied on
entry, and if not, whether the matrix A should be equilibrated before it is
factored.
If fact = 'F', on entry, af and ipiv contain the factored form of A. If
equed is not 'N', the matrix A has been equilibrated with scaling factors
given by r and c. Parameters a, af, and ipiv are not modified.
If fact = 'N', the matrix A will be copied to af and factored.
If fact = 'E', the matrix A will be equilibrated, if necessary, copied to af
and factored.
trans CHARACTER*1. Must be 'N', 'T', or 'C'.
Specifies the form of the system of equations:
If trans = 'N', the system has the form A*X = B (No transpose).
If trans = 'T', the system has the form A**T*X = B (Transpose).
If trans = 'C', the system has the form A**H*X = B (Conjugate
Transpose = Transpose for real flavors, Conjugate Transpose for complex
flavors).
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
nrhs INTEGER. The number of right hand sides; the number of columns of the
matrices B and X; nrhs = 0.
a, af, b, work REAL for sgesvxx
DOUBLE PRECISION for dgesvxx
COMPLEX for cgesvxx
DOUBLE COMPLEX for zgesvxx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the matrix A. If fact = 'F' and equed is not 'N',
then A must have been equilibrated by the scaling factors in r and/or c. The
second dimension of a must be at least max(1,n).
The array af is an input argument if fact = 'F'. It contains the factored
form of the matrix A, that is, the factors L and U from the factorization A =
P*L*U as computed by ?getrf. If equed is not 'N', then af is the factored
form of the equilibrated matrix A. The second dimension of af must be at
least max(1,n).
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,4*n) for real flavors, and at least max(1,2*n) for complex flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The array ipiv is an input argument
if fact = 'F'. It contains the pivot indices from the factorization A =
P*L*U as computed by ?getrf; row i of the matrix was interchanged with
row ipiv(i).
equed CHARACTER*1. Must be 'N', 'R', 'C', or 'B'.
LAPACK Routines: Linear Equations 3
569
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
If equed = 'N', no equilibration was done (always true if fact = 'N').
If equed = 'R', row equilibration was done, that is, A has been
premultiplied by diag(r).
If equed = 'C', column equilibration was done, that is, A has been
postmultiplied by diag(c).
If equed = 'B', both row and column equilibration was done, that is, A has
been replaced by diag(r)*A*diag(c).
r, c REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: r(n), c(n). The array r contains the row scale factors for A, and
the array c contains the column scale factors for A. These arrays are input
arguments if fact = 'F' only; otherwise they are output arguments.
If equed = 'R' or 'B', A is multiplied on the left by diag(r); if equed =
'N' or 'C', r is not accessed.
If fact = 'F' and equed = 'R' or 'B', each element of r must be
positive.
If equed = 'C' or 'B', A is multiplied on the right by diag(c); if equed =
'N' or 'R', c is not accessed.
If fact = 'F' and equed = 'C' or 'B', each element of c must be
positive.
Each element of r or c should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
ldx INTEGER. The leading dimension of the output array x; ldx = max(1, n).
n_err_bnds INTEGER. Number of error bounds to return for each right hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry is filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0
=0.0 No refinement is performed and no error bounds
are computed.
=1.0 Use the double-precision refinement algorithm,
possibly with doubled-single computations if the
compilation environment does not support
DOUBLE PRECISION.
(Other values are reserved for futute use.)
3 Intel® Math Kernel Library Reference Manual
570
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for refinement.
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in real
flavors only.
rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Workspace array, DIMENSION at least max(1, 3*n); used in complex
flavors only.
Output Parameters
x REAL for sgesvxx
DOUBLE PRECISION for dgesvxx
COMPLEX for cgesvxx
DOUBLE COMPLEX for zgesvxx.
Array, DIMENSION (ldx,*).
If info = 0, the array x contains the solution n-by-nrhs matrix X to the
original system of equations. Note that A and B are modified on exit if
equed ? 'N', and the solution to the equilibrated system is:
inv(diag(c))*X, if trans = 'N' and equed = 'C' or 'B'; or
inv(diag(r))*X, if trans = 'T' or 'C' and equed = 'R' or 'B'. The
second dimension of x must be at least max(1,nrhs).
a Array a is not modified on exit if fact = 'F' or 'N', or if fact = 'E' and
equed = 'N'.
If equed ? 'N', A is scaled on exit as follows:
equed = 'R': A = diag(r)*A
equed = 'C': A = A*diag(c)
equed = 'B': A = diag(r)*A*diag(c).
af If fact = 'N' or 'E', then af is an output argument and on exit returns
the factors L and U from the factorization A = PLU of the original matrix A
(if fact = 'N') or of the equilibrated matrix A (if fact = 'E'). See the
description of a for the form of the equilibrated matrix.
b Overwritten by diag(r)*B if trans = 'N' and equed = 'R' or 'B';
overwritten by trans = 'T' or 'C' and equed = 'C' or 'B';
not changed if equed = 'N'.
r, c These arrays are output arguments if fact ? 'F'. Each element of these
arrays is a power of the radix. See the description of r, c in Input
Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
LAPACK Routines: Linear Equations 3
571
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
rpvgrw REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Contains the reciprocal pivot growth factor norm(A)/norm(U). The max
absolute element norm is used. If this is much less than 1, the stability of
the LU factorization of the (equlibrated) matrix A could be poor. This also
means that the solution X, estimated condition numbers, and error bounds
could be unreliable. If factorization fails with 0 < info = n, this parameter
contains the reciprocal pivot growth factor for the leading info columns of
A. In ?gesvx, this quantity is returned in work(1).
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
err_bnds_norm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
3 Intel® Math Kernel Library Reference Manual
572
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
LAPACK Routines: Linear Equations 3
573
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
ipiv If fact = 'N' or 'E', then ipiv is an output argument and on exit
contains the pivot indices from the factorization A = P*L*U of the original
matrix A (if fact = 'N') or of the equilibrated matrix A (if fact = 'E').
equed If fact ? 'F', then equed is an output argument. It specifies the form of
equilibration that was done (see the description of equed in Input
Arguments section).
params If an entry is less than 0.0, that entry is filled with the default value used
for that parameter, otherwise the entry is not modified
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
?gbsv
Computes the solution to the system of linear
equations with a band matrix A and multiple righthand
sides.
Syntax
Fortran 77:
call sgbsv( n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info )
call dgbsv( n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info )
call cgbsv( n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info )
call zgbsv( n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info )
Fortran 95:
call gbsv( ab, b [,kl] [,ipiv] [,info] )
C:
lapack_int LAPACKE_gbsv( int matrix_order, lapack_int n, lapack_int kl, lapack_int
ku, lapack_int nrhs, * ab, lapack_int ldab, lapack_int* ipiv, * b,
lapack_int ldb );
3 Intel® Math Kernel Library Reference Manual
574
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the real or complex system of linear equations A*X = B, where A is an n-by-n band
matrix with kl subdiagonals and ku superdiagonals, the columns of matrix B are individual right-hand sides,
and the columns of X are the corresponding solutions.
The LU decomposition with partial pivoting and row interchanges is used to factor A as A = L*U, where L is a
product of permutation and unit lower triangular matrices with kl subdiagonals, and U is upper triangular
with kl+ku superdiagonals. The factored form of A is then used to solve the system of equations A*X = B.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The order of A. The number of rows in B; n = 0.
kl INTEGER. The number of subdiagonals within the band of A; kl = 0.
ku INTEGER. The number of superdiagonals within the band of A; ku = 0.
nrhs INTEGER. The number of right-hand sides. The number of columns in
B; nrhs = 0.
ab, b REAL for sgbsv
DOUBLE PRECISION for dgbsv
COMPLEX for cgbsv
DOUBLE COMPLEX for zgbsv.
Arrays: ab(ldab,*), b(ldb,*).
The array ab contains the matrix A in band storage (see Matrix
Storage Schemes). The second dimension of ab must be at least
max(1, n).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
ldab INTEGER. The leading dimension of the array ab. (ldab = 2kl + ku
+1)
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
ab Overwritten by L and U. The diagonal and kl + ku superdiagonals of U
are stored in the first 1 + kl + ku rows of ab. The multipliers used to
form L are stored in the next kl rows.
b Overwritten by the solution matrix X.
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The pivot indices: row i was
interchanged with row ipiv(i).
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
LAPACK Routines: Linear Equations 3
575
If info = i, U(i, i) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution could
not be computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gbsv interface are as follows:
ab Holds the array A of size (2*kl+ku+1,n).
b Holds the matrix B of size (n,nrhs).
ipiv Holds the vector of length n.
kl If omitted, assumed kl = ku.
ku Restored as ku = lda-2*kl-1.
?gbsvx
Computes the solution to the real or complex system
of linear equations with a band matrix A and multiple
right-hand sides, and provides error bounds on the
solution.
Syntax
Fortran 77:
call sgbsvx( fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c, b,
ldb, x, ldx, rcond, ferr, berr, work, iwork, info )
call dgbsvx( fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c, b,
ldb, x, ldx, rcond, ferr, berr, work, iwork, info )
call cgbsvx( fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c, b,
ldb, x, ldx, rcond, ferr, berr, work, rwork, info )
call zgbsvx( fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c, b,
ldb, x, ldx, rcond, ferr, berr, work, rwork, info )
Fortran 95:
call gbsvx( ab, b, x [,kl] [,afb] [,ipiv] [,fact] [,trans] [,equed] [,r] [,c] [,ferr]
[,berr] [,rcond] [,rpvgrw] [,info] )
C:
lapack_int LAPACKE_sgbsvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, float* ab, lapack_int ldab, float* afb,
lapack_int ldafb, lapack_int* ipiv, char* equed, float* r, float* c, float* b,
lapack_int ldb, float* x, lapack_int ldx, float* rcond, float* ferr, float* berr,
float* rpivot );
lapack_int LAPACKE_dgbsvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, double* ab, lapack_int ldab, double*
afb, lapack_int ldafb, lapack_int* ipiv, char* equed, double* r, double* c, double* b,
lapack_int ldb, double* x, lapack_int ldx, double* rcond, double* ferr, double* berr,
double* rpivot );
3 Intel® Math Kernel Library Reference Manual
576
lapack_int LAPACKE_cgbsvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, lapack_complex_float* ab, lapack_int
ldab, lapack_complex_float* afb, lapack_int ldafb, lapack_int* ipiv, char* equed,
float* r, float* c, lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x,
lapack_int ldx, float* rcond, float* ferr, float* berr, float* rpivot );
lapack_int LAPACKE_zgbsvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, lapack_complex_double* ab, lapack_int
ldab, lapack_complex_double* afb, lapack_int ldafb, lapack_int* ipiv, char* equed,
double* r, double* c, lapack_complex_double* b, lapack_int ldb, lapack_complex_double*
x, lapack_int ldx, double* rcond, double* ferr, double* berr, double* rpivot );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the LU factorization to compute the solution to a real or complex system of linear equations
A*X = B, AT*X = B, or AH*X = B, where A is a band matrix of order n with kl subdiagonals and ku
superdiagonals, the columns of matrix B are individual right-hand sides, and the columns of X are the
corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?gbsvx performs the following steps:
1. If fact = 'E', real scaling factors r and c are computed to equilibrate the system:
trans = 'N': diag(r)*A*diag(c) *inv(diag(c))*X = diag(r)*B
trans = 'T': (diag(r)*A*diag(c))T *inv(diag(r))*X = diag(c)*B
trans = 'C': (diag(r)*A*diag(c))H *inv(diag(r))*X = diag(c)*B
Whether the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is
used, A is overwritten by diag(r)*A*diag(c) and B by diag(r)*B (if trans='N') or diag(c)*B (if
trans = 'T' or 'C').
2. If fact = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact =
'E') as A = L*U, where L is a product of permutation and unit lower triangular matrices with kl
subdiagonals, and U is upper triangular with kl+ku superdiagonals.
3. If some Ui,i = 0, so that U is exactly singular, then the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the
condition number is less than machine precision, info = n + 1 is returned as a warning, but the routine
still goes on to solve for X and compute error bounds as described below.
4. The system of equations is solved for X using the factored form of A.
5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
6. If equilibration was used, the matrix X is premultiplied by diag(c) (if trans = 'N') or diag(r) (if
trans = 'T' or 'C') so that it solves the original system before equilibration.
Input Parameters
The data types are given for the Fortran interface, except for rpivot. A placeholder, if present,
is used for the C interface data types in the C interface section above. See the C Interface Conventions
section for the C interface principal conventions and type definitions.
LAPACK Routines: Linear Equations 3
577
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether the factored form of the matrix A is supplied on
entry, and if not, whether the matrix A should be equilibrated before it
is factored.
If fact = 'F': on entry, afb and ipiv contain the factored form of
A. If equed is not 'N', the matrix A is equilibrated with scaling factors
given by r and c.
ab, afb, and ipiv are not modified.
If fact = 'N', the matrix A will be copied to afb and factored.
If fact = 'E', the matrix A will be equilibrated if necessary, then
copied to afb and factored.
trans CHARACTER*1. Must be 'N', 'T', or 'C'.
Specifies the form of the system of equations:
If trans = 'N', the system has the form A*X = B (No transpose).
If trans = 'T', the system has the form AT*X = B (Transpose).
If trans = 'C', the system has the form AH*X = B (Transpose for
real flavors, conjugate transpose for complex flavors).
n INTEGER. The number of linear equations, the order of the matrix A; n
= 0.
kl INTEGER. The number of subdiagonals within the band of A; kl = 0.
ku INTEGER. The number of superdiagonals within the band of A; ku = 0.
nrhs INTEGER. The number of right hand sides, the number of columns of
the matrices B and X; nrhs = 0.
ab, afb, b, work REAL for sgesvx
DOUBLE PRECISION for dgesvx
COMPLEX for cgesvx
DOUBLE COMPLEX for zgesvx.
Arrays: ab(ldab,*), afb(ldafb,*), b(ldb,*), work(*).
The array ab contains the matrix A in band storage (see Matrix
Storage Schemes). The second dimension of ab must be at least
max(1, n). If fact = 'F' and equed is not 'N', then A must have
been equilibrated by the scaling factors in r and/or c.
The array afb is an input argument if fact = 'F'. The second
dimension of afb must be at least max(1,n). It contains the factored
form of the matrix A, that is, the factors L and U from the factorization
A = L*U as computed by ?gbtrf. U is stored as an upper triangular
band matrix with kl + ku superdiagonals in the first 1 + kl + ku rows
of afb. The multipliers used during the factorization are stored in the
next kl rows. If equed is not 'N', then afb is the factored form of the
equilibrated matrix A.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1, nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,3*n) for real flavors, and at least max(1,2*n) for complex
flavors.
ldab INTEGER. The leading dimension of ab; ldab = kl+ku+1.
ldafb INTEGER. The leading dimension of afb; ldafb = 2*kl+ku+1.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER.
3 Intel® Math Kernel Library Reference Manual
578
Array, DIMENSION at least max(1, n). The array ipiv is an input
argument if fact = 'F'. It contains the pivot indices from the
factorization A = L*U as computed by ?gbtrf; row i of the matrix
was interchanged with row ipiv(i).
equed CHARACTER*1. Must be 'N', 'R', 'C', or 'B'.
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
If equed = 'N', no equilibration was done (always true if fact =
'N').
If equed = 'R', row equilibration was done, that is, A has been
premultiplied by diag(r).
If equed = 'C', column equilibration was done, that is, A has been
postmultiplied by diag(c).
if equed = 'B', both row and column equilibration was done, that is,
A has been replaced by diag(r)*A*diag(c).
r, c REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: r(n), c(n).
The array r contains the row scale factors for A, and the array c
contains the column scale factors for A. These arrays are input
arguments if fact = 'F' only; otherwise they are output arguments.
If equed = 'R' or 'B', A is multiplied on the left by diag(r); if
equed = 'N' or 'C', r is not accessed.
If fact = 'F' and equed = 'R' or 'B', each element of r must be
positive.
If equed = 'C' or 'B', A is multiplied on the right by diag(c); if
equed = 'N' or 'R', c is not accessed.
If fact = 'F' and equed = 'C' or 'B', each element of c must be
positive.
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,
n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in
real flavors only.
rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Workspace array, DIMENSION at least max(1, n); used in complex
flavors only.
Output Parameters
x REAL for sgbsvx
DOUBLE PRECISION for dgbsvx
COMPLEX for cgbsvx
DOUBLE COMPLEX for zgbsvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X to the original system of equations. Note that A and B are modified
on exit if equed ? 'N', and the solution to the equilibrated system
is: inv(diag(c))*X, if trans = 'N' and equed = 'C' or 'B';
inv(diag(r))*X, if trans = 'T' or 'C' and equed = 'R' or 'B'.
The second dimension of x must be at least max(1,nrhs).
LAPACK Routines: Linear Equations 3
579
ab Array ab is not modified on exit if fact = 'F' or 'N', or if fact =
'E' and equed = 'N'.
If equed ? 'N', A is scaled on exit as follows:
equed = 'R': A = diag(r)*A
equed = 'C': A = A*diag(c)
equed = 'B': A = diag(r)*A*diag(c).
afb If fact = 'N' or 'E', then afb is an output argument and on exit
returns details of the LU factorization of the original matrix A (if fact
= 'N') or of the equilibrated matrix A (if fact = 'E'). See the
description of ab for the form of the equilibrated matrix.
b Overwritten by diag(r)*b if trans = 'N' and equed = 'R' or 'B';
overwritten by diag(c)*b if trans = 'T' or 'C' and equed = 'C'
or 'B';
not changed if equed = 'N'.
r, c These arrays are output arguments if fact ? 'F'. See the
description of r, c in Input Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal condition number of the matrix A after
equilibration (if done).
If rcond is less than the machine precision (in particular, if rcond =0),
the matrix is singular to working precision. This condition is indicated
by a return code of info>0.
ferr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x(j) (the j-th column of
the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
largest element in x(j). The estimate is as reliable as the estimate
for rcond, and is almost always a slight overestimate of the true
error.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
ipiv If fact = 'N' or 'E', then ipiv is an output argument and on exit
contains the pivot indices from the factorization A = L*U of the original
matrix A (if fact = 'N') or of the equilibrated matrix A (if fact =
'E').
equed If fact ? 'F', then equed is an output argument. It specifies the
form of equilibration that was done (see the description of equed in
Input Arguments section).
work, rwork, rpivot On exit, work(1) for real flavors, or rwork(1) for complex flavors
(the Fortran interface) and rpivot (the C interface), contains the
reciprocal pivot growth factor norm(A)/norm(U). The "max absolute
element" norm is used. If work(1) for real flavors, or rwork(1) for
3 Intel® Math Kernel Library Reference Manual
580
complex flavors is much less than 1, then the stability of the LU
factorization of the (equilibrated) matrix A could be poor. This also
means that the solution x, condition estimator rcond, and forward
error bound ferr could be unreliable. If factorization fails with 0 <
info = n, then work(1) for real flavors, or rwork(1) for complex
flavors contains the reciprocal pivot growth factor for the leading info
columns of A.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, then U(i, i) is exactly zero. The factorization
has been completed, but the factor U is exactly singular, so the
solution and error bounds could not be computed; rcond = 0 is
returned. If info = i, and i = n+1, then U is nonsingular, but rcond
is less than machine precision, meaning that the matrix is singular to
working precision. Nevertheless, the solution and error bounds are
computed because there are a number of situations where the
computed solution can be more accurate than the value of rcond
would suggest.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gbsvx interface are as follows:
ab Holds the array A of size (kl+ku+1,n).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
afb Holds the array AF of size (2*kl+ku+1,n).
ipiv Holds the vector of length n.
r Holds the vector of length n. Default value for each element is r(i) =
1.0_WP.
c Holds the vector of length n. Default value for each element is c(i) =
1.0_WP.
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
equed Must be 'N', 'B', 'C', or 'R'. The default value is 'N'.
fact Must be 'N', 'E', or 'F'. The default value is 'N'. If fact = 'F',
then both arguments af and ipiv must be present; otherwise, an
error is returned.
rpvgrw Real value that contains the reciprocal pivot growth factor norm(A)/
norm(U).
kl If omitted, assumed kl = ku.
ku Restored as ku = lda-kl-1.
LAPACK Routines: Linear Equations 3
581
?gbsvxx
Uses extra precise iterative refinement to compute the
solution to the system of linear equations with a
banded matrix A and multiple right-hand sides
Syntax
Fortran 77:
call sgbsvxx( fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c,
b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp,
nparams, params, work, iwork, info )
call dgbsvxx( fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c,
b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp,
nparams, params, work, iwork, info )
call cgbsvxx( fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c,
b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp,
nparams, params, work, rwork, info )
call zgbsvxx( fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c,
b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp,
nparams, params, work, rwork, info )
C:
lapack_int LAPACKE_sgbsvxx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, float* ab, lapack_int ldab, float* afb,
lapack_int ldafb, lapack_int* ipiv, char* equed, float* r, float* c, float* b,
lapack_int ldb, float* x, lapack_int ldx, float* rcond, float* rpvgrw, float* berr,
lapack_int n_err_bnds, float* err_bnds_norm, float* err_bnds_comp, lapack_int nparams,
const float* params );
lapack_int LAPACKE_dgbsvxx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, double* ab, lapack_int ldab, double*
afb, lapack_int ldafb, lapack_int* ipiv, char* equed, double* r, double* c, double* b,
lapack_int ldb, double* x, lapack_int ldx, double* rcond, double* rpvgrw, double*
berr, lapack_int n_err_bnds, double* err_bnds_norm, double* err_bnds_comp, lapack_int
nparams, const double* params );
lapack_int LAPACKE_cgbsvxx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, lapack_complex_float* ab, lapack_int
ldab, lapack_complex_float* afb, lapack_int ldafb, lapack_int* ipiv, char* equed,
float* r, float* c, lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x,
lapack_int ldx, float* rcond, float* rpvgrw, float* berr, lapack_int n_err_bnds,
float* err_bnds_norm, float* err_bnds_comp, lapack_int nparams, const float* params );
lapack_int LAPACKE_zgbsvxx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs, lapack_complex_double* ab, lapack_int
ldab, lapack_complex_double* afb, lapack_int ldafb, lapack_int* ipiv, char* equed,
double* r, double* c, lapack_complex_double* b, lapack_int ldb, lapack_complex_double*
x, lapack_int ldx, double* rcond, double* rpvgrw, double* berr, lapack_int n_err_bnds,
double* err_bnds_norm, double* err_bnds_comp, lapack_int nparams, const double*
params );
3 Intel® Math Kernel Library Reference Manual
582
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the LU factorization to compute the solution to a real or complex system of linear equations
A*X = B, where A is an n-by-n banded matrix, the columns of the matrix B are individual right-hand sides,
and the columns of X are the corresponding solutions.
Both normwise and maximum componentwise error bounds are also provided on request. The routine returns
a solution with a small guaranteed error (O(eps), where eps is the working machine precision) unless the
matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers are also
calculated and returned.
The routine accepts user-provided factorizations and equilibration factors; see definitions of the fact and
equed options. Solving with refinement and using a factorization from a previous call of the routine also
produces a solution with O(eps) errors or warnings but that may not be true for general user-provided
factorizations and equilibration factors if they differ from what the routine would itself produce.
The routine ?gbsvxx performs the following steps:
1. If fact = 'E', scaling factors r and c are computed to equilibrate the system:
trans = 'N': diag(r)*A*diag(c)*inv(diag(c))*X = diag(r)*B
trans = 'T': (diag(r)*A*diag(c))T*inv(diag(r))*X = diag(c)*B
trans = 'C': (diag(r)*A*diag(c))H*inv(diag(r))*X = diag(c)*B
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration
is used, A is overwritten by diag(r)*A*diag(c) and B by diag(r)*B (if trans='N') or diag(c)*B (if
trans = 'T' or 'C').
2. If fact = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact =
'E') as A = P*L*U, where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper
triangular.
3. If some Ui,i= 0, so that U is exactly singular, then the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A (see the rcond parameter). If
the reciprocal of the condition number is less than machine precision, the routine still goes on to solve for
X and compute error bounds.
4. The system of equations is solved for X using the factored form of A.
5. By default, unless params(la_linrx_itref_i) is set to zero, the routine applies iterative refinement to
improve the computed solution matrix and calculate error bounds. Refinement calculates the residual to at
least twice the working precision.
6. If equilibration was used, the matrix X is premultiplied by diag(c) (if trans = 'N') or diag(r) (if
trans = 'T' or 'C') so that it solves the original system before equilibration.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether or not the factored form of the matrix A is supplied on
entry, and if not, whether the matrix A should be equilibrated before it is
factored.
LAPACK Routines: Linear Equations 3
583
If fact = 'F', on entry, afb and ipiv contain the factored form of A. If
equed is not 'N', the matrix A has been equilibrated with scaling factors
given by r and c. Parameters ab, afb, and ipiv are not modified.
If fact = 'N', the matrix A will be copied to afb and factored.
If fact = 'E', the matrix A will be equilibrated, if necessary, copied to afb
and factored.
trans CHARACTER*1. Must be 'N', 'T', or 'C'.
Specifies the form of the system of equations:
If trans = 'N', the system has the form A*X = B (No transpose).
If trans = 'T', the system has the form A**T*X = B (Transpose).
If trans = 'C', the system has the form A**H*X = B (Conjugate
Transpose = Transpose for real flavors, Conjugate Transpose for complex
flavors).
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
kl INTEGER. The number of subdiagonals within the band of A; kl = 0.
ku INTEGER. The number of superdiagonals within the band of A; ku = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns of the
matrices B and X; nrhs = 0.
ab, afb, b, work REAL for sgbsvxx
DOUBLE PRECISION for dgbsvxx
COMPLEX for cgbsvxx
DOUBLE COMPLEX for zgbsvxx.
Arrays: ab(ldab,*), afb(ldafb,*), b(ldb,*), work(*).
The array ab contains the matrix A in band storage, in rows 1 to kl+ku+1.
The j-th column of A is stored in the j-th column of the array ab as follows:
ab(ku+1+i-j,j) = A(i,j) for max(1,j-ku) = i = min(n,j+kl).
If fact = 'F' and equed is not 'N', then AB must have been equilibrated
by the scaling factors in r and/or c. The second dimension of a must be at
least max(1,n).
The array afb is an input argument if fact = 'F'. It contains the factored
form of the banded matrix A, that is, the factors L and U from the
factorization A = P*L*U as computed by ?gbtrf. U is stored as an upper
triangular banded matrix with kl + ku superdiagonals in rows 1 to kl + ku
+ 1. The multipliers used during the factorization are stored in rows kl + ku
+ 2 to 2*kl + ku + 1. If equed is not 'N', then afb is the factored form of
the equilibrated matrix A.
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,4*n) for real flavors, and at least max(1,2*n) for complex flavors.
ldab INTEGER. The leading dimension of the array ab; ldab = kl+ku+1..
ldafb INTEGER. The leading dimension of the array afb; ldafb = 2*kl+ku+1..
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The array ipiv is an input argument
if fact = 'F'. It contains the pivot indices from the factorization A =
P*L*U as computed by ?gbtrf; row i of the matrix was interchanged with
row ipiv(i).
equed CHARACTER*1. Must be 'N', 'R', 'C', or 'B'.
3 Intel® Math Kernel Library Reference Manual
584
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
If equed = 'N', no equilibration was done (always true if fact = 'N').
If equed = 'R', row equilibration was done, that is, A has been
premultiplied by diag(r).
If equed = 'C', column equilibration was done, that is, A has been
postmultiplied by diag(c).
If equed = 'B', both row and column equilibration was done, that is, A has
been replaced by diag(r)*A*diag(c).
r, c REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: r(n), c(n). The array r contains the row scale factors for A, and
the array c contains the column scale factors for A. These arrays are input
arguments if fact = 'F' only; otherwise they are output arguments.
If equed = 'R' or 'B', A is multiplied on the left by diag(r); if equed =
'N' or 'C', r is not accessed.
If fact = 'F' and equed = 'R' or 'B', each element of r must be
positive.
If equed = 'C' or 'B', A is multiplied on the right by diag(c); if equed =
'N' or 'R', c is not accessed.
If fact = 'F' and equed = 'C' or 'B', each element of c must be
positive.
Each element of r or c should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1,n).
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,n).
n_err_bnds INTEGER. Number of error bounds to return for each right hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry is filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0 (for single precision flavors), 1.0D+0 (for
double precision flavors).
=0.0 No refinement is performed and no error bounds
are computed.
=1.0 Use the extra-precise refinement algorithm.
(Other values are reserved for futute use.)
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for fefinement.
LAPACK Routines: Linear Equations 3
585
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in real
flavors only.
rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Workspace array, DIMENSION at least max(1, 3*n); used in complex
flavors only.
Output Parameters
x REAL for sgbsvxx
DOUBLE PRECISION for dgbsvxx
COMPLEX for cgbsvxx
DOUBLE COMPLEX for zgbsvxx.
Array, DIMENSION (ldx,*).
If info = 0, the array x contains the solution n-by-nrhs matrix X to the
original system of equations. Note that A and B are modified on exit if
equed ? 'N', and the solution to the equilibrated system is:
inv(diag(c))*X, if trans = 'N' and equed = 'C' or 'B'; or
inv(diag(r))*X, if trans = 'T' or 'C' and equed = 'R' or 'B'. The
second dimension of x must be at least max(1,nrhs).
ab Array ab is not modified on exit if fact = 'F' or 'N', or if fact = 'E'
and equed = 'N'.
If equed ? 'N', A is scaled on exit as follows:
equed = 'R': A = diag(r)*A
equed = 'C': A = A*diag(c)
equed = 'B': A = diag(r)*A*diag(c).
afb If fact = 'N' or 'E', then afb is an output argument and on exit returns
the factors L and U from the factorization A = PLU of the original matrix A
(if fact = 'N') or of the equilibrated matrix A (if fact = 'E').
b Overwritten by diag(r)*B if trans = 'N' and equed = 'R' or 'B';
overwritten by trans = 'T' or 'C' and equed = 'C' or 'B';
not changed if equed = 'N'.
r, c These arrays are output arguments if fact ? 'F'. Each element of these
arrays is a power of the radix. See the description of r, c in Input
Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
3 Intel® Math Kernel Library Reference Manual
586
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
rpvgrw REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Contains the reciprocal pivot growth factor norm(A)/norm(U). The max
absolute element norm is used. If this is much less than 1, the stability of
the LU factorization of the (equlibrated) matrix A could be poor. This also
means that the solution X, estimated condition numbers, and error bounds
could be unreliable. If factorization fails with 0 < info = n, this parameter
contains the reciprocal pivot growth factor for the leading info columns of
A. In ?gbsvx, this quantity is returned in work(1).
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
err_bnds_norm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
LAPACK Routines: Linear Equations 3
587
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
3 Intel® Math Kernel Library Reference Manual
588
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
ipiv If fact = 'N' or 'E', then ipiv is an output argument and on exit
contains the pivot indices from the factorization A = P*L*U of the original
matrix A (if fact = 'N') or of the equilibrated matrix A (if fact = 'E').
equed If fact ? 'F', then equed is an output argument. It specifies the form of
equilibration that was done (see the description of equed in Input
Arguments section).
params If an entry is less than 0.0, that entry is filled with the default value used
for that parameter, otherwise the entry is not modified.
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
?gtsv
Computes the solution to the system of linear
equations with a tridiagonal matrix A and multiple
right-hand sides.
Syntax
Fortran 77:
call sgtsv( n, nrhs, dl, d, du, b, ldb, info )
call dgtsv( n, nrhs, dl, d, du, b, ldb, info )
call cgtsv( n, nrhs, dl, d, du, b, ldb, info )
call zgtsv( n, nrhs, dl, d, du, b, ldb, info )
Fortran 95:
call gtsv( dl, d, du, b [,info] )
C:
lapack_int LAPACKE_gtsv( int matrix_order, lapack_int n, lapack_int nrhs,
* dl, * d, * du, * b, lapack_int ldb );
LAPACK Routines: Linear Equations 3
589
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the system of linear equations A*X = B, where A is an n-by-n tridiagonal matrix, the
columns of matrix B are individual right-hand sides, and the columns of X are the corresponding solutions.
The routine uses Gaussian elimination with partial pivoting.
Note that the equation AT*X = B may be solved by interchanging the order of the arguments du and dl.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The order of A, the number of rows in B; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
dl, d, du, b REAL for sgtsv
DOUBLE PRECISION for dgtsv
COMPLEX for cgtsv
DOUBLE COMPLEX for zgtsv.
Arrays: dl(n - 1), d(n), du(n - 1), b(ldb,*).
The array dl contains the (n - 1) subdiagonal elements of A.
The array d contains the diagonal elements of A.
The array du contains the (n - 1) superdiagonal elements of A.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
dl Overwritten by the (n-2) elements of the second superdiagonal of
the upper triangular matrix U from the LU factorization of A. These
elements are stored in dl(1), ..., dl(n-2).
d Overwritten by the n diagonal elements of U.
du Overwritten by the (n-1) elements of the first superdiagonal of U.
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, U(i, i) is exactly zero, and the solution has not been
computed. The factorization has not been completed unless i = n.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gtsv interface are as follows:
3 Intel® Math Kernel Library Reference Manual
590
dl Holds the vector of length (n-1).
d Holds the vector of length n.
dl Holds the vector of length (n-1).
b Holds the matrix B of size (n,nrhs).
?gtsvx
Computes the solution to the real or complex system
of linear equations with a tridiagonal matrix A and
multiple right-hand sides, and provides error bounds
on the solution.
Syntax
Fortran 77:
call sgtsvx( fact, trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x,
ldx, rcond, ferr, berr, work, iwork, info )
call dgtsvx( fact, trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x,
ldx, rcond, ferr, berr, work, iwork, info )
call cgtsvx( fact, trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x,
ldx, rcond, ferr, berr, work, rwork, info )
call zgtsvx( fact, trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x,
ldx, rcond, ferr, berr, work, rwork, info )
Fortran 95:
call gtsvx( dl, d, du, b, x [,dlf] [,df] [,duf] [,du2] [,ipiv] [,fact] [,trans] [,ferr]
[,berr] [,rcond] [,info] )
C:
lapack_int LAPACKE_sgtsvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, const float* dl, const float* d, const float* du, float* dlf, float*
df, float* duf, float* du2, lapack_int* ipiv, const float* b, lapack_int ldb, float*
x, lapack_int ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_dgtsvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, const double* dl, const double* d, const double* du, double* dlf,
double* df, double* duf, double* du2, lapack_int* ipiv, const double* b, lapack_int
ldb, double* x, lapack_int ldx, double* rcond, double* ferr, double* berr );
lapack_int LAPACKE_cgtsvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, const lapack_complex_float* dl, const lapack_complex_float* d, const
lapack_complex_float* du, lapack_complex_float* dlf, lapack_complex_float* df,
lapack_complex_float* duf, lapack_complex_float* du2, lapack_int* ipiv, const
lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx,
float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_zgtsvx( int matrix_order, char fact, char trans, lapack_int n,
lapack_int nrhs, const lapack_complex_double* dl, const lapack_complex_double* d, const
lapack_complex_double* du, lapack_complex_double* dlf, lapack_complex_double* df,
lapack_complex_double* duf, lapack_complex_double* du2, lapack_int* ipiv, const
lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int ldx,
double* rcond, double* ferr, double* berr );
LAPACK Routines: Linear Equations 3
591
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the LU factorization to compute the solution to a real or complex system of linear equations
A*X = B, AT*X = B, or AH*X = B, where A is a tridiagonal matrix of order n, the columns of matrix B are
individual right-hand sides, and the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?gtsvx performs the following steps:
1. If fact = 'N', the LU decomposition is used to factor the matrix A as A = L*U, where L is a product of
permutation and unit lower bidiagonal matrices and U is an upper triangular matrix with nonzeroes in only
the main diagonal and first two superdiagonals.
2. If some Ui,i = 0, so that U is exactly singular, then the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the
condition number is less than machine precision, info = n + 1 is returned as a warning, but the routine
still goes on to solve for X and compute error bounds as described below.
3. The system of equations is solved for X using the factored form of A.
4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F' or 'N'.
Specifies whether or not the factored form of the matrix A has been
supplied on entry.
If fact = 'F': on entry, dlf, df, duf, du2, and ipiv contain the
factored form of A; arrays dl, d, du, dlf, df, duf, du2, and ipiv will
not be modified.
If fact = 'N', the matrix A will be copied to dlf, df, and duf and
factored.
trans CHARACTER*1. Must be 'N', 'T', or 'C'.
Specifies the form of the system of equations:
If trans = 'N', the system has the form A*X = B (No transpose).
If trans = 'T', the system has the form AT*X = B (Transpose).
If trans = 'C', the system has the form AH*X = B (Conjugate
transpose).
n INTEGER. The number of linear equations, the order of the matrix A; n
= 0.
nrhs INTEGER. The number of right hand sides, the number of columns of
the matrices B and X; nrhs = 0.
dl,d,du,dlf,df, duf,du2,b,
x,work
REAL for sgtsvx
DOUBLE PRECISION for dgtsvx
COMPLEX for cgtsvx
DOUBLE COMPLEX for zgtsvx.
3 Intel® Math Kernel Library Reference Manual
592
Arrays:
dl, DIMENSION (n -1), contains the subdiagonal elements of A.
d, DIMENSION (n), contains the diagonal elements of A.
du, DIMENSION (n -1), contains the superdiagonal elements of A.
dlf, DIMENSION (n -1). If fact = 'F', then dlf is an input
argument and on entry contains the (n -1) multipliers that define the
matrix L from the LU factorization of A as computed by ?gttrf.
df, DIMENSION (n). If fact = 'F', then df is an input argument and
on entry contains the n diagonal elements of the upper triangular
matrix U from the LU factorization of A.
duf, DIMENSION (n -1). If fact = 'F', then duf is an input
argument and on entry contains the (n -1) elements of the first
superdiagonal of U.
du2, DIMENSION (n -2). If fact = 'F', then du2 is an input
argument and on entry contains the (n-2) elements of the second
superdiagonal of U.
b(ldb*) contains the right-hand side matrix B. The second dimension
of b must be at least max(1, nrhs).
x(ldx*) contains the solution matrix X. The second dimension of x
must be at least max(1, nrhs).
work(*) is a workspace array.
DIMENSION of work must be at least max(1, 3*n) for real flavors and
max(1, 2*n) for complex flavors.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). If fact = 'F', then ipiv is
an input argument and on entry contains the pivot indices, as
returned by ?gttrf.
iwork INTEGER. Workspace array, DIMENSION (n). Used for real flavors only.
rwork REAL for cgtsvx
DOUBLE PRECISION for zgtsvx.
Workspace array, DIMENSION (n). Used for complex flavors only.
Output Parameters
x REAL for sgtsvx
DOUBLE PRECISION for dgtsvx
COMPLEX for cgtsvx
DOUBLE COMPLEX for zgtsvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X. The second dimension of x must be at least max(1, nrhs).
dlf If fact = 'N', then dlf is an output argument and on exit contains
the (n-1) multipliers that define the matrix L from the LU
factorization of A.
df If fact = 'N', then df is an output argument and on exit contains
the n diagonal elements of the upper triangular matrix U from the LU
factorization of A.
duf If fact = 'N', then duf is an output argument and on exit contains
the (n-1) elements of the first superdiagonal of U.
LAPACK Routines: Linear Equations 3
593
du2 If fact = 'N', then du2 is an output argument and on exit contains
the (n-2) elements of the second superdiagonal of U.
ipiv The array ipiv is an output argument if fact = 'N' and, on exit,
contains the pivot indices from the factorization A = L*U ; row i of
the matrix was interchanged with row ipiv(i). The value of ipiv(i)
will always be i or i+1; ipiv(i)=i indicates a row interchange was
not required.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal condition number of the matrix A. If
rcond is less than the machine precision (in particular, if rcond =0),
the matrix is singular to working precision. This condition is indicated
by a return code of info>0.
ferr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x(j) (the j-th column of
the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
largest element in x(j). The estimate is as reliable as the estimate
for rcond, and is almost always a slight overestimate of the true
error.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, then U(i, i) is exactly zero. The factorization
has not been completed unless i = n, but the factor U is exactly
singular, so the solution and error bounds could not be computed;
rcond = 0 is returned. If info = i, and i = n + 1, then U is
nonsingular, but rcond is less than machine precision, meaning that
the matrix is singular to working precision. Nevertheless, the solution
and error bounds are computed because there are a number of
situations where the computed solution can be more accurate than the
value of rcond would suggest.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gtsvx interface are as follows:
dl Holds the vector of length (n-1).
d Holds the vector of length n.
du Holds the vector of length (n-1).
b Holds the matrix B of size (n,nrhs).
3 Intel® Math Kernel Library Reference Manual
594
x Holds the matrix X of size (n,nrhs).
dlf Holds the vector of length (n-1).
df Holds the vector of length n.
duf Holds the vector of length (n-1).
du2 Holds the vector of length (n-2).
ipiv Holds the vector of length n.
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
fact Must be 'N' or 'F'. The default value is 'N'. If fact = 'F', then
the arguments dlf, df, duf, du2, and ipiv must be present;
otherwise, an error is returned.
trans Must be 'N', 'C', or 'T'. The default value is 'N'.
?dtsvb
Computes the solution to the system of linear
equations with a diagonally dominant tridiagonal
matrix A and multiple right-hand sides.
Syntax
Fortran 77:
call sdtsvb( n, nrhs, dl, d, du, b, ldb, info )
call ddtsvb( n, nrhs, dl, d, du, b, ldb, info )
call cdtsvb( n, nrhs, dl, d, du, b, ldb, info )
call zdtsvb( n, nrhs, dl, d, du, b, ldb, info )
Include Files
• FORTRAN 77: mkl_lapack.fi and mkl_lapack.h
Description
The ?dtsvb routine solves a system of linear equations A*X = B for X, where A is an n-by-n diagonally
dominant tridiagonal matrix, the columns of matrix B are individual right-hand sides, and the columns of X
are the corresponding solutions. The routine uses the BABE (Burning At Both Ends) algorithm.
Note that the equation AT*X = B may be solved by interchanging the order of the arguments du and dl.
Input Parameters
n INTEGER. The order of A, the number of rows in B; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
dl, d, du, b REAL for sdtsvb
DOUBLE PRECISION for ddtsvb
COMPLEX for cdtsvb
DOUBLE COMPLEX for zdtsvb.
Arrays: dl(n - 1), d(n), du(n - 1), b(ldb,*).
The array dl contains the (n - 1) subdiagonal elements of A.
The array d contains the diagonal elements of A.
LAPACK Routines: Linear Equations 3
595
The array du contains the (n - 1) superdiagonal elements of A.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
dl Overwritten by the (n-1) elements of the subdiagonal of the lower
triangular matrices L1, L2 from the factorization of A.
d Overwritten by the n diagonal element reciprocals of U.
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, uii is exactly zero, and the solution has not been
computed. The factorization has not been completed unless i = n.
Application Notes
A diagonally dominant tridiagonal system is defined such that |di| > |dli-1| + |dui| for any i:
1 < i < n, and |d1| > |du1|, |dn| > |dln-1|
The underlying BABE algorithm is designed for diagonally dominant systems. Such systems have no
numerical stability issue unlike the canonical systems that use elimination with partial pivoting (see ?gtsv).
The diagonally dominant systems are much faster than the canonical systems.
NOTE
• The current implementation of BABE has a potential accuracy issue on very small or large data
close to the underflow or overflow threshold respectively. Scale the matrix before applying the
solver in the case of such input data.
• Applying the ?dtsvb factorization to non-diagonally dominant systems may lead to an accuracy
loss, or false singularity detected due to no pivoting.
?posv
Computes the solution to the system of linear
equations with a symmetric or Hermitian positivedefinite
matrix A and multiple right-hand sides.
Syntax
Fortran 77:
call sposv( uplo, n, nrhs, a, lda, b, ldb, info )
call dposv( uplo, n, nrhs, a, lda, b, ldb, info )
call cposv( uplo, n, nrhs, a, lda, b, ldb, info )
call zposv( uplo, n, nrhs, a, lda, b, ldb, info )
call dsposv( uplo, n, nrhs, a, lda, b, ldb, x, ldx, work, swork, iter, info )
call zcposv( uplo, n, nrhs, a, lda, b, ldb, x, ldx, work, swork, rwork, iter, info )
3 Intel® Math Kernel Library Reference Manual
596
Fortran 95:
call posv( a, b [,uplo] [,info] )
C:
lapack_int LAPACKE_posv( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
* a, lapack_int lda, * b, lapack_int ldb );
lapack_int LAPACKE_dsposv( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
double* a, lapack_int lda, double* b, lapack_int ldb, double* x, lapack_int ldx,
lapack_int* iter );
lapack_int LAPACKE_zcposv( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
lapack_complex_double* a, lapack_int lda, lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* x, lapack_int ldx, lapack_int* iter );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the real or complex system of linear equations A*X = B, where A is an n-by-n
symmetric/Hermitian positive-definite matrix, the columns of matrix B are individual right-hand sides, and
the columns of X are the corresponding solutions.
The Cholesky decomposition is used to factor A as
A = UT*U (real flavors) and A = UH*U (complex flavors), if uplo = 'U'
or A = L*LT (real flavors) and A = L*LH (complex flavors), if uplo = 'L',
where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used
to solve the system of equations A*X = B.
The dsposv and zcposv are mixed precision iterative refinement subroutines for exploiting fast single
precision hardware. They first attempt to factorize the matrix in single precision (dsposv) or single complex
precision (zcposv) and use this factorization within an iterative refinement procedure to produce a solution
with double precision (dsposv) / double complex precision (zcposv) normwise backward error quality (see
below). If the approach fails, the method switches to a double precision or double complex precision
factorization respectively and computes the solution.
The iterative refinement is not going to be a winning strategy if the ratio single precision/COMPLEX
performance over double precision/DOUBLE COMPLEX performance is too small. A reasonable strategy
should take the number of right-hand sides and the size of the matrix into account. This might be done with
a call to ilaenv in the future. At present, iterative refinement is implemented.
The iterative refinement process is stopped if
iter > itermax
or for all the right-hand sides:
rnmr < sqrt(n)*xnrm*anrm*eps*bwdmax,
where
• iter is the number of the current iteration in the iterative refinement process
• rnmr is the infinity-norm of the residual
• xnrm is the infinity-norm of the solution
• anrm is the infinity-operator-norm of the matrix A
• eps is the machine epsilon returned by dlamch (‘Epsilon’).
LAPACK Routines: Linear Equations 3
597
The values itermax and bwdmax are fixed to 30 and 1.0d+00 respectively.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
a, b REAL for sposv
DOUBLE PRECISION for dposv and dsposv.
COMPLEX for cposv
DOUBLE COMPLEX for zposv and zcposv.
Arrays: a(lda,*), b(ldb,*). The array a contains the upper or the
lower triangular part of the matrix A (see uplo). The second
dimension of a must be at least max(1, n).
Note that in the case of zcposv the imaginary parts of the diagonal
elements need not be set and are assumed to be zero.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of the array x; ldx = max(1, n).
work DOUBLE PRECISION for dsposv
DOUBLE COMPLEX for zcposv.
Workspace array, DIMENSION (n*nrhs). This array is used to hold
the residual vectors.
swork REAL for dsgesv
COMPLEX for zcgesv.
Workspace array, DIMENSION (n*(n+nrhs)). This array is used to
use the single precision matrix and the right-hand sides or solutions in
single precision.
rwork DOUBLE PRECISION. Workspace array, DIMENSION (n).
Output Parameters
a If info = 0, the upper or lower triangular part of a is overwritten by
the Cholesky factor U or L, as specified by uplo.
If iterative refinement has been successfully used (info= 0 and
iter= 0), then A is unchanged.
If double precision factorization has been used (info= 0 and iter <
0), then the array A contains the factors L and U from the Cholesky
factorization; the unit diagonal elements of L are not stored.
b Overwritten by the solution matrix X.
ipiv INTEGER.
3 Intel® Math Kernel Library Reference Manual
598
Array, DIMENSION at least max(1, n). The pivot indices that define
the permutation matrix P; row i of the matrix was interchanged with
row ipiv(i). Corresponds to the single precision factorization (if
info= 0 and iter = 0) or the double precision factorization (if info=
0 and iter < 0).
x DOUBLE PRECISION for dsposv
DOUBLE COMPLEX for zcposv.
Array, DIMENSION (ldx, nrhs). If info = 0, contains the n-by-nrhs
solution matrix X.
iter INTEGER.
If iter < 0: iterative refinement has failed, double precision
factorization has been performed
• If iter = -1: the routine fell back to full precision for
implementation- or machine-specific reason
• If iter = -2: narrowing the precision induced an overflow, the
routine fell back to full precision
• If iter = -3: failure of spotrf for dsposv, or cpotrf for zcposv
• If iter = -31: stop the iterative refinement after the 30th
iteration.
If iter > 0: iterative refinement has been successfully used. Returns
the number of iterations.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the leading minor of order i (and therefore the matrix A
itself) is not positive definite, so the factorization could not be
completed, and the solution has not been computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine posv interface are as follows:
a Holds the matrix A of size (n,n).
b Holds the matrix B of size (n,nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
?posvx
Uses the Cholesky factorization to compute the
solution to the system of linear equations with a
symmetric or Hermitian positive-definite matrix A, and
provides error bounds on the solution.
Syntax
Fortran 77:
call sposvx( fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond,
ferr, berr, work, iwork, info )
call dposvx( fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond,
ferr, berr, work, iwork, info )
LAPACK Routines: Linear Equations 3
599
call cposvx( fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond,
ferr, berr, work, rwork, info )
call zposvx( fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond,
ferr, berr, work, rwork, info )
Fortran 95:
call posvx( a, b, x [,uplo] [,af] [,fact] [,equed] [,s] [,ferr] [,berr] [,rcond]
[,info] )
C:
lapack_int LAPACKE_sposvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, float* a, lapack_int lda, float* af, lapack_int ldaf, char* equed,
float* s, float* b, lapack_int ldb, float* x, lapack_int ldx, float* rcond, float*
ferr, float* berr );
lapack_int LAPACKE_dposvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, double* a, lapack_int lda, double* af, lapack_int ldaf, char* equed,
double* s, double* b, lapack_int ldb, double* x, lapack_int ldx, double* rcond,
double* ferr, double* berr );
lapack_int LAPACKE_cposvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_float* a, lapack_int lda, lapack_complex_float* af,
lapack_int ldaf, char* equed, float* s, lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* x, lapack_int ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_zposvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_double* a, lapack_int lda, lapack_complex_double* af,
lapack_int ldaf, char* equed, double* s, lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* x, lapack_int ldx, double* rcond, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the Cholesky factorization A=UT*U (real flavors) / A=UH*U (complex flavors) or A=L*LT (real
flavors) / A=L*LH (complex flavors) to compute the solution to a real or complex system of linear equations
A*X = B, where A is a n-by-n real symmetric/Hermitian positive definite matrix, the columns of matrix B are
individual right-hand sides, and the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?posvx performs the following steps:
1. If fact = 'E', real scaling factors s are computed to equilibrate the system:
diag(s)*A*diag(s)*inv(diag(s))*X = diag(s)*B.
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration
is used, A is overwritten by diag(s)*A*diag(s) and B by diag(s)*B.
2. If fact = 'N' or 'E', the Cholesky decomposition is used to factor the matrix A (after equilibration if
fact = 'E') as
A = UT*U (real), A = UH*U (complex), if uplo = 'U',
or A = L*LT (real), A = L*LH (complex), if uplo = 'L',
3 Intel® Math Kernel Library Reference Manual
600
where U is an upper triangular matrix and L is a lower triangular matrix.
3. If the leading i-by-i principal minor is not positive-definite, then the routine returns with info = i.
Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the
reciprocal of the condition number is less than machine precision, info = n + 1 is returned as a
warning, but the routine still goes on to solve for X and compute error bounds as described below.
4. The system of equations is solved for X using the factored form of A.
5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
6. If equilibration was used, the matrix X is premultiplied by diag(s) so that it solves the original system
before equilibration.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether or not the factored form of the matrix A is supplied
on entry, and if not, whether the matrix A should be equilibrated
before it is factored.
If fact = 'F': on entry, af contains the factored form of A. If equed
= 'Y', the matrix A has been equilibrated with scaling factors given
by s.
a and af will not be modified.
If fact = 'N', the matrix A will be copied to af and factored.
If fact = 'E', the matrix A will be equilibrated if necessary, then
copied to af and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
a, af, b, work REAL for sposvx
DOUBLE PRECISION for dposvx
COMPLEX for cposvx
DOUBLE COMPLEX for zposvx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the matrix A as specified by uplo. If fact = 'F'
and equed = 'Y', then A must have been equilibrated by the scaling
factors in s, and a must contain the equilibrated matrix
diag(s)*A*diag(s). The second dimension of a must be at least
max(1,n).
The array af is an input argument if fact = 'F'. It contains the
triangular factor U or L from the Cholesky factorization of A in the
same storage format as A. If equed is not 'N', then af is the factored
form of the equilibrated matrix diag(s)*A*diag(s). The second
dimension of af must be at least max(1,n).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1, nrhs).
LAPACK Routines: Linear Equations 3
601
work(*) is a workspace array. The dimension of work must be at least
max(1,3*n) for real flavors, and at least max(1,2*n) for complex
flavors.
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
equed CHARACTER*1. Must be 'N' or 'Y'.
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
if equed = 'N', no equilibration was done (always true if fact =
'N');
if equed = 'Y', equilibration was done, that is, A has been replaced
by diag(s)*A*diag(s).
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n). The array s contains the scale factors for A.
This array is an input argument if fact = 'F' only; otherwise it is an
output argument.
If equed = 'N', s is not accessed.
If fact = 'F' and equed = 'Y', each element of s must be positive.
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,
n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in
real flavors only.
rwork REAL for cposvx
DOUBLE PRECISION for zposvx.
Workspace array, DIMENSION at least max(1, n); used in complex
flavors only.
Output Parameters
x REAL for sposvx
DOUBLE PRECISION for dposvx
COMPLEX for cposvx
DOUBLE COMPLEX for zposvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X to the original system of equations. Note that if equed = 'Y', A
and B are modified on exit, and the solution to the equilibrated system
is inv(diag(s))*X. The second dimension of x must be at least
max(1,nrhs).
a Array a is not modified on exit if fact = 'F' or 'N', or if fact =
'E' and equed = 'N'.
If fact = 'E' and equed = 'Y', A is overwritten by
diag(s)*A*diag(s).
af If fact = 'N' or 'E', then af is an output argument and on exit
returns the triangular factor U or L from the Cholesky factorization
A=U**T*U or A=L*L**T (real routines), A=U**H*U or A=L*L**H
(complex routines) of the original matrix A (if fact = 'N'), or of the
equilibrated matrix A (if fact = 'E'). See the description of a for the
form of the equilibrated matrix.
3 Intel® Math Kernel Library Reference Manual
602
b Overwritten by diag(s)*B, if equed = 'Y'; not changed if equed =
'N'.
s This array is an output argument if fact ? 'F'. See the description
of s in Input Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal condition number of the matrix A after
equilibration (if done). If rcond is less than the machine precision (in
particular, if rcond =0), the matrix is singular to working precision.
This condition is indicated by a return code of info>0.
ferr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x(j) (the j-th column of
the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
largest element in x(j). The estimate is as reliable as the estimate
for rcond, and is almost always a slight overestimate of the true
error.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
equed If fact ? 'F', then equed is an output argument. It specifies the
form of equilibration that was done (see the description of equed in
Input Arguments section).
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, the leading minor of order i (and therefore
the matrix A itself) is not positive-definite, so the factorization could
not be completed, and the solution and error bounds could not be
computed; rcond =0 is returned.
If info = i, and i = n + 1, then U is nonsingular, but rcond is less
than machine precision, meaning that the matrix is singular to
working precision. Nevertheless, the solution and error bounds are
computed because there are a number of situations where the
computed solution can be more accurate than the value of rcond
would suggest.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine posvx interface are as follows:
a Holds the matrix A of size (n,n).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
LAPACK Routines: Linear Equations 3
603
af Holds the matrix AF of size (n,n).
s Holds the vector of length n. Default value for each element is s(i) =
1.0_WP.
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
fact Must be 'N', 'E', or 'F'. The default value is 'N'. If fact = 'F',
then af must be present; otherwise, an error is returned.
equed Must be 'N' or 'Y'. The default value is 'N'.
?posvxx
Uses extra precise iterative refinement to compute the
solution to the system of linear equations with a
symmetric or Hermitian positive-definite matrix A
applying the Cholesky factorization.
Syntax
Fortran 77:
call sposvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond,
rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork,
info )
call dposvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond,
rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork,
info )
call cposvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond,
rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork,
info )
call zposvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond,
rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork,
info )
C:
lapack_int LAPACKE_sposvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, float* a, lapack_int lda, float* af, lapack_int ldaf, char* equed,
float* s, float* b, lapack_int ldb, float* x, lapack_int ldx, float* rcond, float*
rpvgrw, float* berr, lapack_int n_err_bnds, float* err_bnds_norm, float*
err_bnds_comp, lapack_int nparams, const float* params );
lapack_int LAPACKE_dposvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, double* a, lapack_int lda, double* af, lapack_int ldaf, char* equed,
double* s, double* b, lapack_int ldb, double* x, lapack_int ldx, double* rcond,
double* rpvgrw, double* berr, lapack_int n_err_bnds, double* err_bnds_norm, double*
err_bnds_comp, lapack_int nparams, const double* params );
lapack_int LAPACKE_cposvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_float* a, lapack_int lda, lapack_complex_float* af,
lapack_int ldaf, char* equed, float* s, lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* x, lapack_int ldx, float* rcond, float* rpvgrw, float* berr,
lapack_int n_err_bnds, float* err_bnds_norm, float* err_bnds_comp, lapack_int nparams,
const float* params );
3 Intel® Math Kernel Library Reference Manual
604
lapack_int LAPACKE_zposvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_double* a, lapack_int lda, lapack_complex_double* af,
lapack_int ldaf, char* equed, double* s, lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* x, lapack_int ldx, double* rcond, double* rpvgrw, double* berr,
lapack_int n_err_bnds, double* err_bnds_norm, double* err_bnds_comp, lapack_int
nparams, const double* params );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the Cholesky factorization A=UT*U (real flavors) / A=UH*U (complex flavors) or A=L*LT (real
flavors) / A=L*LH (complex flavors) to compute the solution to a real or complex system of linear equations
A*X = B, where A is an n-by-n real symmetric/Hermitian positive definite matrix, the columns of matrix B
are individual right-hand sides, and the columns of X are the corresponding solutions.
Both normwise and maximum componentwise error bounds are also provided on request. The routine returns
a solution with a small guaranteed error (O(eps), where eps is the working machine precision) unless the
matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers are also
calculated and returned.
The routine accepts user-provided factorizations and equilibration factors; see definitions of the fact and
equed options. Solving with refinement and using a factorization from a previous call of the routine also
produces a solution with O(eps) errors or warnings but that may not be true for general user-provided
factorizations and equilibration factors if they differ from what the routine would itself produce.
The routine ?posvxx performs the following steps:
1. If fact = 'E', scaling factors are computed to equilibrate the system:
diag(s)*A*diag(s) *inv(diag(s))*X = diag(s)*B
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration
is used, A is overwritten by diag(s)*A*diag(s) and B by diag(s)*B.
2. If fact = 'N' or 'E', the Cholesky decomposition is used to factor the matrix A (after equilibration if
fact = 'E') as
A = UT*U (real), A = UH*U (complex), if uplo = 'U',
or A = L*LT (real), A = L*LH (complex), if uplo = 'L',
where U is an upper triangular matrix and L is a lower triangular matrix.
3. If the leading i-by-i principal minor is not positive-definite, the routine returns with info = i.
Otherwise, the factored form of A is used to estimate the condition number of the matrix A (see the rcond
parameter). If the reciprocal of the condition number is less than machine precision, the routine still goes
on to solve for X and compute error bounds.
4. The system of equations is solved for X using the factored form of A.
5. By default, unless params(la_linrx_itref_i) is set to zero, the routine applies iterative refinement to
get a small error and error bounds. Refinement calculates the residual to at least twice the working
precision.
6. If equilibration was used, the matrix X is premultiplied by diag(s) so that it solves the original system
before equilibration.
LAPACK Routines: Linear Equations 3
605
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether or not the factored form of the matrix A is supplied on
entry, and if not, whether the matrix A should be equilibrated before it is
factored.
If fact = 'F', on entry, af contains the factored form of A. If equed is not
'N', the matrix A has been equilibrated with scaling factors given by s.
Parameters a and af are not modified.
If fact = 'N', the matrix A will be copied to af and factored.
If fact = 'E', the matrix A will be equilibrated, if necessary, copied to af
and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns of the
matrices B and X; nrhs = 0.
a, af, b, work REAL for sposvxx
DOUBLE PRECISION for dposvxx
COMPLEX for cposvxx
DOUBLE COMPLEX for zposvxx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the matrix A as specified by uplo . If fact = 'F' and
equed = 'Y', then A must have been equilibrated by the scaling factors in
s, and a must contain the equilibrated matrix diag(s)*A*diag(s). The
second dimension of a must be at least max(1,n).
The array af is an input argument if fact = 'F'. It contains the triangular
factor U or L from the Cholesky factorization of A in the same storage
format as A. If equed is not 'N', then af is the factored form of the
equilibrated matrix diag(s)*A*diag(s). The second dimension of af must
be at least max(1,n).
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
If equed = 'N', s is not accessed.
If fact = 'F' and equed = 'Y', each element of s must be positive.
work(*) is a workspace array. The dimension of work must be at least
max(1,4*n) for real flavors, and at least max(1,2*n) for complex flavors.
lda INTEGER. The leading dimension of the array a; lda = max(1,n).
ldaf INTEGER. The leading dimension of the array af; ldaf = max(1,n).
equed CHARACTER*1. Must be 'N' or 'Y'.
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
If equed = 'N', no equilibration was done (always true if fact = 'N').
if equed = 'Y', both row and column equilibration was done, that is, A has
been replaced by diag(s)*A*diag(s).
3 Intel® Math Kernel Library Reference Manual
606
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n). The array s contains the scale factors for A. This
array is an input argument if fact = 'F' only; otherwise it is an output
argument.
If equed = 'N', s is not accessed.
If fact = 'F' and equed = 'Y', each element of s must be positive.
Each element of s should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
ldx INTEGER. The leading dimension of the output array x; ldx = max(1, n).
n_err_bnds INTEGER. Number of error bounds to return for each right hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in the Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry is filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0 (for single precision flavors), 1.0D+0 (for
double precision flavors).
=0.0 No refinement is performed and no error bounds
are computed.
=1.0 Use the extra-precise refinement algorithm.
(Other values are reserved for futute use.)
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for fefinement.
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in real
flavors only.
rwork REAL for single precision flavors
LAPACK Routines: Linear Equations 3
607
DOUBLE PRECISION for double precision flavors.
Workspace array, DIMENSION at least max(1, 3*n); used in complex
flavors only.
Output Parameters
x REAL for sposvxx
DOUBLE PRECISION for dposvxx
COMPLEX for cposvxx
DOUBLE COMPLEX for zposvxx.
Array, DIMENSION (ldx,*).
If info = 0, the array x contains the solution n-by-nrhs matrix X to the
original system of equations. Note that A and B are modified on exit if
equed ? 'N', and the solution to the equilibrated system is:
inv(diag(s))*X.
a Array a is not modified on exit if fact = 'F' or 'N', or if fact = 'E' and
equed = 'N'.
If fact = 'E' and equed = 'Y', A is overwritten by diag(s)*A*diag(s).
af If fact = 'N' or 'E', then af is an output argument and on exit returns
the triangular factor U or L from the Cholesky factorization A=U**T*U or
A=L*L**T (real routines), A=U**H*U or A=L*L**H (complex routines) of the
original matrix A (if fact = 'N'), or of the equilibrated matrix A (if fact =
'E'). See the description of a for the form of the equilibrated matrix.
b If equed = 'N', B is not modified.
If equed = 'Y', B is overwritten by diag(s)*B.
s This array is an output argument if fact ? 'F'. Each element of this array
is a power of the radix. See the description of s in Input Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
rpvgrw REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Contains the reciprocal pivot growth factor norm(A)/norm(U). The max
absolute element norm is used. If this is much less than 1, the stability of
the LU factorization of the (equlibrated) matrix A could be poor. This also
means that the solution X, estimated condition numbers, and error bounds
could be unreliable. If factorization fails with 0 < info = n, this parameter
contains the reciprocal pivot growth factor for the leading info columns of
A.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
err_bnds_norm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
3 Intel® Math Kernel Library Reference Manual
608
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
LAPACK Routines: Linear Equations 3
609
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
equed If fact ? 'F', then equed is an output argument. It specifies the form of
equilibration that was done (see the description of equed in Input
Arguments section).
params If an entry is less than 0.0, that entry is filled with the default value used
for that parameter, otherwise the entry is not modified.
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
3 Intel® Math Kernel Library Reference Manual
610
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
?ppsv
Computes the solution to the system of linear
equations with a symmetric (Hermitian) positive
definite packed matrix A and multiple right-hand
sides.
Syntax
Fortran 77:
call sppsv( uplo, n, nrhs, ap, b, ldb, info )
call dppsv( uplo, n, nrhs, ap, b, ldb, info )
call cppsv( uplo, n, nrhs, ap, b, ldb, info )
call zppsv( uplo, n, nrhs, ap, b, ldb, info )
Fortran 95:
call ppsv( ap, b [,uplo] [,info] )
C:
lapack_int LAPACKE_ppsv( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
* ap, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the real or complex system of linear equations A*X = B, where A is an n-by-n real
symmetric/Hermitian positive-definite matrix stored in packed format, the columns of matrix B are individual
right-hand sides, and the columns of X are the corresponding solutions.
The Cholesky decomposition is used to factor A as
A = UT*U (real flavors) and A = UH*U (complex flavors), if uplo = 'U'
or A = L*LT (real flavors) and A = L*LH (complex flavors), if uplo = 'L',
where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used
to solve the system of equations A*X = B.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
LAPACK Routines: Linear Equations 3
611
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
ap, b REAL for sppsv
DOUBLE PRECISION for dppsv
COMPLEX for cppsv
DOUBLE COMPLEX for zppsv.
Arrays: ap(*), b(ldb,*). The array ap contains the upper or the
lower triangular part of the matrix A (as specified by uplo) in packed
storage (see Matrix Storage Schemes). The dimension of ap must be
at least max(1,n(n+1)/2).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
ap If info = 0, the upper or lower triangular part of A in packed storage
is overwritten by the Cholesky factor U or L, as specified by uplo.
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the leading minor of order i (and therefore the matrix A
itself) is not positive-definite, so the factorization could not be
completed, and the solution has not been computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine ppsv interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n,nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
?ppsvx
Uses the Cholesky factorization to compute the
solution to the system of linear equations with a
symmetric (Hermitian) positive definite packed matrix
A, and provides error bounds on the solution.
3 Intel® Math Kernel Library Reference Manual
612
Syntax
Fortran 77:
call sppsvx( fact, uplo, n, nrhs, ap, afp, equed, s, b, ldb, x, ldx, rcond, ferr,
berr, work, iwork, info )
call dppsvx( fact, uplo, n, nrhs, ap, afp, equed, s, b, ldb, x, ldx, rcond, ferr,
berr, work, iwork, info )
call cppsvx( fact, uplo, n, nrhs, ap, afp, equed, s, b, ldb, x, ldx, rcond, ferr,
berr, work, rwork, info )
call zppsvx( fact, uplo, n, nrhs, ap, afp, equed, s, b, ldb, x, ldx, rcond, ferr,
berr, work, rwork, info )
Fortran 95:
call ppsvx( ap, b, x [,uplo] [,af] [,fact] [,equed] [,s] [,ferr] [,berr] [,rcond]
[,info] )
C:
lapack_int LAPACKE_sppsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, float* ap, float* afp, char* equed, float* s, float* b, lapack_int
ldb, float* x, lapack_int ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_dppsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, double* ap, double* afp, char* equed, double* s, double* b,
lapack_int ldb, double* x, lapack_int ldx, double* rcond, double* ferr, double* berr );
lapack_int LAPACKE_cppsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_float* ap, lapack_complex_float* afp, char* equed,
float* s, lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int
ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_zppsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_double* ap, lapack_complex_double* afp, char* equed,
double* s, lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x,
lapack_int ldx, double* rcond, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the Cholesky factorization A=UT*U (real flavors) / A=UH*U (complex flavors) or A=L*LT (real
flavors) / A=L*LH (complex flavors) to compute the solution to a real or complex system of linear equations
A*X = B, where A is a n-by-n symmetric or Hermitian positive-definite matrix stored in packed format, the
columns of matrix B are individual right-hand sides, and the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?ppsvx performs the following steps:
1. If fact = 'E', real scaling factors s are computed to equilibrate the system:
diag(s)*A*diag(s)*inv(diag(s))*X = diag(s)*B.
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration
is used, A is overwritten by diag(s)*A*diag(s) and B by diag(s)*B.
LAPACK Routines: Linear Equations 3
613
2. If fact = 'N' or 'E', the Cholesky decomposition is used to factor the matrix A (after equilibration if
fact = 'E') as
A = UT*U (real), A = UH*U (complex), if uplo = 'U',
or A = L*LT (real), A = L*LH (complex), if uplo = 'L',
where U is an upper triangular matrix and L is a lower triangular matrix.
3. If the leading i-by-i principal minor is not positive-definite, then the routine returns with info = i.
Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the
reciprocal of the condition number is less than machine precision, info = n+1 is returned as a warning,
but the routine still goes on to solve for X and compute error bounds as described below.
4. The system of equations is solved for X using the factored form of A.
5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
6. If equilibration was used, the matrix X is premultiplied by diag(s) so that it solves the original system
before equilibration.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether or not the factored form of the matrix A is supplied
on entry, and if not, whether the matrix A should be equilibrated
before it is factored.
If fact = 'F': on entry, afp contains the factored form of A. If
equed = 'Y', the matrix A has been equilibrated with scaling factors
given by s.
ap and afp will not be modified.
If fact = 'N', the matrix A will be copied to afp and factored.
If fact = 'E', the matrix A will be equilibrated if necessary, then
copied to afp and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns in
B; nrhs = 0.
ap, afp, b, work REAL for sppsvx
DOUBLE PRECISION for dppsvx
COMPLEX for cppsvx
DOUBLE COMPLEX for zppsvx.
Arrays: ap(*), afp(*), b(ldb,*), work(*).
The array ap contains the upper or lower triangle of the original
symmetric/Hermitian matrix A in packed storage (see Matrix Storage
Schemes). In case when fact = 'F' and equed = 'Y', ap must
contain the equilibrated matrix diag(s)*A*diag(s).
3 Intel® Math Kernel Library Reference Manual
614
The array afp is an input argument if fact = 'F' and contains the
triangular factor U or L from the Cholesky factorization of A in the
same storage format as A. If equed is not 'N', then afp is the
factored form of the equilibrated matrix A.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
work(*) is a workspace array.
The dimension of arrays ap and afp must be at least max(1, n(n
+1)/2); the second dimension of b must be at least max(1,nrhs);
the dimension of work must be at least max(1, 3*n) for real flavors
and max(1, 2*n) for complex flavors.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
equed CHARACTER*1. Must be 'N' or 'Y'.
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
if equed = 'N', no equilibration was done (always true if fact =
'N');
if equed = 'Y', equilibration was done, that is, A has been replaced
by diag(s)A*diag(s).
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n). The array s contains the scale factors for A.
This array is an input argument if fact = 'F' only; otherwise it is an
output argument.
If equed = 'N', s is not accessed.
If fact = 'F' and equed = 'Y', each element of s must be positive.
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,
n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in
real flavors only.
rwork REAL for cppsvx;
DOUBLE PRECISION for zppsvx.
Workspace array, DIMENSION at least max(1, n); used in complex
flavors only.
Output Parameters
x REAL for sppsvx
DOUBLE PRECISION for dppsvx
COMPLEX for cppsvx
DOUBLE COMPLEX for zppsvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X to the original system of equations. Note that if equed = 'Y', A
and B are modified on exit, and the solution to the equilibrated system
is inv(diag(s))*X. The second dimension of x must be at least
max(1,nrhs).
ap Array ap is not modified on exit if fact = 'F' or 'N', or if fact =
'E' and equed = 'N'.
If fact = 'E' and equed = 'Y', A is overwritten by
diag(s)*A*diag(s).
LAPACK Routines: Linear Equations 3
615
afp If fact = 'N' or 'E', then afp is an output argument and on exit
returns the triangular factor U or L from the Cholesky factorization
A=UT*U or A=L*LT (real routines), A=UH*U or A=L*LH (complex
routines) of the original matrix A (if fact = 'N'), or of the
equilibrated matrix A (if fact = 'E'). See the description of ap for
the form of the equilibrated matrix.
b Overwritten by diag(s)*B, if equed = 'Y'; not changed if equed =
'N'.
s This array is an output argument if fact ? 'F'. See the description
of s in Input Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal condition number of the matrix A after
equilibration (if done). If rcond is less than the machine precision (in
particular, if rcond = 0), the matrix is singular to working precision.
This condition is indicated by a return code of info > 0.
ferr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x(j) (the j-th column of
the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
largest element in x(j). The estimate is as reliable as the estimate
for rcond, and is almost always a slight overestimate of the true
error.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
equed If fact ? 'F', then equed is an output argument. It specifies the
form of equilibration that was done (see the description of equed in
Input Arguments section).
info INTEGER. If info=0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, the leading minor of order i (and therefore
the matrix A itself) is not positive-definite, so the factorization could
not be completed, and the solution and error bounds could not be
computed; rcond = 0 is returned.
If info = i, and i = n + 1, then U is nonsingular, but rcond is less
than machine precision, meaning that the matrix is singular to
working precision. Nevertheless, the solution and error bounds are
computed because there are a number of situations where the
computed solution can be more accurate than the value of rcond
would suggest.
3 Intel® Math Kernel Library Reference Manual
616
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine ppsvx interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
afp Holds the matrix AF of size (n*(n+1)/2).
s Holds the vector of length n. Default value for each element is s(i) =
1.0_WP.
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
fact Must be 'N', 'E', or 'F'. The default value is 'N'. If fact = 'F',
then af must be present; otherwise, an error is returned.
equed Must be 'N' or 'Y'. The default value is 'N'.
?pbsv
Computes the solution to the system of linear
equations with a symmetric or Hermitian positivedefinite
band matrix A and multiple right-hand sides.
Syntax
Fortran 77:
call spbsv( uplo, n, kd, nrhs, ab, ldab, b, ldb, info )
call dpbsv( uplo, n, kd, nrhs, ab, ldab, b, ldb, info )
call cpbsv( uplo, n, kd, nrhs, ab, ldab, b, ldb, info )
call zpbsv( uplo, n, kd, nrhs, ab, ldab, b, ldb, info )
Fortran 95:
call pbsv( ab, b [,uplo] [,info] )
C:
lapack_int LAPACKE_pbsv( int matrix_order, char uplo, lapack_int n, lapack_int kd,
lapack_int nrhs, * ab, lapack_int ldab, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the real or complex system of linear equations A*X = B, where A is an n-by-n
symmetric/Hermitian positive definite band matrix, the columns of matrix B are individual right-hand sides,
and the columns of X are the corresponding solutions.
LAPACK Routines: Linear Equations 3
617
The Cholesky decomposition is used to factor A as
A = UT*U (real flavors) and A = UH*U (complex flavors), if uplo = 'U'
or A = L*LT (real flavors) and A = L*LH (complex flavors), if uplo = 'L',
where U is an upper triangular band matrix and L is a lower triangular band matrix, with the same number of
superdiagonals or subdiagonals as A. The factored form of A is then used to solve the system of equations
A*X = B.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
kd INTEGER. The number of superdiagonals of the matrix A if uplo =
'U', or the number of subdiagonals if uplo = 'L'; kd = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
ab, b REAL for spbsv
DOUBLE PRECISION for dpbsv
COMPLEX for cpbsv
DOUBLE COMPLEX for zpbsv.
Arrays: ab(ldab, *), b(ldb,*). The array ab contains the upper or
the lower triangular part of the matrix A (as specified by uplo) in
band storage (see Matrix Storage Schemes). The second dimension
of ab must be at least max(1, n).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
ldab INTEGER. The leading dimension of the array ab; ldab = kd +1.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
ab The upper or lower triangular part of A (in band storage) is
overwritten by the Cholesky factor U or L, as specified by uplo, in the
same storage format as A.
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the leading minor of order i (and therefore the matrix A
itself) is not positive-definite, so the factorization could not be
completed, and the solution has not been computed.
3 Intel® Math Kernel Library Reference Manual
618
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pbsv interface are as follows:
ab Holds the array A of size (kd+1,n).
b Holds the matrix B of size (n,nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
?pbsvx
Uses the Cholesky factorization to compute the
solution to the system of linear equations with a
symmetric (Hermitian) positive-definite band matrix
A, and provides error bounds on the solution.
Syntax
Fortran 77:
call spbsvx( fact, uplo, n, kd, nrhs, ab, ldab, afb, ldafb, equed, s, b, ldb, x, ldx,
rcond, ferr, berr, work, iwork, info )
call dpbsvx( fact, uplo, n, kd, nrhs, ab, ldab, afb, ldafb, equed, s, b, ldb, x, ldx,
rcond, ferr, berr, work, iwork, info )
call cpbsvx( fact, uplo, n, kd, nrhs, ab, ldab, afb, ldafb, equed, s, b, ldb, x, ldx,
rcond, ferr, berr, work, rwork, info )
call zpbsvx( fact, uplo, n, kd, nrhs, ab, ldab, afb, ldafb, equed, s, b, ldb, x, ldx,
rcond, ferr, berr, work, rwork, info )
Fortran 95:
call pbsvx( ab, b, x [,uplo] [,afb] [,fact] [,equed] [,s] [,ferr] [,berr] [,rcond]
[,info] )
C:
lapack_int LAPACKE_spbsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int kd, lapack_int nrhs, float* ab, lapack_int ldab, float* afb, lapack_int
ldafb, char* equed, float* s, float* b, lapack_int ldb, float* x, lapack_int ldx,
float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_dpbsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int kd, lapack_int nrhs, double* ab, lapack_int ldab, double* afb, lapack_int
ldafb, char* equed, double* s, double* b, lapack_int ldb, double* x, lapack_int ldx,
double* rcond, double* ferr, double* berr );
lapack_int LAPACKE_cpbsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int kd, lapack_int nrhs, lapack_complex_float* ab, lapack_int ldab,
lapack_complex_float* afb, lapack_int ldafb, char* equed, float* s,
lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx,
float* rcond, float* ferr, float* berr );
LAPACK Routines: Linear Equations 3
619
lapack_int LAPACKE_zpbsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int kd, lapack_int nrhs, lapack_complex_double* ab, lapack_int ldab,
lapack_complex_double* afb, lapack_int ldafb, char* equed, double* s,
lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int ldx,
double* rcond, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the Cholesky factorization A=UT*U (real flavors) / A=UH*U (complex flavors) or A=L*LT (real
flavors) / A=L*LH (complex flavors) to compute the solution to a real or complex system of linear equations
A*X = B, where A is a n-by-n symmetric or Hermitian positive definite band matrix, the columns of matrix B
are individual right-hand sides, and the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?pbsvx performs the following steps:
1. If fact = 'E', real scaling factors s are computed to equilibrate the system:
diag(s)*A*diag(s)*inv(diag(s))*X = diag(s)*B.
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration
is used, A is overwritten by diag(s)*A*diag(s) and B by diag(s)*B.
2. If fact = 'N' or 'E', the Cholesky decomposition is used to factor the matrix A (after equilibration if
fact = 'E') as
A = UT*U (real), A = UH*U (complex), if uplo = 'U',
or A = L*LT (real), A = L*LH (complex), if uplo = 'L',
where U is an upper triangular band matrix and L is a lower triangular band matrix.
3. If the leading i-by-i principal minor is not positive definite, then the routine returns with info = i.
Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the
reciprocal of the condition number is less than machine precision, info = n+1 is returned as a warning,
but the routine still goes on to solve for X and compute error bounds as described below.
4. The system of equations is solved for X using the factored form of A.
5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
6. If equilibration was used, the matrix X is premultiplied by diag(s) so that it solves the original system
before equilibration.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether or not the factored form of the matrix A is supplied
on entry, and if not, whether the matrix A should be equilibrated
before it is factored.
3 Intel® Math Kernel Library Reference Manual
620
If fact = 'F': on entry, afb contains the factored form of A. If
equed = 'Y', the matrix A has been equilibrated with scaling factors
given by s.
ab and afb will not be modified.
If fact = 'N', the matrix A will be copied to afb and factored.
If fact = 'E', the matrix A will be equilibrated if necessary, then
copied to afb and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
kd INTEGER. The number of superdiagonals or subdiagonals in the matrix
A; kd = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
ab, afb, b, work REAL for spbsvx
DOUBLE PRECISION for dpbsvx
COMPLEX for cpbsvx
DOUBLE COMPLEX for zpbsvx.
Arrays: ab(ldab,*), afb(ldab,*), b(ldb,*), work(*).
The array ab contains the upper or lower triangle of the matrix A in
band storage (see Matrix Storage Schemes).
If fact = 'F' and equed = 'Y', then ab must contain the
equilibrated matrix diag(s)*A*diag(s). The second dimension of ab
must be at least max(1, n).
The array afb is an input argument if fact = 'F'. It contains the
triangular factor U or L from the Cholesky factorization of the band
matrix A in the same storage format as A. If equed = 'Y', then afb
is the factored form of the equilibrated matrix A. The second
dimension of afb must be at least max(1, n).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1, nrhs).
work(*) is a workspace array.
The dimension of work must be at least max(1,3*n) for real flavors,
and at least max(1,2*n) for complex flavors.
ldab INTEGER. The leading dimension of ab; ldab = kd+1.
ldafb INTEGER. The leading dimension of afb; ldafb = kd+1.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
equed CHARACTER*1. Must be 'N' or 'Y'.
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
if equed = 'N', no equilibration was done (always true if fact =
'N')
if equed = 'Y', equilibration was done, that is, A has been replaced
by diag(s)*A*diag(s).
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
LAPACK Routines: Linear Equations 3
621
Array, DIMENSION (n). The array s contains the scale factors for A.
This array is an input argument if fact = 'F' only; otherwise it is an
output argument.
If equed = 'N', s is not accessed.
If fact = 'F' and equed = 'Y', each element of s must be positive.
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,
n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in
real flavors only.
rwork REAL for cpbsvx
DOUBLE PRECISION for zpbsvx.
Workspace array, DIMENSION at least max(1, n); used in complex
flavors only.
Output Parameters
x REAL for spbsvx
DOUBLE PRECISION for dpbsvx
COMPLEX for cpbsvx
DOUBLE COMPLEX for zpbsvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix X
to the original system of equations. Note that if equed = 'Y', A and
B are modified on exit, and the solution to the equilibrated system is
inv(diag(s))*X. The second dimension of x must be at least
max(1,nrhs).
ab On exit, if fact = 'E' and equed = 'Y', A is overwritten by
diag(s)*A*diag(s).
afb If fact = 'N' or 'E', then afb is an output argument and on exit
returns the triangular factor U or L from the Cholesky factorization
A=UT*U or A=L*LT (real routines), A=UH*U or A=L*LH (complex
routines) of the original matrix A (if fact = 'N'), or of the
equilibrated matrix A (if fact = 'E'). See the description of ab for
the form of the equilibrated matrix.
b Overwritten by diag(s)*B, if equed = 'Y'; not changed if equed =
'N'.
s This array is an output argument if fact ? 'F'. See the description
of s in Input Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal condition number of the matrix A after
equilibration (if done). If rcond is less than the machine precision (in
particular, if rcond = 0), the matrix is singular to working precision.
This condition is indicated by a return code of info > 0.
ferr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x(j) (the j-th column of
the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
3 Intel® Math Kernel Library Reference Manual
622
largest element in x(j). The estimate is as reliable as the estimate
for rcond, and is almost always a slight overestimate of the true
error.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
equed If fact ?'F', then equed is an output argument. It specifies the form
of equilibration that was done (see the description of equed in Input
Arguments section).
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, the leading minor of order i (and therefore
the matrix A itself) is not positive definite, so the factorization could
not be completed, and the solution and error bounds could not be
computed; rcond =0 is returned. If info = i, and i = n + 1, then U
is nonsingular, but rcond is less than machine precision, meaning that
the matrix is singular to working precision. Nevertheless, the solution
and error bounds are computed because there are a number of
situations where the computed solution can be more accurate than the
value of rcond would suggest.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine pbsvx interface are as follows:
ab Holds the array A of size (kd+1,n).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
afb Holds the array AF of size (kd+1,n).
s Holds the vector with the number of elements n. Default value for
each element is s(i) = 1.0_WP.
ferr Holds the vector with the number of elements nrhs.
berr Holds the vector with the number of elements nrhs.
uplo Must be 'U' or 'L'. The default value is 'U'.
fact Must be 'N', 'E', or 'F'. The default value is 'N'. If fact = 'F',
then af must be present; otherwise, an error is returned.
equed Must be 'N' or 'Y'. The default value is 'N'.
?ptsv
Computes the solution to the system of linear
equations with a symmetric or Hermitian positive
definite tridiagonal matrix A and multiple right-hand
sides.
LAPACK Routines: Linear Equations 3
623
Syntax
Fortran 77:
call sptsv( n, nrhs, d, e, b, ldb, info )
call dptsv( n, nrhs, d, e, b, ldb, info )
call cptsv( n, nrhs, d, e, b, ldb, info )
call zptsv( n, nrhs, d, e, b, ldb, info )
Fortran 95:
call ptsv( d, e, b [,info] )
C:
lapack_int LAPACKE_sptsv( int matrix_order, lapack_int n, lapack_int nrhs, float* d,
float* e, float* b, lapack_int ldb );
lapack_int LAPACKE_dptsv( int matrix_order, lapack_int n, lapack_int nrhs, double* d,
double* e, double* b, lapack_int ldb );
lapack_int LAPACKE_cptsv( int matrix_order, lapack_int n, lapack_int nrhs, float* d,
lapack_complex_float* e, lapack_complex_float* b, lapack_int ldb );
lapack_int LAPACKE_zptsv( int matrix_order, lapack_int n, lapack_int nrhs, double* d,
lapack_complex_double* e, lapack_complex_double* b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the real or complex system of linear equations A*X = B, where A is an n-by-n
symmetric/Hermitian positive-definite tridiagonal matrix, the columns of matrix B are individual right-hand
sides, and the columns of X are the corresponding solutions.
A is factored as A = L*D*LT (real flavors) or A = L*D*LH (complex flavors), and the factored form of A is
then used to solve the system of equations A*X = B.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
d REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, dimension at least max(1, n). Contains the diagonal elements
of the tridiagonal matrix A.
e, b REAL for sptsv
DOUBLE PRECISION for dptsv
COMPLEX for cptsv
3 Intel® Math Kernel Library Reference Manual
624
DOUBLE COMPLEX for zptsv.
Arrays: e(n - 1), b(ldb,*). The array e contains the (n - 1)
subdiagonal elements of A.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
d Overwritten by the n diagonal elements of the diagonal matrix D from
the L*D*LT (real)/ L*D*LH (complex) factorization of A.
e Overwritten by the (n - 1) subdiagonal elements of the unit
bidiagonal factor L from the factorization of A.
b Overwritten by the solution matrix X.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, the leading minor of order i (and therefore the matrix A
itself) is not positive-definite, and the solution has not been
computed. The factorization has not been completed unless i = n.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine ptsv interface are as follows:
d Holds the vector of length n.
e Holds the vector of length (n-1).
b Holds the matrix B of size (n,nrhs).
?ptsvx
Uses factorization to compute the solution to the
system of linear equations with a symmetric
(Hermitian) positive definite tridiagonal matrix A, and
provides error bounds on the solution.
Syntax
Fortran 77:
call sptsvx( fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond, ferr, berr, work,
info )
call dptsvx( fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond, ferr, berr, work,
info )
call cptsvx( fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond, ferr, berr, work,
rwork, info )
call zptsvx( fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond, ferr, berr, work,
rwork, info )
LAPACK Routines: Linear Equations 3
625
Fortran 95:
call ptsvx( d, e, b, x [,df] [,ef] [,fact] [,ferr] [,berr] [,rcond] [,info] )
C:
lapack_int LAPACKE_sptsvx( int matrix_order, char fact, lapack_int n, lapack_int nrhs,
const float* d, const float* e, float* df, float* ef, const float* b, lapack_int ldb,
float* x, lapack_int ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_dptsvx( int matrix_order, char fact, lapack_int n, lapack_int nrhs,
const double* d, const double* e, double* df, double* ef, const double* b, lapack_int
ldb, double* x, lapack_int ldx, double* rcond, double* ferr, double* berr );
lapack_int LAPACKE_cptsvx( int matrix_order, char fact, lapack_int n, lapack_int nrhs,
const float* d, const lapack_complex_float* e, float* df, lapack_complex_float* ef,
const lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x, lapack_int ldx,
float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_zptsvx( int matrix_order, char fact, lapack_int n, lapack_int nrhs,
const double* d, const lapack_complex_double* e, double* df, lapack_complex_double* ef,
const lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int
ldx, double* rcond, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the Cholesky factorization A = L*D*LT (real)/A = L*D*LH (complex) to compute the
solution to a real or complex system of linear equations A*X = B, where A is a n-by-n symmetric or
Hermitian positive definite tridiagonal matrix, the columns of matrix B are individual right-hand sides, and
the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?ptsvx performs the following steps:
1. If fact = 'N', the matrix A is factored as A = L*D*LT (real flavors)/A = L*D*LH (complex flavors),
where L is a unit lower bidiagonal matrix and D is diagonal. The factorization can also be regarded as
having the form A = UT*D*U (real flavors)/A = UH*D*U (complex flavors).
2. If the leading i-by-i principal minor is not positive-definite, then the routine returns with info = i.
Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the
reciprocal of the condition number is less than machine precision, info = n+1 is returned as a warning,
but the routine still goes on to solve for X and compute error bounds as described below.
3. The system of equations is solved for X using the factored form of A.
4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F' or 'N'.
3 Intel® Math Kernel Library Reference Manual
626
Specifies whether or not the factored form of the matrix A is supplied
on entry.
If fact = 'F': on entry, df and ef contain the factored form of A.
Arrays d, e, df, and ef will not be modified.
If fact = 'N', the matrix A will be copied to df and ef, and factored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
d, df, rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays: d(n), df(n), rwork(n).
The array d contains the n diagonal elements of the tridiagonal matrix
A.
The array df is an input argument if fact = 'F' and on entry
contains the n diagonal elements of the diagonal matrix D from the
L*D*LT (real)/ L*D*LH (complex) factorization of A.
The array rwork is a workspace array used for complex flavors only.
e,ef,b,work REAL for sptsvx
DOUBLE PRECISION for dptsvx
COMPLEX for cptsvx
DOUBLE COMPLEX for zptsvx.
Arrays: e(n -1), ef(n -1), b(ldb*), work(*). The array e contains
the (n - 1) subdiagonal elements of the tridiagonal matrix A.
The array ef is an input argument if fact = 'F' and on entry
contains the (n - 1) subdiagonal elements of the unit bidiagonal
factor L from the L*D*LT (real)/ L*D*LH (complex) factorization of A.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
The array work is a workspace array. The dimension of work must be
at least 2*n for real flavors, and at least n for complex flavors.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ldx INTEGER. The leading dimension of x; ldx = max(1, n).
Output Parameters
x REAL for sptsvx
DOUBLE PRECISION for dptsvx
COMPLEX for cptsvx
DOUBLE COMPLEX for zptsvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X to the system of equations. The second dimension of x must be at
least max(1,nrhs).
df, ef These arrays are output arguments if fact = 'N'. See the
description of df, ef in Input Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal condition number of the matrix A after
equilibration (if done). If rcond is less than the machine precision (in
particular, if rcond = 0), the matrix is singular to working precision.
This condition is indicated by a return code of info > 0.
LAPACK Routines: Linear Equations 3
627
ferr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x(j) (the j-th column of
the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
largest element in x(j). The estimate is as reliable as the estimate
for rcond, and is almost always a slight overestimate of the true
error.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, the leading minor of order i (and therefore
the matrix A itself) is not positive-definite, so the factorization could
not be completed, and the solution and error bounds could not be
computed; rcond =0 is returned.
If info = i, and i = n + 1, then U is nonsingular, but rcond is less
than machine precision, meaning that the matrix is singular to
working precision. Nevertheless, the solution and error bounds are
computed because there are a number of situations where the
computed solution can be more accurate than the value of rcond
would suggest.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine ptsvx interface are as follows:
d Holds the vector of length n.
e Holds the vector of length (n-1).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
df Holds the vector of length n.
ef Holds the vector of length (n-1).
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
fact Must be 'N' or 'F'. The default value is 'N'. If fact = 'F', then
both arguments af and ipiv must be present; otherwise, an error is
returned.
3 Intel® Math Kernel Library Reference Manual
628
?sysv
Computes the solution to the system of linear
equations with a real or complex symmetric matrix A
and multiple right-hand sides.
Syntax
Fortran 77:
call ssysv( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info )
call dsysv( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info )
call csysv( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info )
call zsysv( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info )
Fortran 95:
call sysv( a, b [,uplo] [,ipiv] [,info] )
C:
lapack_int LAPACKE_sysv( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
* a, lapack_int lda, lapack_int* ipiv, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the real or complex system of linear equations A*X = B, where A is an n-by-n
symmetric matrix, the columns of matrix B are individual right-hand sides, and the columns of X are the
corresponding solutions.
The diagonal pivoting method is used to factor A as A = U*D*UT or A = L*D*LT, where U (or L) is a product
of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1
and 2-by-2 diagonal blocks.
The factored form of A is then used to solve the system of equations A*X = B.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns in
B; nrhs = 0.
a, b, work REAL for ssysv
DOUBLE PRECISION for dsysv
LAPACK Routines: Linear Equations 3
629
COMPLEX for csysv
DOUBLE COMPLEX for zsysv.
Arrays: a(lda,*), b(ldb,*), work(*).
The array a contains the upper or the lower triangular part of the
symmetric matrix A (see uplo). The second dimension of a must be at
least max(1, n).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
work is a workspace array, dimension at least max(1,lwork).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
lwork INTEGER. The size of the work array; lwork = 1.
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the
first entry of the work array, and no error message related to lwork is
issued by xerbla. See Application Notes below for details and for the
suggested value of lwork.
Output Parameters
a If info = 0, a is overwritten by the block-diagonal matrix D and the
multipliers used to obtain the factor U (or L) from the factorization of
A as computed by ?sytrf.
b If info = 0, b is overwritten by the solution matrix X.
ipiv INTEGER.
Array, DIMENSION at least max(1, n). Contains details of the
interchanges and the block structure of D, as determined by ?sytrf.
If ipiv(i) = k >0, then dii is a 1-by-1 diagonal block, and the i-th
row and column of A was interchanged with the k-th row and column.
If uplo = 'U' and ipiv(i) = ipiv(i-1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i-1, and (i-1)-th row and column
of A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) = ipiv(i+1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i+1, and (i+1)-th row and column
of A was interchanged with the m-th row and column.
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent
runs.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, dii is 0. The factorization has been completed, but D is
exactly singular, so the solution could not be computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sysv interface are as follows:
a Holds the matrix A of size (n,n).
3 Intel® Math Kernel Library Reference Manual
630
b Holds the matrix B of size (n,nrhs).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
For better performance, try using lwork = n*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
?sysvx
Uses the diagonal pivoting factorization to compute
the solution to the system of linear equations with a
real or complex symmetric matrix A, and provides
error bounds on the solution.
Syntax
Fortran 77:
call ssysvx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr,
berr, work, lwork, iwork, info )
call dsysvx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr,
berr, work, lwork, iwork, info )
call csysvx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr,
berr, work, lwork, rwork, info )
call zsysvx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr,
berr, work, lwork, rwork, info )
Fortran 95:
call sysvx( a, b, x [,uplo] [,af] [,ipiv] [,fact] [,ferr] [,berr] [,rcond] [,info] )
C:
lapack_int LAPACKE_ssysvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const float* a, lapack_int lda, float* af, lapack_int ldaf,
lapack_int* ipiv, const float* b, lapack_int ldb, float* x, lapack_int ldx, float*
rcond, float* ferr, float* berr );
lapack_int LAPACKE_dsysvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const double* a, lapack_int lda, double* af, lapack_int ldaf,
lapack_int* ipiv, const double* b, lapack_int ldb, double* x, lapack_int ldx, double*
rcond, double* ferr, double* berr );
LAPACK Routines: Linear Equations 3
631
lapack_int LAPACKE_csysvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const lapack_complex_float* a, lapack_int lda, lapack_complex_float*
af, lapack_int ldaf, lapack_int* ipiv, const lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* x, lapack_int ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_zsysvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const lapack_complex_double* a, lapack_int lda, lapack_complex_double*
af, lapack_int ldaf, lapack_int* ipiv, const lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* x, lapack_int ldx, double* rcond, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the diagonal pivoting factorization to compute the solution to a real or complex system of
linear equations A*X = B, where A is a n-by-n symmetric matrix, the columns of matrix B are individual
right-hand sides, and the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?sysvx performs the following steps:
1. If fact = 'N', the diagonal pivoting method is used to factor the matrix A. The form of the factorization
is A = U*D*UT or A = L*D*LT, where U (or L) is a product of permutation and unit upper (lower)
triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
2. If some di,i= 0, so that D is exactly singular, then the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the
condition number is less than machine precision, info = n+1 is returned as a warning, but the routine
still goes on to solve for X and compute error bounds as described below.
3. The system of equations is solved for X using the factored form of A.
4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F' or 'N'.
Specifies whether or not the factored form of the matrix A has been
supplied on entry.
If fact = 'F': on entry, af and ipiv contain the factored form of A.
Arrays a, af, and ipiv will not be modified.
If fact = 'N', the matrix A will be copied to af and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
3 Intel® Math Kernel Library Reference Manual
632
a, af, b, work REAL for ssysvx
DOUBLE PRECISION for dsysvx
COMPLEX for csysvx
DOUBLE COMPLEX for zsysvx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the upper or the lower triangular part of the
symmetric matrix A (see uplo). The second dimension of a must be at
least max(1,n).
The array af is an input argument if fact = 'F'. It contains he block
diagonal matrix D and the multipliers used to obtain the factor U or L
from the factorization A = U*D*U**T orA = L*D*L**T as computed
by ?sytrf. The second dimension of af must be at least max(1,n).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1, nrhs).
work(*) is a workspace array, dimension at least max(1,lwork).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The array ipiv is an input
argument if fact = 'F'. It contains details of the interchanges and
the block structure of D, as determined by ?sytrf.
If ipiv(i) = k > 0, then dii is a 1-by-1 diagonal block, and the ith
row and column of A was interchanged with the k-th row and
column.
If uplo = 'U' and ipiv(i) = ipiv(i-1) = -m < 0, then D has a
2-by-2 block in rows/columns i and i-1, and (i-1)-th row and
column of A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) = ipiv(i+1) = -m < 0, then D has a
2-by-2 block in rows/columns i and i+1, and (i+1)-th row and
column of A was interchanged with the m-th row and column.
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,
n).
lwork INTEGER. The size of the work array.
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the
first entry of the work array, and no error message related to lwork is
issued by xerbla. See Application Notes below for details and for the
suggested value of lwork.
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in
real flavors only.
rwork REAL for csysvx;
DOUBLE PRECISION for zsysvx.
Workspace array, DIMENSION at least max(1, n); used in complex
flavors only.
Output Parameters
x REAL for ssysvx
DOUBLE PRECISION for dsysvx
LAPACK Routines: Linear Equations 3
633
COMPLEX for csysvx
DOUBLE COMPLEX for zsysvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X to the system of equations. The second dimension of x must be at
least max(1,nrhs).
af, ipiv These arrays are output arguments if fact = 'N'.
See the description of af, ipiv in Input Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal condition number of the matrix A. If
rcond is less than the machine precision (in particular, if rcond = 0),
the matrix is singular to working precision. This condition is indicated
by a return code of info > 0.
ferr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x(j) (the j-th column of
the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
largest element in x(j). The estimate is as reliable as the estimate
for rcond, and is almost always a slight overestimate of the true
error.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
work(1) If info=0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent
runs.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, then dii is exactly zero. The factorization
has been completed, but the block diagonal matrix D is exactly
singular, so the solution and error bounds could not be computed;
rcond = 0 is returned.
If info = i, and i = n + 1, then D is nonsingular, but rcond is less
than machine precision, meaning that the matrix is singular to
working precision. Nevertheless, the solution and error bounds are
computed because there are a number of situations where the
computed solution can be more accurate than the value of rcond
would suggest.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine sysvx interface are as follows:
3 Intel® Math Kernel Library Reference Manual
634
a Holds the matrix A of size (n,n).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
af Holds the matrix AF of size (n,n).
ipiv Holds the vector of length n.
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
fact Must be 'N' or 'F'. The default value is 'N'. If fact = 'F', then
both arguments af and ipiv must be present; otherwise, an error is
returned.
Application Notes
The value of lwork must be at least max(1,m*n), where for real flavors m = 3 and for complex flavors m =
2. For better performance, try using lwork = max(1, m*n, n*blocksize), where blocksize is the
optimal block size for ?sytrf.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
?sysvxx
Uses extra precise iterative refinement to compute the
solution to the system of linear equations with a
symmetric indefinite matrix A applying the diagonal
pivoting factorization.
Syntax
Fortran 77:
call ssysvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx,
rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
iwork, info )
call dsysvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx,
rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
iwork, info )
call csysvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx,
rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
rwork, info )
LAPACK Routines: Linear Equations 3
635
call zsysvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx,
rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
rwork, info )
C:
lapack_int LAPACKE_ssysvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, float* a, lapack_int lda, float* af, lapack_int ldaf, lapack_int*
ipiv, char* equed, float* s, float* b, lapack_int ldb, float* x, lapack_int ldx,
float* rcond, float* rpvgrw, float* berr, lapack_int n_err_bnds, float* err_bnds_norm,
float* err_bnds_comp, lapack_int nparams, const float* params );
lapack_int LAPACKE_dsysvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, double* a, lapack_int lda, double* af, lapack_int ldaf, lapack_int*
ipiv, char* equed, double* s, double* b, lapack_int ldb, double* x, lapack_int ldx,
double* rcond, double* rpvgrw, double* berr, lapack_int n_err_bnds, double*
err_bnds_norm, double* err_bnds_comp, lapack_int nparams, const double* params );
lapack_int LAPACKE_csysvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_float* a, lapack_int lda, lapack_complex_float* af,
lapack_int ldaf, lapack_int* ipiv, char* equed, float* s, lapack_complex_float* b,
lapack_int ldb, lapack_complex_float* x, lapack_int ldx, float* rcond, float* rpvgrw,
float* berr, lapack_int n_err_bnds, float* err_bnds_norm, float* err_bnds_comp,
lapack_int nparams, const float* params );
lapack_int LAPACKE_zsysvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_double* a, lapack_int lda, lapack_complex_double* af,
lapack_int ldaf, lapack_int* ipiv, char* equed, double* s, lapack_complex_double* b,
lapack_int ldb, lapack_complex_double* x, lapack_int ldx, double* rcond, double*
rpvgrw, double* berr, lapack_int n_err_bnds, double* err_bnds_norm, double*
err_bnds_comp, lapack_int nparams, const double* params );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the diagonal pivoting factorization A=UT*U (real flavors) / A=UH*U (complex flavors) or
A=L*LT (real flavors) / A=L*LH (complex flavors) to compute the solution to a real or complex system of
linear equations A*X = B, where A is an n-by-n real symmetric/Hermitian matrix, the columns of matrix B
are individual right-hand sides, and the columns of X are the corresponding solutions.
Both normwise and maximum componentwise error bounds are also provided on request. The routine returns
a solution with a small guaranteed error (O(eps), where eps is the working machine precision) unless the
matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers are also
calculated and returned.
The routine accepts user-provided factorizations and equilibration factors; see definitions of the fact and
equed options. Solving with refinement and using a factorization from a previous call of the routine also
produces a solution with O(eps) errors or warnings but that may not be true for general user-provided
factorizations and equilibration factors if they differ from what the routine would itself produce.
The routine ?sysvxx performs the following steps:
1. If fact = 'E', scaling factors are computed to equilibrate the system:
diag(s)*A*diag(s) *inv(diag(s))*X = diag(s)*B
3 Intel® Math Kernel Library Reference Manual
636
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration
is used, A is overwritten by diag(s)*A*diag(s) and B by diag(s)*B.
2. If fact = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact =
'E') as
A = U*D*UT, if uplo = 'U',
or A = L*D*LT, if uplo = 'L',
where U or L is a product of permutation and unit upper (lower) triangular matrices, and D is a symmetric
and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
3. If some D(i,i)=0, so that D is exactly singular, the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A (see the rcond parameter). If
the reciprocal of the condition number is less than machine precision, the routine still goes on to solve for
X and compute error bounds.
4. The system of equations is solved for X using the factored form of A.
5. By default, unless params(la_linrx_itref_i) is set to zero, the routine applies iterative refinement to
get a small error and error bounds. Refinement calculates the residual to at least twice the working
precision.
6. If equilibration was used, the matrix X is premultiplied by diag(r) so that it solves the original system
before equilibration.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether or not the factored form of the matrix A is supplied on
entry, and if not, whether the matrix A should be equilibrated before it is
factored.
If fact = 'F', on entry, af and ipiv contain the factored form of A. If
equed is not 'N', the matrix A has been equilibrated with scaling factors
given by s. Parameters a, af, and ipiv are not modified.
If fact = 'N', the matrix A will be copied to af and factored.
If fact = 'E', the matrix A will be equilibrated, if necessary, copied to af
and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns of the
matrices B and X; nrhs = 0.
a, af, b, work REAL for ssysvxx
DOUBLE PRECISION for dsysvxx
COMPLEX for csysvxx
DOUBLE COMPLEX for zsysvxx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the symmetric matrix A as specified by uplo. If uplo
= 'U', the leading n-by-n upper triangular part of a contains the upper
triangular part of the matrix A and the strictly lower triangular part of a is
not referenced. If uplo = 'L', the leading n-by-n lower triangular part of a
LAPACK Routines: Linear Equations 3
637
contains the lower triangular part of the matrix A and the strictly upper
triangular part of a is not referenced. The second dimension of a must be at
least max(1,n).
The array af is an input argument if fact = 'F'. It contains the block
diagonal matrix D and the multipliers used to obtain the factor U and L from
the factorization A = U*D*U**T or A = L*D*L**T as computed by ?
sytrf. The second dimension of af must be at least max(1,n).
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,4*n) for real flavors, and at least max(1,2*n) for complex flavors.
lda INTEGER. The leading dimension of the array a; lda = max(1,n).
ldaf INTEGER. The leading dimension of the array af; ldaf = max(1,n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The array ipiv is an input argument
if fact = 'F'. It contains details of the interchanges and the block
structure of D as determined by ?sytrf. If ipiv(k) > 0, rows and columns
k and ipiv(k) were intercanaged and D(k,k) is a 1-by-1 diagonal block.
If ipiv = 'U' and ipiv(k) = ipiv(k-1) < 0, rows and columns k-1
and -ipiv(k) were interchanged and D(k-1:k, k-1:k) is a 2-by-2
diagonal block.
If ipiv = 'L' and ipiv(k) = ipiv(k+1) < 0, rows and columns k+1
and -ipiv(k) were interchanged and D(k:k+1, k:k+1) is a 2-by-2
diagonal block.
equed CHARACTER*1. Must be 'N' or 'Y'.
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
If equed = 'N', no equilibration was done (always true if fact = 'N').
if equed = 'Y', both row and column equilibration was done, that is, A has
been replaced by diag(s)*A*diag(s).
s REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (n). The array s contains the scale factors for A. If equed
= 'Y', A is multiplied on the left and right by diag(s).
This array is an input argument if fact = 'F' only; otherwise it is an
output argument.
If fact = 'F' and equed = 'Y', each element of s must be positive.
Each element of s should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
ldx INTEGER. The leading dimension of the output array x; ldx = max(1, n).
n_err_bnds INTEGER. Number of error bounds to return for each right hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in the Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
3 Intel® Math Kernel Library Reference Manual
638
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry is filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0 (for single precision flavors), 1.0D+0 (for
double precision flavors).
=0.0 No refinement is performed and no error bounds
are computed.
=1.0 Use the extra-precise refinement algorithm.
(Other values are reserved for futute use.)
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for fefinement.
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in real
flavors only.
rwork REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Workspace array, DIMENSION at least max(1, 3*n); used in complex
flavors only.
Output Parameters
x REAL for ssysvxx
DOUBLE PRECISION for dsysvxx
COMPLEX for csysvxx
DOUBLE COMPLEX for zsysvxx.
Array, DIMENSION (ldx,nrhs).
If info = 0, the array x contains the solution n-by-nrhs matrix X to the
original system of equations. Note that A and B are modified on exit if
equed ? 'N', and the solution to the equilibrated system is:
inv(diag(s))*X.
a If fact = 'E' and equed = 'Y', overwritten by diag(s)*A*diag(s).
af If fact = 'N', af is an output argument and on exit returns the block
diagonal matrix D and the multipliers used to obtain the factor U or L from
the factorization A = U*D*U**T or A = L*D*L**T.
b If equed = 'N', B is not modified.
LAPACK Routines: Linear Equations 3
639
If equed = 'Y', B is overwritten by diag(s)*B.
s This array is an output argument if fact ? 'F'. Each element of this array
is a power of the radix. See the description of s in Input Arguments section.
rcond REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
rpvgrw REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Contains the reciprocal pivot growth factor norm(A)/norm(U). The max
absolute element norm is used. If this is much less than 1, the stability of
the LU factorization of the (equlibrated) matrix A could be poor. This also
means that the solution X, estimated condition numbers, and error bounds
could be unreliable. If factorization fails with 0 < info = n, this parameter
contains the reciprocal pivot growth factor for the leading info columns of
A.
berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
err_bnds_norm REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
3 Intel® Math Kernel Library Reference Manual
640
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for single
precision flavors and sqrt(n)*dlamch(e) for
double precision flavors.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for single precision flavors and
sqrt(n)*dlamch(e) for double precision
flavors. This error bound should only be trusted
if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
LAPACK Routines: Linear Equations 3
641
sqrt(n)*slamch(e) for single precision flavors
and sqrt(n)*dlamch(e) for double precision
flavors to determine if the error estimate is
"guaranteed". These reciprocal condition
numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
ipiv If fact = 'N', ipiv is an output argument and on exit contains details of
the interchanges and the block structure D, as determined by ssytrf for
single precision flavors and dsytrf for double precision flavors.
equed If fact ? 'F', then equed is an output argument. It specifies the form of
equilibration that was done (see the description of equed in Input
Arguments section).
params If an entry is less than 0.0, that entry is filled with the default value used
for that parameter, otherwise the entry is not modified.
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
?hesv
Computes the solution to the system of linear
equations with a Hermitian matrix A and multiple
right-hand sides.
Syntax
Fortran 77:
call chesv( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info )
call zhesv( uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info )
Fortran 95:
call hesv( a, b [,uplo] [,ipiv] [,info] )
3 Intel® Math Kernel Library Reference Manual
642
C:
lapack_int LAPACKE_hesv( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
* a, lapack_int lda, lapack_int* ipiv, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the complex system of linear equations A*X = B, where A is an n-by-n symmetric
matrix, the columns of matrix B are individual right-hand sides, and the columns of X are the corresponding
solutions.
The diagonal pivoting method is used to factor A as A = U*D*UH or A = L*D*LH, where U (or L) is a product
of permutation and unit upper (lower) triangular matrices, and D is Hermitian and block diagonal with 1-by-1
and 2-by-2 diagonal blocks.
The factored form of A is then used to solve the system of equations A*X = B.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored and
how A is factored:
If uplo = 'U', the array a stores the upper triangular part of the
matrix A, and A is factored as U*D*UH.
If uplo = 'L', the array a stores the lower triangular part of the
matrix A, and A is factored as L*D*LH.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
a, b, work COMPLEX for chesv
DOUBLE COMPLEX for zhesv.
Arrays: a(lda,*), b(ldb,*), work(*). The array a contains the
upper or the lower triangular part of the Hermitian matrix A (see
uplo). The second dimension of a must be at least max(1, n).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
work is a workspace array, dimension at least max(1,lwork).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
lwork INTEGER. The size of the work array (lwork = 1).
LAPACK Routines: Linear Equations 3
643
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the
first entry of the work array, and no error message related to lwork is
issued by xerbla. See Application Notes below for details and for the
suggested value of lwork.
Output Parameters
a If info = 0, a is overwritten by the block-diagonal matrix D and the
multipliers used to obtain the factor U (or L) from the factorization of
A as computed by ?hetrf.
b If info = 0, b is overwritten by the solution matrix X.
ipiv INTEGER.
Array, DIMENSION at least max(1, n). Contains details of the
interchanges and the block structure of D, as determined by ?hetrf.
If ipiv(i) = k > 0, then dii is a 1-by-1 diagonal block, and the ith
row and column of A was interchanged with the k-th row and
column.
If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i-1, and (i-1)-th row and column
of A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i+1, and (i+1)-th row and column
of A was interchanged with the m-th row and column.
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent
runs.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, dii is 0. The factorization has been completed, but D is
exactly singular, so the solution could not be computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hesv interface are as follows:
a Holds the matrix A of size (n,n).
b Holds the matrix B of size (n,nrhs).
ipiv Holds the vector of length n.
uplo Must be 'U' or 'L'. The default value is 'U'.
Application Notes
For better performance, try using lwork = n*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
3 Intel® Math Kernel Library Reference Manual
644
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
?hesvx
Uses the diagonal pivoting factorization to compute
the solution to the complex system of linear equations
with a Hermitian matrix A, and provides error bounds
on the solution.
Syntax
Fortran 77:
call chesvx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr,
berr, work, lwork, rwork, info )
call zhesvx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr,
berr, work, lwork, rwork, info )
Fortran 95:
call hesvx( a, b, x [,uplo] [,af] [,ipiv] [,fact] [,ferr] [,berr] [,rcond] [,info] )
C:
lapack_int LAPACKE_chesvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const lapack_complex_float* a, lapack_int lda, lapack_complex_float*
af, lapack_int ldaf, lapack_int* ipiv, const lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* x, lapack_int ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_zhesvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const lapack_complex_double* a, lapack_int lda, lapack_complex_double*
af, lapack_int ldaf, lapack_int* ipiv, const lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* x, lapack_int ldx, double* rcond, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the diagonal pivoting factorization to compute the solution to a complex system of linear
equations A*X = B, where A is an n-by-n Hermitian matrix, the columns of matrix B are individual right-hand
sides, and the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?hesvx performs the following steps:
LAPACK Routines: Linear Equations 3
645
1. If fact = 'N', the diagonal pivoting method is used to factor the matrix A. The form of the factorization
is A = U*D*UH or A = L*D*LH, where U (or L) is a product of permutation and unit upper (lower)
triangular matrices, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
2. If some di,i = 0, so that D is exactly singular, then the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the
condition number is less than machine precision, info = n+1 is returned as a warning, but the routine
still goes on to solve for X and compute error bounds as described below.
3. The system of equations is solved for X using the factored form of A.
4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F' or 'N'.
Specifies whether or not the factored form of the matrix A has been
supplied on entry.
If fact = 'F': on entry, af and ipiv contain the factored form of A.
Arrays a, af, and ipiv are not modified.
If fact = 'N', the matrix A is copied to af and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored and
how A is factored:
If uplo = 'U', the array a stores the upper triangular part of the
Hermitian matrix A, and A is factored as U*D*UH.
If uplo = 'L', the array a stores the lower triangular part of the
Hermitian matrix A; A is factored as L*D*LH.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
a, af, b, work COMPLEX for chesvx
DOUBLE COMPLEX for zhesvx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
The array a contains the upper or the lower triangular part of the
Hermitian matrix A (see uplo). The second dimension of a must be at
least max(1,n).
The array af is an input argument if fact = 'F'. It contains he block
diagonal matrix D and the multipliers used to obtain the factor U or L
from the factorization A = U*D*UH or A = L*D*LH as computed by ?
hetrf. The second dimension of af must be at least max(1,n).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1, nrhs).
work(*) is a workspace array of dimension at least max(1, lwork).
lda INTEGER. The leading dimension of a; lda = max(1, n).
ldaf INTEGER. The leading dimension of af; ldaf = max(1, n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER.
3 Intel® Math Kernel Library Reference Manual
646
Array, DIMENSION at least max(1, n). The array ipiv is an input
argument if fact = 'F'. It contains details of the interchanges and
the block structure of D, as determined by ?hetrf.
If ipiv(i) = k > 0, then dii is a 1-by-1 diagonal block, and the ith
row and column of A was interchanged with the k-th row and
column.
If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i-1, and (i-1)-th row and column
of A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i+1, and (i+1)-th row and column
of A was interchanged with the m-th row and column.
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,
n).
lwork INTEGER. The size of the work array.
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the
first entry of the work array, and no error message related to lwork is
issued by xerbla. See Application Notes below for details and for the
suggested value of lwork.
rwork REAL for chesvx
DOUBLE PRECISION for zhesvx.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x COMPLEX for chesvx
DOUBLE COMPLEX for zhesvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X to the system of equations. The second dimension of x must be at
least max(1,nrhs).
af, ipiv These arrays are output arguments if fact = 'N'. See the
description of af, ipiv in Input Arguments section.
rcond REAL for chesvx
DOUBLE PRECISION for zhesvx.
An estimate of the reciprocal condition number of the matrix A. If
rcond is less than the machine precision (in particular, if rcond = 0),
the matrix is singular to working precision. This condition is indicated
by a return code of info > 0.
ferr REAL for chesvx
DOUBLE PRECISION for zhesvx.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x(j) (the j-th column of
the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
largest element in x(j). The estimate is as reliable as the estimate
for rcon, and is almost always a slight overestimate of the true error.
berr REAL for chesvx
DOUBLE PRECISION for zhesvx.
LAPACK Routines: Linear Equations 3
647
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent
runs.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, then dii is exactly zero. The factorization
has been completed, but the block diagonal matrix D is exactly
singular, so the solution and error bounds could not be computed;
rcond = 0 is returned.
If info = i, and i = n + 1, then D is nonsingular, but rcond is less
than machine precision, meaning that the matrix is singular to
working precision. Nevertheless, the solution and error bounds are
computed because there are a number of situations where the
computed solution can be more accurate than the value of rcond
would suggest.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hesvx interface are as follows:
a Holds the matrix A of size (n,n).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
af Holds the matrix AF of size (n,n).
ipiv Holds the vector of length n.
ferr Holds the vector of length (nrhs).
berr Holds the vector of length (nrhs).
uplo Must be 'U' or 'L'. The default value is 'U'.
fact Must be 'N' or 'F'. The default value is 'N'. If fact = 'F', then
both arguments af and ipiv must be present; otherwise, an error is
returned.
Application Notes
The value of lwork must be at least 2*n. For better performance, try using lwork = n*blocksize, where
blocksize is the optimal block size for ?hetrf.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
3 Intel® Math Kernel Library Reference Manual
648
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
?hesvxx
Uses extra precise iterative refinement to compute the
solution to the system of linear equations with a
Hermitian indefinite matrix A applying the diagonal
pivoting factorization.
Syntax
Fortran 77:
call chesvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx,
rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
rwork, info )
call zhesvxx( fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx,
rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work,
rwork, info )
C:
lapack_int LAPACKE_chesvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_float* a, lapack_int lda, lapack_complex_float* af,
lapack_int ldaf, lapack_int* ipiv, char* equed, float* s, lapack_complex_float* b,
lapack_int ldb, lapack_complex_float* x, lapack_int ldx, float* rcond, float* rpvgrw,
float* berr, lapack_int n_err_bnds, float* err_bnds_norm, float* err_bnds_comp,
lapack_int nparams, const float* params );
lapack_int LAPACKE_zhesvxx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, lapack_complex_double* a, lapack_int lda, lapack_complex_double* af,
lapack_int ldaf, lapack_int* ipiv, char* equed, double* s, lapack_complex_double* b,
lapack_int ldb, lapack_complex_double* x, lapack_int ldx, double* rcond, double*
rpvgrw, double* berr, lapack_int n_err_bnds, double* err_bnds_norm, double*
err_bnds_comp, lapack_int nparams, const double* params );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the diagonal pivoting factorization to compute the solution to a complex/double complex
system of linear equations A*X = B, where A is an n-by-n Hermitian matrix, the columns of matrix B are
individual right-hand sides, and the columns of X are the corresponding solutions.
Both normwise and maximum componentwise error bounds are also provided on request. The routine returns
a solution with a small guaranteed error (O(eps), where eps is the working machine precision) unless the
matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers are also
calculated and returned.
The routine accepts user-provided factorizations and equilibration factors; see definitions of the fact and
equed options. Solving with refinement and using a factorization from a previous call of the routine also
produces a solution with O(eps) errors or warnings but that may not be true for general user-provided
factorizations and equilibration factors if they differ from what the routine would itself produce.
LAPACK Routines: Linear Equations 3
649
The routine ?hesvxx performs the following steps:
1. If fact = 'E', scaling factors are computed to equilibrate the system:
diag(s)*A*diag(s) *inv(diag(s))*X = diag(s)*B
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration
is used, A is overwritten by diag(s)*A*diag(s) and B by diag(s)*B.
2. If fact = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact =
'E') as
A = U*D*UT, if uplo = 'U',
or A = L*D*LT, if uplo = 'L',
where U or L is a product of permutation and unit upper (lower) triangular matrices, and D is a symmetric
and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
3. If some D(i,i)=0, so that D is exactly singular, the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A (see the rcond parameter). If
the reciprocal of the condition number is less than machine precision, the routine still goes on to solve for
X and compute error bounds.
4. The system of equations is solved for X using the factored form of A.
5. By default, unless params(la_linrx_itref_i) is set to zero, the routine applies iterative refinement to
get a small error and error bounds. Refinement calculates the residual to at least twice the working
precision.
6. If equilibration was used, the matrix X is premultiplied by diag(r) so that it solves the original system
before equilibration.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F', 'N', or 'E'.
Specifies whether or not the factored form of the matrix A is supplied on
entry, and if not, whether the matrix A should be equilibrated before it is
factored.
If fact = 'F', on entry, af and ipiv contain the factored form of A. If
equed is not 'N', the matrix A has been equilibrated with scaling factors
given by s. Parameters a, af, and ipiv are not modified.
If fact = 'N', the matrix A will be copied to af and factored.
If fact = 'E', the matrix A will be equilibrated, if necessary, copied to af
and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The number of linear equations; the order of the matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides; the number of columns of the
matrices B and X; nrhs = 0.
a, af, b, work COMPLEX for chesvxx
DOUBLE COMPLEX for zhesvxx.
Arrays: a(lda,*), af(ldaf,*), b(ldb,*), work(*).
3 Intel® Math Kernel Library Reference Manual
650
The array a contains the Hermitian matrix A as specified by uplo. If uplo =
'U', the leading n-by-n upper triangular part of a contains the upper
triangular part of the matrix A and the strictly lower triangular part of a is
not referenced. If uplo = 'L', the leading n-by-n lower triangular part of a
contains the lower triangular part of the matrix A and the strictly upper
triangular part of a is not referenced. The second dimension of a must be at
least max(1,n).
The array af is an input argument if fact = 'F'. It contains the block
diagonal matrix D and the multipliers used to obtain the factor U and L from
the factorization A = U*D*U**T or A = L*D*L**T as computed by ?
hetrf. The second dimension of af must be at least max(1,n).
The array b contains the matrix B whose columns are the right-hand sides
for the systems of equations. The second dimension of b must be at least
max(1,nrhs).
work(*) is a workspace array. The dimension of work must be at least
max(1,2*n).
lda INTEGER. The leading dimension of the array a; lda = max(1,n).
ldaf INTEGER. The leading dimension of the array af; ldaf = max(1,n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The array ipiv is an input argument
if fact = 'F'. It contains details of the interchanges and the block
structure of D as determined by ?sytrf. If ipiv(k) > 0, rows and columns
k and ipiv(k) were intercanaged and D(k,k) is a 1-by-1 diagonal block.
If ipiv = 'U' and ipiv(k) = ipiv(k-1) < 0, rows and columns k-1
and -ipiv(k) were interchanged and D(k-1:k, k-1:k) is a 2-by-2
diagonal block.
If ipiv = 'L' and ipiv(k) = ipiv(k+1) < 0, rows and columns k+1
and -ipiv(k) were interchanged and D(k:k+1, k:k+1) is a 2-by-2
diagonal block.
equed CHARACTER*1. Must be 'N' or 'Y'.
equed is an input argument if fact = 'F'. It specifies the form of
equilibration that was done:
If equed = 'N', no equilibration was done (always true if fact = 'N').
if equed = 'Y', both row and column equilibration was done, that is, A has
been replaced by diag(s)*A*diag(s).
s REAL for chesvxx
DOUBLE PRECISION for zhesvxx.
Array, DIMENSION (n). The array s contains the scale factors for A. If equed
= 'Y', A is multiplied on the left and right by diag(s).
This array is an input argument if fact = 'F' only; otherwise it is an
output argument.
If fact = 'F' and equed = 'Y', each element of s must be positive.
Each element of s should be a power of the radix to ensure a reliable
solution and error estimates. Scaling by powers of the radix does not cause
rounding errors unless the result underflows or overflows. Rounding errors
during scaling lead to refining with a matrix that is not equivalent to the
input matrix, producing error estimates that may not be reliable.
ldb INTEGER. The leading dimension of the array b; ldb = max(1, n).
ldx INTEGER. The leading dimension of the output array x; ldx = max(1, n).
LAPACK Routines: Linear Equations 3
651
n_err_bnds INTEGER. Number of error bounds to return for each right hand side and
each type (normwise or componentwise). See err_bnds_norm and
err_bnds_comp descriptions in the Output Arguments section below.
nparams INTEGER. Specifies the number of parameters set in params. If = 0, the
params array is never referenced and default values are used.
params REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Array, DIMENSION nparams. Specifies algorithm parameters. If an entry is
less than 0.0, that entry is filled with the default value used for that
parameter. Only positions up to nparams are accessed; defaults are used
for higher-numbered parameters. If defaults are acceptable, you can pass
nparams = 0, which prevents the source code from accessing the params
argument.
params(la_linrx_itref_i = 1) : Whether to perform iterative
refinement or not. Default: 1.0 (for single precision flavors), 1.0D+0 (for
double precision flavors).
=0.0 No refinement is performed and no error bounds
are computed.
=1.0 Use the extra-precise refinement algorithm.
(Other values are reserved for futute use.)
params(la_linrx_ithresh_i = 2) : Maximum number of resudual
computations allowed for fefinement.
Default 10
Aggressive Set to 100 to permit convergence using
approximate factorizations or factorizations
other than LU. If the factorization uses a
technique other than Gaussian elimination, the
quarantees in err_bnds_norm and
err_bnds_comp may no longer be trustworthy.
params(la_linrx_cwise_i = 3) : Flag determining if the code will
attempt to find a solution with a small componentwise relative error in the
double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0
(attempt componentwise convergence).
rwork REAL for chesvxx
DOUBLE PRECISION for zhesvxx.
Workspace array, DIMENSION at least max(1, 3*n); used in complex
flavors only.
Output Parameters
x COMPLEX for chesvxx
DOUBLE COMPLEX for zhesvxx.
Array, DIMENSION (ldx,nrhs).
If info = 0, the array x contains the solution n-by-nrhs matrix X to the
original system of equations. Note that A and B are modified on exit if
equed ? 'N', and the solution to the equilibrated system is:
inv(diag(s))*X.
a If fact = 'E' and equed = 'Y', overwritten by diag(s)*A*diag(s).
af If fact = 'N', af is an output argument and on exit returns the block
diagonal matrix D and the multipliers used to obtain the factor U or L from
the factorization A = U*D*U**T or A = L*D*L**T.
3 Intel® Math Kernel Library Reference Manual
652
b If equed = 'N', B is not modified.
If equed = 'Y', B is overwritten by diag(s)*B.
s This array is an output argument if fact ? 'F'. Each element of this array
is a power of the radix. See the description of s in Input Arguments section.
rcond REAL for chesvxx
DOUBLE PRECISION for zhesvxx.
Reciprocal scaled condition number. An estimate of the reciprocal Skeel
condition number of the matrix A after equilibration (if done). If rcond is
less than the machine precision, in particular, if rcond = 0, the matrix is
singular to working precision. Note that the error may still be small even if
this number is very small and the matrix appears ill-conditioned.
rpvgrw REAL for chesvxx
DOUBLE PRECISION for zhesvxx.
Contains the reciprocal pivot growth factor norm(A)/norm(U). The max
absolute element norm is used. If this is much less than 1, the stability of
the LU factorization of the (equlibrated) matrix A could be poor. This also
means that the solution X, estimated condition numbers, and error bounds
could be unreliable. If factorization fails with 0 < info = n, this parameter
contains the reciprocal pivot growth factor for the leading info columns of
A.
berr REAL for chesvxx
DOUBLE PRECISION for zhesvxx.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the smallest
relative change in any element of A or B that makes x(j) an exact solution.
err_bnds_norm REAL for chesvxx
DOUBLE PRECISION for zhesvxx.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the i-th solution vector
The array is indexed by the type of error information as described below.
There are currently up to three pieces of information returned.
The first index in err_bnds_norm(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_norm(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for chesvxx and
sqrt(n)*dlamch(e) for zhesvxx.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for chesvxx and sqrt(n)*dlamch(e) for
zhesvxx. This error bound should only be
trusted if the previous boolean is true.
LAPACK Routines: Linear Equations 3
653
err=3 Reciprocal condition number. Estimated
normwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for chesvxx and
sqrt(n)*dlamch(e)for zhesvxx to determine if
the error estimate is "guaranteed". These
reciprocal condition numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*a, where s scales each row by a power
of the radix so all absolute row sums of z are
approximately 1.
err_bnds_comp REAL for chesvxx
DOUBLE PRECISION for zhesvxx.
Array, DIMENSION (nrhs,n_err_bnds). For each right-hand side, contains
information about various error bounds and condition numbers
corresponding to the componentwise relative error, which is defined as
follows:
Componentwise relative error in the i-th solution vector:
The array is indexed by the right-hand side i, on which the componentwise
relative error depends, and by the type of error information as described
below. There are currently up to three pieces of information returned for
each right-hand side. If componentwise accuracy is nit requested
(params(3) = 0.0), then err_bnds_comp is not accessed. If n_err_bnds
< 3, then at most the first (:,n_err_bnds) entries are returned.
The first index in err_bnds_comp(i,:) corresponds to the i-th right-hand
side.
The second index in err_bnds_comp(:,err) contains the follwoing three
fields:
err=1 "Trust/don't trust" boolean. Trust the answer if
the reciprocal condition number is less than the
threshold sqrt(n)*slamch(e) for chesvxx and
sqrt(n)*dlamch(e) for zhesvxx.
err=2 "Guaranteed" error bpound. The estimated
forward error, almost certainly within a factor of
10 of the true error so long as the next entry is
greater than the threshold sqrt(n)*slamch(e)
for chesvxx and sqrt(n)*dlamch(e) for
zhesvxx. This error bound should only be
trusted if the previous boolean is true.
err=3 Reciprocal condition number. Estimated
componentwise reciprocal condition number.
Compared with the threshold
sqrt(n)*slamch(e) for chesvxx and
sqrt(n)*dlamch(e) for zhesvxx to determine
if the error estimate is "guaranteed". These
3 Intel® Math Kernel Library Reference Manual
654
reciprocal condition numbers are 1/(norm(1/
z,inf)*norm(z,inf)) for some appropriately
scaled matrix Z.
Let z=s*(a*diag(x)), where x is the solution
for the current right-hand side and s scales each
row of a*diag(x) by a power of the radix so all
absolute row sums of z are approximately 1.
ipiv If fact = 'N', ipiv is an output argument and on exit contains details of
the interchanges and the block structure D, as determined by ssytrf for
single precision flavors and dsytrf for double precision flavors.
equed If fact ? 'F', then equed is an output argument. It specifies the form of
equilibration that was done (see the description of equed in Input
Arguments section).
params If an entry is less than 0.0, that entry is filled with the default value used
for that parameter, otherwise the entry is not modified.
info INTEGER. If info = 0, the execution is successful. The solution to every
right-hand side is guaranteed.
If info = -i, the i-th parameter had an illegal value.
If 0 < info = n: U(info,info) is exactly zero. The factorization has been
completed, but the factor U is exactly singular, so the solution and error
bounds could not be computed; rcond = 0 is returned.
If info = n+j: The solution corresponding to the j-th right-hand side is
not guaranteed. The solutions corresponding to other right-hand sides k
with k > j may not be guaranteed as well, but only the first such right-hand
side is reported. If a small componentwise error is not requested
params(3) = 0.0, then the j-th right-hand side is the first with a
normwise error bound that is not guaranteed (the smallest j such that
err_bnds_norm(j,1) = 0.0 or err_bnds_comp(j,1) = 0.0. See the
definition of err_bnds_norm(;,1) and err_bnds_comp(;,1). To get
information about all of the right-hand sides, check err_bnds_norm or
err_bnds_comp.
?spsv
Computes the solution to the system of linear
equations with a real or complex symmetric matrix A
stored in packed format, and multiple right-hand
sides.
Syntax
Fortran 77:
call sspsv( uplo, n, nrhs, ap, ipiv, b, ldb, info )
call dspsv( uplo, n, nrhs, ap, ipiv, b, ldb, info )
call cspsv( uplo, n, nrhs, ap, ipiv, b, ldb, info )
call zspsv( uplo, n, nrhs, ap, ipiv, b, ldb, info )
Fortran 95:
call spsv( ap, b [,uplo] [,ipiv] [,info] )
LAPACK Routines: Linear Equations 3
655
C:
lapack_int LAPACKE_spsv( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
* ap, lapack_int* ipiv, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the real or complex system of linear equations A*X = B, where A is an n-by-n
symmetric matrix stored in packed format, the columns of matrix B are individual right-hand sides, and the
columns of X are the corresponding solutions.
The diagonal pivoting method is used to factor A as A = U*D*UT or A = L*D*LT, where U (or L) is a product
of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1
and 2-by-2 diagonal blocks.
The factored form of A is then used to solve the system of equations A*X = B.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
ap, b REAL for sspsv
DOUBLE PRECISION for dspsv
COMPLEX for cspsv
DOUBLE COMPLEX for zspsv.
Arrays: ap(*), b(ldb,*).
The dimension of ap must be at least max(1,n(n+1)/2). The array ap
contains the factor U or L, as specified by uplo, in packed storage
(see Matrix Storage Schemes).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
ap The block-diagonal matrix D and the multipliers used to obtain the
factor U (or L) from the factorization of A as computed by ?sptrf,
stored as a packed triangular matrix in the same storage format as A.
b If info = 0, b is overwritten by the solution matrix X.
ipiv INTEGER.
3 Intel® Math Kernel Library Reference Manual
656
Array, DIMENSION at least max(1, n). Contains details of the
interchanges and the block structure of D, as determined by ?sptrf.
If ipiv(i) = k > 0, then dii is a 1-by-1 block, and the i-th row
and column of A was interchanged with the k-th row and column.
If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i-1, and (i-1)-th row and column
of A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i+1, and (i+1)-th row and column
of A was interchanged with the m-th row and column.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, dii is 0. The factorization has been completed, but D is
exactly singular, so the solution could not be computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine spsv interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n,nrhs).
ipiv Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
?spsvx
Uses the diagonal pivoting factorization to compute
the solution to the system of linear equations with a
real or complex symmetric matrix A stored in packed
format, and provides error bounds on the solution.
Syntax
Fortran 77:
call sspsvx( fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
work, iwork, info )
call dspsvx( fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
work, iwork, info )
call cspsvx( fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
work, rwork, info )
call zspsvx( fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
work, rwork, info )
Fortran 95:
call spsvx( ap, b, x [,uplo] [,afp] [,ipiv] [,fact] [,ferr] [,berr] [,rcond] [,info] )
LAPACK Routines: Linear Equations 3
657
C:
lapack_int LAPACKE_sspsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const float* ap, float* afp, lapack_int* ipiv, const float* b,
lapack_int ldb, float* x, lapack_int ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_dspsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const double* ap, double* afp, lapack_int* ipiv, const double* b,
lapack_int ldb, double* x, lapack_int ldx, double* rcond, double* ferr, double* berr );
lapack_int LAPACKE_cspsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const lapack_complex_float* ap, lapack_complex_float* afp, lapack_int*
ipiv, const lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x,
lapack_int ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_zspsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const lapack_complex_double* ap, lapack_complex_double* afp,
lapack_int* ipiv, const lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* x, lapack_int ldx, double* rcond, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the diagonal pivoting factorization to compute the solution to a real or complex system of
linear equations A*X = B, where A is a n-by-n symmetric matrix stored in packed format, the columns of
matrix B are individual right-hand sides, and the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?spsvx performs the following steps:
1. If fact = 'N', the diagonal pivoting method is used to factor the matrix A. The form of the factorization
is A = U*D*UT orA = L*D*LT, where U (or L) is a product of permutation and unit upper (lower)
triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
2. If some di,i = 0, so that D is exactly singular, then the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the
condition number is less than machine precision, info = n+1 is returned as a warning, but the routine
still goes on to solve for X and compute error bounds as described below.
3. The system of equations is solved for X using the factored form of A.
4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F' or 'N'.
Specifies whether or not the factored form of the matrix A has been
supplied on entry.
If fact = 'F': on entry, afp and ipiv contain the factored form of
A. Arrays ap, afp, and ipiv are not modified.
3 Intel® Math Kernel Library Reference Manual
658
If fact = 'N', the matrix A is copied to afp and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored and
how A is factored:
If uplo = 'U', the array ap stores the upper triangular part of the
symmetric matrix A, and A is factored as U*D*UT.
If uplo = 'L', the array ap stores the lower triangular part of the
symmetric matrix A; A is factored as L*D*LT.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
ap, afp, b, work REAL for sspsvx
DOUBLE PRECISION for dspsvx
COMPLEX for cspsvx
DOUBLE COMPLEX for zspsvx.
Arrays: ap(*), afp(*), b(ldb,*), work(*).
The array ap contains the upper or lower triangle of the symmetric
matrix A in packed storage (see Matrix Storage Schemes).
The array afp is an input argument if fact = 'F'. It contains the
block diagonal matrix D and the multipliers used to obtain the factor U
or L from the factorization A = U*D*UT or A = L*D*LT as computed
by ?sptrf, in the same storage format as A.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
work(*) is a workspace array.
The dimension of arrays ap and afp must be at least max(1, n(n
+1)/2); the second dimension of b must be at least max(1,nrhs);
the dimension of work must be at least max(1,3*n) for real flavors
and max(1,2*n) for complex flavors.
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The array ipiv is an input
argument if fact = 'F'. It contains details of the interchanges and
the block structure of D, as determined by ?sptrf.
If ipiv(i) = k > 0, then dii is a 1-by-1 diagonal block, and the ith
row and column of A was interchanged with the k-th row and
column.
If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i-1, and (i-1)-th row and column
of A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i+1, and (i+1)-th row and column
of A was interchanged with the m-th row and column.
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,
n).
iwork INTEGER. Workspace array, DIMENSION at least max(1, n); used in
real flavors only.
rwork REAL for cspsvx
DOUBLE PRECISION for zspsvx.
LAPACK Routines: Linear Equations 3
659
Workspace array, DIMENSION at least max(1, n); used in complex
flavors only.
Output Parameters
x REAL for sspsvx
DOUBLE PRECISION for dspsvx
COMPLEX for cspsvx
DOUBLE COMPLEX for zspsvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X to the system of equations. The second dimension of x must be at
least max(1,nrhs).
afp, ipiv These arrays are output arguments if fact = 'N'. See the
description of afp, ipiv in Input Arguments section.
rcond REAL for single precision flavors.
DOUBLE PRECISION for double precision flavors.
An estimate of the reciprocal condition number of the matrix A. If
rcond is less than the machine precision (in particular, if rcond = 0),
the matrix is singular to working precision. This condition is indicated
by a return code of info > 0.
ferr, berr REAL for single precision flavors
DOUBLE PRECISION for double precision flavors.
Arrays, DIMENSION at least max(1, nrhs). Contain the componentwise
forward and relative backward errors, respectively, for each
solution vector.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, then dii is exactly zero. The factorization
has been completed, but the block diagonal matrix D is exactly
singular, so the solution and error bounds could not be computed;
rcond = 0 is returned.
If info = i, and i = n + 1, then D is nonsingular, but rcond is less
than machine precision, meaning that the matrix is singular to
working precision. Nevertheless, the solution and error bounds are
computed because there are a number of situations where the
computed solution can be more accurate than the value of rcond
would suggest.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine spsvx interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
afp Holds the array AF of size (n*(n+1)/2).
ipiv Holds the vector with the number of elements n.
ferr Holds the vector with the number of elements nrhs.
3 Intel® Math Kernel Library Reference Manual
660
berr Holds the vector with the number of elements nrhs.
uplo Must be 'U' or 'L'. The default value is 'U'.
fact Must be 'N' or 'F'. The default value is 'N'. If fact = 'F', then
both arguments af and ipiv must be present; otherwise, an error is
returned.
?hpsv
Computes the solution to the system of linear
equations with a Hermitian matrix A stored in packed
format, and multiple right-hand sides.
Syntax
Fortran 77:
call chpsv( uplo, n, nrhs, ap, ipiv, b, ldb, info )
call zhpsv( uplo, n, nrhs, ap, ipiv, b, ldb, info )
Fortran 95:
call hpsv( ap, b [,uplo] [,ipiv] [,info] )
C:
lapack_int LAPACKE_hpsv( int matrix_order, char uplo, lapack_int n, lapack_int nrhs,
* ap, lapack_int* ipiv, * b, lapack_int ldb );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine solves for X the system of linear equations A*X = B, where A is an n-by-n Hermitian matrix
stored in packed format, the columns of matrix B are individual right-hand sides, and the columns of X are
the corresponding solutions.
The diagonal pivoting method is used to factor A as A = U*D*UH or A = L*D*LH, where U (or L) is a product
of permutation and unit upper (lower) triangular matrices, and D is Hermitian and block diagonal with 1-by-1
and 2-by-2 diagonal blocks.
The factored form of A is then used to solve the system of equations A*X = B.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored:
If uplo = 'U', the upper triangle of A is stored.
If uplo = 'L', the lower triangle of A is stored.
n INTEGER. The order of matrix A; n = 0.
LAPACK Routines: Linear Equations 3
661
nrhs INTEGER. The number of right-hand sides; the number of columns in
B; nrhs = 0.
ap, b COMPLEX for chpsv
DOUBLE COMPLEX for zhpsv.
Arrays: ap(*), b(ldb,*).
The dimension of ap must be at least max(1,n(n+1)/2). The array ap
contains the factor U or L, as specified by uplo, in packed storage
(see Matrix Storage Schemes).
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations. The second dimension of b must
be at least max(1,nrhs).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
Output Parameters
ap The block-diagonal matrix D and the multipliers used to obtain the
factor U (or L) from the factorization of A as computed by ?hptrf,
stored as a packed triangular matrix in the same storage format as A.
b If info = 0, b is overwritten by the solution matrix X.
ipiv INTEGER.
Array, DIMENSION at least max(1, n). Contains details of the
interchanges and the block structure of D, as determined by ?hptrf.
If ipiv(i) = k > 0, then dii is a 1-by-1 block, and the i-th row
and column of A was interchanged with the k-th row and column.
If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i-1, and (i-1)-th row and column
of A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i+1, and (i+1)-th row and column
of A was interchanged with the m-th row and column.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, dii is 0. The factorization has been completed, but D is
exactly singular, so the solution could not be computed.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hpsv interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n,nrhs).
ipiv Holds the vector with the number of elements n.
uplo Must be 'U' or 'L'. The default value is 'U'.
3 Intel® Math Kernel Library Reference Manual
662
?hpsvx
Uses the diagonal pivoting factorization to compute
the solution to the system of linear equations with a
Hermitian matrix A stored in packed format, and
provides error bounds on the solution.
Syntax
Fortran 77:
call chpsvx( fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
work, rwork, info )
call zhpsvx( fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
work, rwork, info )
Fortran 95:
call hpsvx( ap, b, x [,uplo] [,afp] [,ipiv] [,fact] [,ferr] [,berr] [,rcond] [,info] )
C:
lapack_int LAPACKE_chpsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const lapack_complex_float* ap, lapack_complex_float* afp, lapack_int*
ipiv, const lapack_complex_float* b, lapack_int ldb, lapack_complex_float* x,
lapack_int ldx, float* rcond, float* ferr, float* berr );
lapack_int LAPACKE_zhpsvx( int matrix_order, char fact, char uplo, lapack_int n,
lapack_int nrhs, const lapack_complex_double* ap, lapack_complex_double* afp,
lapack_int* ipiv, const lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* x, lapack_int ldx, double* rcond, double* ferr, double* berr );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine uses the diagonal pivoting factorization to compute the solution to a complex system of linear
equations A*X = B, where A is a n-by-n Hermitian matrix stored in packed format, the columns of matrix B
are individual right-hand sides, and the columns of X are the corresponding solutions.
Error bounds on the solution and a condition estimate are also provided.
The routine ?hpsvx performs the following steps:
1. If fact = 'N', the diagonal pivoting method is used to factor the matrix A. The form of the factorization
is A = U*D*UH or A = L*D*LH, where U (or L) is a product of permutation and unit upper (lower)
triangular matrices, and D is a Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
2. If some di,i = 0, so that D is exactly singular, then the routine returns with info = i. Otherwise, the
factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the
condition number is less than machine precision, info = n+1 is returned as a warning, but the routine
still goes on to solve for X and compute error bounds as described below.
3. The system of equations is solved for X using the factored form of A.
4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and
backward error estimates for it.
LAPACK Routines: Linear Equations 3
663
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
fact CHARACTER*1. Must be 'F' or 'N'.
Specifies whether or not the factored form of the matrix A has been
supplied on entry.
If fact = 'F': on entry, afp and ipiv contain the factored form of
A. Arrays ap, afp, and ipiv are not modified.
If fact = 'N', the matrix A is copied to afp and factored.
uplo CHARACTER*1. Must be 'U' or 'L'.
Indicates whether the upper or lower triangular part of A is stored and
how A is factored:
If uplo = 'U', the array ap stores the upper triangular part of the
Hermitian matrix A, and A is factored as U*D*UH.
If uplo = 'L', the array ap stores the lower triangular part of the
Hermitian matrix A, and A is factored as L*D*LH.
n INTEGER. The order of matrix A; n = 0.
nrhs INTEGER. The number of right-hand sides, the number of columns in
B; nrhs = 0.
ap, afp, b, work COMPLEX for chpsvx
DOUBLE COMPLEX for zhpsvx.
Arrays: ap(*), afp(*), b(ldb,*), work(*).
The array ap contains the upper or lower triangle of the Hermitian
matrix A in packed storage (see Matrix Storage Schemes).
The array afp is an input argument if fact = 'F'. It contains the
block diagonal matrix D and the multipliers used to obtain the factor U
or L from the factorization A = U*D*UH or A = L*D*LH as computed
by ?hptrf, in the same storage format as A.
The array b contains the matrix B whose columns are the right-hand
sides for the systems of equations.
work(*) is a workspace array.
The dimension of arrays ap and afp must be at least max(1,n(n+1)/
2); the second dimension of b must be at least max(1,nrhs); the
dimension of work must be at least max(1,2*n).
ldb INTEGER. The leading dimension of b; ldb = max(1, n).
ipiv INTEGER.
Array, DIMENSION at least max(1, n). The array ipiv is an input
argument if fact = 'F'. It contains details of the interchanges and
the block structure of D, as determined by ?hptrf.
If ipiv(i) = k > 0, then dii is a 1-by-1 diagonal block, and the ith
row and column of A was interchanged with the k-th row and
column.
If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i-1, and (i-1)-th row and column
of A was interchanged with the m-th row and column.
If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-
by-2 block in rows/columns i and i+1, and (i+1)-th row and column
of A was interchanged with the m-th row and column.
3 Intel® Math Kernel Library Reference Manual
664
ldx INTEGER. The leading dimension of the output array x; ldx = max(1,
n).
rwork REAL for chpsvx
DOUBLE PRECISION for zhpsvx.
Workspace array, DIMENSION at least max(1, n).
Output Parameters
x COMPLEX for chpsvx
DOUBLE COMPLEX for zhpsvx.
Array, DIMENSION (ldx,*).
If info = 0 or info = n+1, the array x contains the solution matrix
X to the system of equations. The second dimension of x must be at
least max(1,nrhs).
afp, ipiv These arrays are output arguments if fact = 'N'. See the
description of afp, ipiv in Input Arguments section.
rcond REAL for chpsvx
DOUBLE PRECISION for zhpsvx.
An estimate of the reciprocal condition number of the matrix A. If
rcond is less than the machine precision (in particular, if rcond = 0),
the matrix is singular to working precision. This condition is indicated
by a return code of info > 0.
ferr REAL for chpsvx
DOUBLE PRECISION for zhpsvx.
Array, DIMENSION at least max(1, nrhs). Contains the estimated
forward error bound for each solution vector x(j) (the j-th column of
the solution matrix X). If xtrue is the true solution corresponding to
x(j), ferr(j) is an estimated upper bound for the magnitude of the
largest element in (x(j) - xtrue) divided by the magnitude of the
largest element in x(j). The estimate is as reliable as the estimate
for rcond, and is almost always a slight overestimate of the true
error.
berr REAL for chpsvx
DOUBLE PRECISION for zhpsvx.
Array, DIMENSION at least max(1, nrhs). Contains the componentwise
relative backward error for each solution vector x(j), that is, the
smallest relative change in any element of A or B that makes x(j) an
exact solution.
info INTEGER. If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
If info = i, and i = n, then dii is exactly zero. The factorization
has been completed, but the block diagonal matrix D is exactly
singular, so the solution and error bounds could not be computed;
rcond = 0 is returned.
If info = i, and i = n + 1, then D is nonsingular, but rcond is less
than machine precision, meaning that the matrix is singular to
working precision. Nevertheless, the solution and error bounds are
computed because there are a number of situations where the
computed solution can be more accurate than the value of rcond
would suggest.
LAPACK Routines: Linear Equations 3
665
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95
Interface Conventions.
Specific details for the routine hpsvx interface are as follows:
ap Holds the array A of size (n*(n+1)/2).
b Holds the matrix B of size (n,nrhs).
x Holds the matrix X of size (n,nrhs).
afp Holds the array AF of size (n*(n+1)/2).
ipiv Holds the vector with the number of elements n.
ferr Holds the vector with the number of elements nrhs.
berr Holds the vector with the number of elements nrhs.
uplo Must be 'U' or 'L'. The default value is 'U'.
fact Must be 'N' or 'F'. The default value is 'N'. If fact = 'F', then
both arguments af and ipiv must be present; otherwise, an error is
returned.
3 Intel® Math Kernel Library Reference Manual
666
LAPACK Routines: Least Squares
and Eigenvalue Problems 4
This chapter describes the Intel® Math Kernel Library implementation of routines from the LAPACK package
that are used for solving linear least squares problems, eigenvalue and singular value problems, as well as
performing a number of related computational tasks.
Sections in this chapter include descriptions of LAPACK computational routines and driver routines. For full
reference on LAPACK routines and related information see [LUG].
Least Squares Problems. A typical least squares problem is as follows: given a matrix A and a vector b,
find the vector x that minimizes the sum of squares Si((Ax)i - bi)2 or, equivalently, find the vector x that
minimizes the 2-norm ||Ax - b||2.
In the most usual case, A is an m-by-n matrix with m = n and rank(A) = n. This problem is also referred to
as finding the least squares solution to an overdetermined system of linear equations (here we have more
equations than unknowns). To solve this problem, you can use the QR factorization of the matrix A (see QR
Factorization).
If m < n and rank(A) = m, there exist an infinite number of solutions x which exactly satisfy Ax = b, and
thus minimize the norm ||Ax - b||2. In this case it is often useful to find the unique solution that
minimizes ||x||2. This problem is referred to as finding the minimum-norm solution to an
underdetermined system of linear equations (here we have more unknowns than equations). To solve this
problem, you can use the LQ factorization of the matrix A (see LQ Factorization).
In the general case you may have a rank-deficient least squares problem, with rank(A)< min(m, n): find
the minimum-norm least squares solution that minimizes both ||x||2 and ||Ax - b||2. In this case (or
when the rank of A is in doubt) you can use the QR factorization with pivoting or singular value
decomposition (see Singular Value Decomposition).
Eigenvalue Problems. The eigenvalue problems (from German eigen "own") are stated as follows: given a
matrix A, find the eigenvalues ? and the corresponding eigenvectors z that satisfy the equation
Az = ?z (right eigenvectors z)
or the equation
zHA = ?zH (left eigenvectors z).
If A is a real symmetric or complex Hermitian matrix, the above two equations are equivalent, and the
problem is called a symmetric eigenvalue problem. Routines for solving this type of problems are described
in the sectionSymmetric Eigenvalue Problems .
Routines for solving eigenvalue problems with nonsymmetric or non-Hermitian matrices are described in the
sectionNonsymmetric Eigenvalue Problems.
The library also includes routines that handle generalized symmetric-definite eigenvalue problems: find
the eigenvalues ? and the corresponding eigenvectors x that satisfy one of the following equations:
Az = ?Bz, ABz = ?z, or BAz = ?z,
where A is symmetric or Hermitian, and B is symmetric positive-definite or Hermitian positive-definite.
Routines for reducing these problems to standard symmetric eigenvalue problems are described in the
sectionGeneralized Symmetric-Definite Eigenvalue Problems.
To solve a particular problem, you usually call several computational routines. Sometimes you need to
combine the routines of this chapter with other LAPACK routines described in Chapter 3 as well as with BLAS
routines described in Chapter 2.
667
For example, to solve a set of least squares problems minimizing ||Ax - b||2 for all columns b of a given
matrix B (where A and B are real matrices), you can call ?geqrf to form the factorization A = QR, then call ?
ormqr to compute C = QHB and finally call the BLAS routine ?trsm to solve for X the system of equations RX
= C.
Another way is to call an appropriate driver routine that performs several tasks in one call. For example, to
solve the least squares problem the driver routine ?gels can be used.
WARNING LAPACK routines assume that input matrices do not contain IEEE 754 special values such
as INF or NaN values. Using these special values may cause LAPACK to return unexpected results or
become unstable.
Starting from release 8.0, Intel MKL along with the FORTRAN 77 interface to LAPACK computational and
driver routines supports also the Fortran 95 interface, which uses simplified routine calls with shorter
argument lists. The syntax section of the routine description gives the calling sequence for the Fortran 95
interface, where available, immediately after the FORTRAN 77 calls.
Routine Naming Conventions
For each routine in this chapter, when calling it from the FORTRAN 77 program you can use the LAPACK
name.
LAPACK names have the structure xyyzzz, which is explained below.
The initial letter x indicates the data type:
s real, single precision
c complex, single precision
d real, double precision
z complex, double precision
The second and third letters yy indicate the matrix type and storage scheme:
bb bidiagonal-block matrix
bd bidiagonal matrix
ge general matrix
gb general band matrix
hs upper Hessenberg matrix
or (real) orthogonal matrix
op (real) orthogonal matrix (packed storage)
un (complex) unitary matrix
up (complex) unitary matrix (packed storage)
pt symmetric or Hermitian positive-definite tridiagonal matrix
sy symmetric matrix
sp symmetric matrix (packed storage)
sb (real) symmetric band matrix
st (real) symmetric tridiagonal matrix
he Hermitian matrix
hp Hermitian matrix (packed storage)
hb (complex) Hermitian band matrix
tr triangular or quasi-triangular matrix.
The last three letters zzz indicate the computation performed, for example:
qrf form the QR factorization
lqf form the LQ factorization.
4 Intel® Math Kernel Library Reference Manual
668
Thus, the routine sgeqrf forms the QR factorization of general real matrices in single precision; the
corresponding routine for complex matrices is cgeqrf.
Names of the LAPACK computational and driver routines for the Fortran 95 interface in Intel MKL are the
same as the FORTRAN 77 names but without the first letter that indicates the data type. For example, the
name of the routine that forms the QR factorization of general real matrices in the Fortran 95 interface is
geqrf. Handling of different data types is done through defining a specific internal parameter referring to a
module block with named constants for single and double precision.
For details on the design of the Fortran 95 interface for LAPACK computational and driver routines in Intel
MKL and for the general information on how the optional arguments are reconstructed, see the Fortran 95
Interface Conventions in chapter 3 .
Matrix Storage Schemes
LAPACK routines use the following matrix storage schemes:
• Full storage: a matrix A is stored in a two-dimensional array a, with the matrix element aij stored in the
array element a(i,j).
• Packed storage scheme allows you to store symmetric, Hermitian, or triangular matrices more
compactly: the upper or lower triangle of the matrix is packed by columns in a one-dimensional array.
• Band storage: an m-by-n band matrix with kl sub-diagonals and ku super-diagonals is stored compactly
in a two-dimensional array ab with kl+ku+1 rows and n columns. Columns of the matrix are stored in the
corresponding columns of the array, and diagonals of the matrix are stored in rows of the array.
In Chapters 3 and 4 , arrays that hold matrices in the packed storage have names ending in p; arrays with
matrices in the band storage have names ending in b. For more information on matrix storage schemes, see
"Matrix Arguments" in Appendix B .
Mathematical Notation
In addition to the mathematical notation used in description of BLAS and LAPACK Linear Equations routines,
descriptions of the routines to solve Least Squares and Eigenvalue plroblems use the following notation:
?i Eigenvalues of the matrix A (for the definition of eigenvalues, see Eigenvalue
Problems).
si Singular values of the matrix A. They are equal to square roots of the
eigenvalues of AHA. (For more information, see Singular Value Decomposition).
||x||2 The 2-norm of the vector x: ||x||2 = (Si|xi|2)1/2 = ||x||E .
||A||2 The 2-norm (or spectral norm) of the matrix A.
||A||2 = maxisi, ||A||22= max|x|=1(Ax·Ax).
||A||E The Euclidean norm of the matrix A: ||A||E2 = SiSj|aij|2 (for vectors, the
Euclidean norm and the 2-norm are equal: ||x||E = ||x||2).
q(x, y) The acute angle between vectors x and y:
cos q(x, y) = |x·y| / (||x||2||y||2).
Computational Routines
In the sections that follow, the descriptions of LAPACK computational routines are given. These routines
perform distinct computational tasks that can be used for:
Orthogonal Factorizations
Singular Value Decomposition
Symmetric Eigenvalue Problems
Generalized Symmetric-Definite Eigenvalue Problems
LAPACK Routines: Least Squares and Eigenvalue Problems 4
669
Nonsymmetric Eigenvalue Problems
Generalized Nonsymmetric Eigenvalue Problems
Generalized Singular Value Decomposition
See also the respective driver routines.
Orthogonal Factorizations
This section describes the LAPACK routines for the QR (RQ) and LQ (QL) factorization of matrices. Routines
for the RZ factorization as well as for generalized QR and RQ factorizations are also included.
QR Factorization. Assume that A is an m-by-n matrix to be factored.
If m = n, the QR factorization is given by
where R is an n-by-n upper triangular matrix with real diagonal elements, and Q is an m-by-m orthogonal (or
unitary) matrix.
You can use the QR factorization for solving the following least squares problem: minimize ||Ax - b||2
where A is a full-rank m-by-n matrix (m=n). After factoring the matrix, compute the solution x by solving Rx =
(Q1)Tb.
If m < n, the QR factorization is given by
A = QR = Q(R1R2)
where R is trapezoidal, R1 is upper triangular and R2 is rectangular.
The LAPACK routines do not form the matrix Q explicitly. Instead, Q is represented as a product of min(m, n)
elementary reflectors. Routines are provided to work with Q in this representation.
LQ Factorization LQ factorization of an m-by-n matrix A is as follows. If m = n,
where L is an m-by-m lower triangular matrix with real diagonal elements, and Q is an n-by-n orthogonal (or
unitary) matrix.
If m > n, the LQ factorization is
where L1 is an n-by-n lower triangular matrix, L2 is rectangular, and Q is an n-by-n orthogonal (or unitary)
matrix.
You can use the LQ factorization to find the minimum-norm solution of an underdetermined system of linear
equations Ax = b where A is an m-by-n matrix of rank m (m < n). After factoring the matrix, compute the
solution vector x as follows: solve Ly = b for y, and then compute x = (Q1)Hy.
4 Intel® Math Kernel Library Reference Manual
670
Table "Computational Routines for Orthogonal Factorization" lists LAPACK routines (FORTRAN 77 interface)
that perform orthogonal factorization of matrices. Respective routine names in Fortran 95 interface are
without the first symbol (see Routine Naming Conventions).
Computational Routines for Orthogonal Factorization
Matrix type, factorization Factorize without
pivoting
Factorize with
pivoting
Generate
matrix Q
Apply
matrix Q
general matrices, QR factorization geqrf
geqrfp
geqpf
geqp3
orgqr
ungqr
ormqr
unmqr
general matrices, RQ factorization gerqf orgrq
ungrq
ormrq
unmrq
general matrices, LQ factorization gelqf orglq
unglq
ormlq
unmlq
general matrices, QL factorization geqlf orgql
ungql
ormql
unmql
trapezoidal matrices, RZ
factorization
tzrzf ormrz
unmrz
pair of matrices, generalized QR
factorization
ggqrf
pair of matrices, generalized RQ
factorization
ggrqf
?geqrf
Computes the QR factorization of a general m-by-n
matrix.
Syntax
Fortran 77:
call sgeqrf(m, n, a, lda, tau, work, lwork, info)
call dgeqrf(m, n, a, lda, tau, work, lwork, info)
call cgeqrf(m, n, a, lda, tau, work, lwork, info)
call zgeqrf(m, n, a, lda, tau, work, lwork, info)
Fortran 95:
call geqrf(a [, tau] [,info])
C:
lapack_int LAPACKE_geqrf( int matrix_order, lapack_int m, lapack_int n, *
a, lapack_int lda, * tau );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
LAPACK Routines: Least Squares and Eigenvalue Problems 4
671
The routine forms the QR factorization of a general m-by-n matrix A (see Orthogonal Factorizations). No
pivoting is performed.
The routine does not form the matrix Q explicitly. Instead, Q is represented as a product of min(m, n)
elementary reflectors. Routines are provided to work with Q in this representation.
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows in the matrix A (m = 0).
n INTEGER. The number of columns in A (n = 0).
a, work REAL for sgeqrf
DOUBLE PRECISION for dgeqrf
COMPLEX for cgeqrf
DOUBLE COMPLEX for zgeqrf.
Arrays: a(lda,*) contains the matrix A. The second dimension of a must be
at least max(1, n).
work is a workspace array, its dimension max(1, lwork).
lda INTEGER. The leading dimension of a; at least max(1, m).
lwork INTEGER. The size of the work array (lwork = n).
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the first
entry of the work array, and no error message related to lwork is issued by
xerbla.
See Application Notes for the suggested value of lwork.
Output Parameters
a Overwritten by the factorization data as follows:
If m = n, the elements below the diagonal are overwritten by the details of
the unitary matrix Q, and the upper triangle is overwritten by the
corresponding elements of the upper triangular matrix R.
If m < n, the strictly lower triangular part is overwritten by the details of
the unitary matrix Q, and the remaining elements are overwritten by the
corresponding elements of the m-by-n upper trapezoidal matrix R.
tau REAL for sgeqrf
DOUBLE PRECISION for dgeqrf
COMPLEX for cgeqrf
DOUBLE COMPLEX for zgeqrf.
Array, DIMENSION at least max (1, min(m, n)). Contains additional
information on the matrix Q.
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent runs.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
4 Intel® Math Kernel Library Reference Manual
672
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95
Interface Conventions.
Specific details for the routine geqrf interface are the following:
a Holds the matrix A of size (m,n).
tau Holds the vector of length min(m,n)
Application Notes
For better performance, try using lwork = n*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The computed factorization is the exact factorization of a matrix A + E, where
||E||2 = O(e)||A||2.
The approximate number of floating-point operations for real flavors is
(4/3)n3 if m = n,
(2/3)n2(3m-n) if m > n,
(2/3)m2(3n-m) if m < n.
The number of operations for complex flavors is 4 times greater.
To solve a set of least squares problems minimizing ||A*x - b||2 for all columns b of a given matrix B, you
can call the following:
?geqrf (this routine) to factorize A = QR;
ormqr to compute C = QT*B (for real matrices);
unmqr to compute C = QH*B (for complex matrices);
trsm (a BLAS routine) to solve R*X = C.
(The columns of the computed X are the least squares solution vectors x.)
To compute the elements of Q explicitly, call
orgqr (for real matrices)
ungqr (for complex matrices).
See Also
mkl_progress
LAPACK Routines: Least Squares and Eigenvalue Problems 4
673
?geqrfp
Computes the QR factorization of a general m-by-n
matrix with non-negative diagonal elements.
Syntax
Fortran 77:
call sgeqrfp(m, n, a, lda, tau, work, lwork, info)
call dgeqrfp(m, n, a, lda, tau, work, lwork, info)
call cgeqrfp(m, n, a, lda, tau, work, lwork, info)
call zgeqrfp(m, n, a, lda, tau, work, lwork, info)
C:
lapack_int LAPACKE_geqrfp( int matrix_order, lapack_int m, lapack_int n, *
a, lapack_int lda, * tau );
Include Files
• FORTRAN 77: mkl_lapack.fi and mkl_lapack.h
• C: mkl_lapacke.h
Description
The routine forms the QR factorization of a general m-by-n matrix A (see Orthogonal Factorizations). No
pivoting is performed.
The routine does not form the matrix Q explicitly. Instead, Q is represented as a product of min(m, n)
elementary reflectors. Routines are provided to work with Q in this representation.
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows in the matrix A (m = 0).
n INTEGER. The number of columns in A (n = 0).
a, work REAL for sgeqrfp
DOUBLE PRECISION for dgeqrfp
COMPLEX for cgeqrfp
DOUBLE COMPLEX for zgeqrfp.
Arrays: a(lda,*) contains the matrix A. The second dimension of a must be
at least max(1, n).
work is a workspace array, its dimension max(1, lwork).
lda INTEGER. The leading dimension of a; at least max(1, m).
lwork INTEGER. The size of the work array (lwork = n).
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the first
entry of the work array, and no error message related to lwork is issued by
xerbla.
4 Intel® Math Kernel Library Reference Manual
674
See Application Notes for the suggested value of lwork.
Output Parameters
a Overwritten by the factorization data as follows:
If m = n, the elements below the diagonal are overwritten by the details of
the unitary matrix Q, and the upper triangle is overwritten by the
corresponding elements of the upper triangular matrix R.
If m < n, the strictly lower triangular part is overwritten by the details of
the unitary matrix Q, and the remaining elements are overwritten by the
corresponding elements of the m-by-n upper trapezoidal matrix R.
The diagonal elements of the matrix R are non-negative.
tau REAL for sgeqrfp
DOUBLE PRECISION for dgeqrfp
COMPLEX for cgeqrfp
DOUBLE COMPLEX for zgeqrfp.
Array, DIMENSION at least max (1, min(m, n)). Contains additional
information on the matrix Q.
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent runs.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95
Interface Conventions.
Specific details for the routine geqrfp interface are the following:
a Holds the matrix A of size (m,n).
tau Holds the vector of length min(m,n)
Application Notes
For better performance, try using lwork = n*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The computed factorization is the exact factorization of a matrix A + E, where
||E||2 = O(e)||A||2.
The approximate number of floating-point operations for real flavors is
LAPACK Routines: Least Squares and Eigenvalue Problems 4
675
(4/3)n3 if m = n,
(2/3)n2(3m-n) if m > n,
(2/3)m2(3n-m) if m < n.
The number of operations for complex flavors is 4 times greater.
To solve a set of least squares problems minimizing ||A*x - b||2 for all columns b of a given matrix B, you
can call the following:
?geqrfp (this routine) to factorize A = QR;
ormqr to compute C = QT*B (for real matrices);
unmqr to compute C = QH*B (for complex matrices);
trsm (a BLAS routine) to solve R*X = C.
(The columns of the computed X are the least squares solution vectors x.)
To compute the elements of Q explicitly, call
orgqr (for real matrices)
ungqr (for complex matrices).
See Also
mkl_progress
?geqpf
Computes the QR factorization of a general m-by-n
matrix with pivoting.
Syntax
Fortran 77:
call sgeqpf(m, n, a, lda, jpvt, tau, work, info)
call dgeqpf(m, n, a, lda, jpvt, tau, work, info)
call cgeqpf(m, n, a, lda, jpvt, tau, work, rwork, info)
call zgeqpf(m, n, a, lda, jpvt, tau, work, rwork, info)
Fortran 95:
call geqpf(a, jpvt [,tau] [,info])
C:
lapack_int LAPACKE_geqpf( int matrix_order, lapack_int m, lapack_int n, *
a, lapack_int lda, lapack_int* jpvt, * tau );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine is deprecated and has been replaced by routine geqp3.
The routine ?geqpf forms the QR factorization of a general m-by-n matrix A with column pivoting: A*P = Q*R
(see Orthogonal Factorizations). Here P denotes an n-by-n permutation matrix.
4 Intel® Math Kernel Library Reference Manual
676
The routine does not form the matrix Q explicitly. Instead, Q is represented as a product of min(m, n)
elementary reflectors. Routines are provided to work with Q in this representation.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows in the matrix A (m = 0).
n INTEGER. The number of columns in A (n = 0).
a, work REAL for sgeqpf
DOUBLE PRECISION for dgeqpf
COMPLEX for cgeqpf
DOUBLE COMPLEX for zgeqpf.
Arrays: a (lda,*) contains the matrix A. The second dimension of a must be
at least max(1, n).
work (lwork) is a workspace array. The size of the work array must be at
least max(1, 3*n) for real flavors and at least max(1, n) for complex
flavors.
lda INTEGER. The leading dimension of a; at least max(1, m).
jpvt INTEGER. Array, DIMENSION at least max(1, n).
On entry, if jpvt(i) > 0, the i-th column of A is moved to the beginning
of A*P before the computation, and fixed in place during the computation.
If jpvt(i) = 0, the ith column of A is a free column (that is, it may be
interchanged during the computation with any other free column).
rwork REAL for cgeqpf
DOUBLE PRECISION for zgeqpf.
A workspace array, DIMENSION at least max(1, 2*n).
Output Parameters
a Overwritten by the factorization data as follows:
If m = n, the elements below the diagonal are overwritten by the details of
the unitary (orthogonal) matrix Q, and the upper triangle is overwritten by
the corresponding elements of the upper triangular matrix R.
If m < n, the strictly lower triangular part is overwritten by the details of
the matrix Q, and the remaining elements are overwritten by the
corresponding elements of the m-by-n upper trapezoidal matrix R.
tau REAL for sgeqpf
DOUBLE PRECISION for dgeqpf
COMPLEX for cgeqpf
DOUBLE COMPLEX for zgeqpf.
Array, DIMENSION at least max (1, min(m, n)). Contains additional
information on the matrix Q.
jpvt Overwritten by details of the permutation matrix P in the factorization A*P
= Q*R. More precisely, the columns of A*P are the columns of A in the
following order:
jpvt(1), jpvt(2), ..., jpvt(n).
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
LAPACK Routines: Least Squares and Eigenvalue Problems 4
677
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95
Interface Conventions.
Specific details for the routine geqpf interface are the following:
a Holds the matrix A of size (m,n).
jpvt Holds the vector of length n.
tau Holds the vector of length min(m,n)
Application Notes
The computed factorization is the exact factorization of a matrix A + E, where
||E||2 = O(e)||A||2.
The approximate number of floating-point operations for real flavors is
(4/3)n3 if m = n,
(2/3)n2(3m-n) if m > n,
(2/3)m2(3n-m) if m < n.
The number of operations for complex flavors is 4 times greater.
To solve a set of least squares problems minimizing ||A*x - b||2 for all columns b of a given matrix B, you
can call the following:
?geqpf (this routine) to factorize A*P = Q*R;
ormqr to compute C = QT*B (for real matrices);
unmqr to compute C = QH*B (for complex matrices);
trsm (a BLAS routine) to solve R*X = C.
(The columns of the computed X are the permuted least squares solution vectors x; the output array jpvt
specifies the permutation order.)
To compute the elements of Q explicitly, call
orgqr (for real matrices)
ungqr (for complex matrices).
?geqp3
Computes the QR factorization of a general m-by-n
matrix with column pivoting using level 3 BLAS.
Syntax
Fortran 77:
call sgeqp3(m, n, a, lda, jpvt, tau, work, lwork, info)
call dgeqp3(m, n, a, lda, jpvt, tau, work, lwork, info)
call cgeqp3(m, n, a, lda, jpvt, tau, work, lwork, rwork, info)
call zgeqp3(m, n, a, lda, jpvt, tau, work, lwork, rwork, info)
Fortran 95:
call geqp3(a, jpvt [,tau] [,info])
4 Intel® Math Kernel Library Reference Manual
678
C:
lapack_int LAPACKE_geqp3( int matrix_order, lapack_int m, lapack_int n, *
a, lapack_int lda, lapack_int* jpvt, * tau );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine forms the QR factorization of a general m-by-n matrix A with column pivoting: A*P = Q*R (see
Orthogonal Factorizations) using Level 3 BLAS. Here P denotes an n-by-n permutation matrix. Use this
routine instead of geqpf for better performance.
The routine does not form the matrix Q explicitly. Instead, Q is represented as a product of min(m, n)
elementary reflectors. Routines are provided to work with Q in this representation.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows in the matrix A (m = 0).
n INTEGER. The number of columns in A (n = 0).
a, work REAL for sgeqp3
DOUBLE PRECISION for dgeqp3
COMPLEX for cgeqp3
DOUBLE COMPLEX for zgeqp3.
Arrays:
a (lda,*) contains the matrix A.
The second dimension of a must be at least max(1, n).
work is a workspace array, its dimension max(1, lwork).
lda INTEGER. The leading dimension of a; at least max(1, m).
lwork INTEGER. The size of the work array; must be at least max(1, 3*n+1) for
real flavors, and at least max(1, n+1) for complex flavors.
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the first
entry of the work array, and no error message related to lwork is issued by
xerbla. See Application Notes below for details.
jpvt INTEGER.
Array, DIMENSION at least max(1, n).
On entry, if jpvt(i) ? 0, the i-th column of A is moved to the beginning
of AP before the computation, and fixed in place during the computation.
If jpvt(i) = 0, the i-th column of A is a free column (that is, it may be
interchanged during the computation with any other free column).
rwork REAL for cgeqp3
DOUBLE PRECISION for zgeqp3.
A workspace array, DIMENSION at least max(1, 2*n). Used in complex
flavors only.
LAPACK Routines: Least Squares and Eigenvalue Problems 4
679
Output Parameters
a Overwritten by the factorization data as follows:
If m = n, the elements below the diagonal are overwritten by the details of
the unitary (orthogonal) matrix Q, and the upper triangle is overwritten by
the corresponding elements of the upper triangular matrix R.
If m < n, the strictly lower triangular part is overwritten by the details of
the matrix Q, and the remaining elements are overwritten by the
corresponding elements of the m-by-n upper trapezoidal matrix R.
tau REAL for sgeqp3
DOUBLE PRECISION for dgeqp3
COMPLEX for cgeqp3
DOUBLE COMPLEX for zgeqp3.
Array, DIMENSION at least max (1, min(m, n)). Contains scalar factors of the
elementary reflectors for the matrix Q.
jpvt Overwritten by details of the permutation matrix P in the factorization A*P
= Q*R. More precisely, the columns of AP are the columns of A in the
following order:
jpvt(1), jpvt(2), ..., jpvt(n).
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95
Interface Conventions.
Specific details for the routine geqp3 interface are the following:
a Holds the matrix A of size (m,n).
jpvt Holds the vector of length n.
tau Holds the vector of length min(m,n)
Application Notes
To solve a set of least squares problems minimizing ||A*x - b||2 for all columns b of a given matrix B, you
can call the following:
?geqp3 (this routine) to factorize A*P = Q*R;
ormqr to compute C = QT*B (for real matrices);
unmqr to compute C = QH*B (for complex matrices);
trsm (a BLAS routine) to solve R*X = C.
(The columns of the computed X are the permuted least squares solution vectors x; the output array jpvt
specifies the permutation order.)
To compute the elements of Q explicitly, call
orgqr (for real matrices)
ungqr (for complex matrices).
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
4 Intel® Math Kernel Library Reference Manual
680
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
?orgqr
Generates the real orthogonal matrix Q of the QR
factorization formed by ?geqrf.
Syntax
Fortran 77:
call sorgqr(m, n, k, a, lda, tau, work, lwork, info)
call dorgqr(m, n, k, a, lda, tau, work, lwork, info)
Fortran 95:
call orgqr(a, tau [,info])
C:
lapack_int LAPACKE_orgqr( int matrix_order, lapack_int m, lapack_int n, lapack_int
k, * a, lapack_int lda, const * tau );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine generates the whole or part of m-by-m orthogonal matrix Q of the QR factorization formed by the
routines geqrf/geqrf or geqpf/geqpf. Use this routine after a call to sgeqrf/dgeqrf or sgeqpf/dgeqpf.
Usually Q is determined from the QR factorization of an m by p matrix A with m = p. To compute the whole
matrix Q, use:
call ?orgqr(m, m, p, a, lda, tau, work, lwork, info)
To compute the leading p columns of Q (which form an orthonormal basis in the space spanned by the
columns of A):
call ?orgqr(m, p, p, a, lda, tau, work, lwork, info)
To compute the matrix Qk of the QR factorization of leading k columns of the matrix A:
call ?orgqr(m, m, k, a, lda, tau, work, lwork, info)
To compute the leading k columns of Qk (which form an orthonormal basis in the space spanned by leading k
columns of the matrix A):
call ?orgqr(m, k, k, a, lda, tau, work, lwork, info)
LAPACK Routines: Least Squares and Eigenvalue Problems 4
681
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The order of the orthogonal matrix Q (m = 0).
n INTEGER. The number of columns of Q to be computed
(0 = n = m).
k INTEGER. The number of elementary reflectors whose product defines the
matrix Q (0 = k = n).
a, tau, work REAL for sorgqr
DOUBLE PRECISION for dorgqr
Arrays:
a(lda,*) and tau(*) are the arrays returned by sgeqrf / dgeqrf or
sgeqpf / dgeqpf.
The second dimension of a must be at least max(1, n).
The dimension of tau must be at least max(1, k).
work is a workspace array, its dimension max(1, lwork).
lda INTEGER. The leading dimension of a; at least max(1, m).
lwork INTEGER. The size of the work array (lwork = n).
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the first
entry of the work array, and no error message related to lwork is issued by
xerbla.
See Application Notes for the suggested value of lwork.
Output Parameters
a Overwritten by n leading columns of the m-by-m orthogonal matrix Q.
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent runs.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95
Interface Conventions.
Specific details for the routine orgqr interface are the following:
a Holds the matrix A of size (m,n).
tau Holds the vector of length (k)
Application Notes
For better performance, try using lwork = n*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
4 Intel® Math Kernel Library Reference Manual
682
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The computed Q differs from an exactly orthogonal matrix by a matrix E such that
||E||2 = O(e)|*|A||2 where e is the machine precision.
The total number of floating-point operations is approximately 4*m*n*k - 2*(m + n)*k2 + (4/3)*k3.
If n = k, the number is approximately (2/3)*n2*(3m - n).
The complex counterpart of this routine is ungqr.
?ormqr
Multiplies a real matrix by the orthogonal matrix Q of
the QR factorization formed by ?geqrf or ?geqpf.
Syntax
Fortran 77:
call sormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
call dormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
Fortran 95:
call ormqr(a, tau, c [,side] [,trans] [,info])
C:
lapack_int LAPACKE_ormqr( int matrix_order, char side, char trans, lapack_int m,
lapack_int n, lapack_int k, const * a, lapack_int lda, const *
tau, * c, lapack_int ldc );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine multiplies a real matrix C by Q or Q T, where Q is the orthogonal matrix Q of the QR factorization
formed by the routines geqrf/geqrf or geqpf/geqpf.
Depending on the parameters side and trans, the routine can form one of the matrix products Q*C, QT*C,
C*Q, or C*QT (overwriting the result on C).
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
LAPACK Routines: Least Squares and Eigenvalue Problems 4
683
side CHARACTER*1. Must be either 'L' or 'R'.
If side ='L', Q or QT is applied to C from the left.
If side ='R', Q or QT is applied to C from the right.
trans CHARACTER*1. Must be either 'N' or 'T'.
If trans ='N', the routine multiplies C by Q.
If trans ='T', the routine multiplies C by QT.
m INTEGER. The number of rows in the matrix C (m = 0).
n INTEGER. The number of columns in C (n = 0).
k INTEGER. The number of elementary reflectors whose product defines the
matrix Q. Constraints:
0 = k = m if side ='L';
0 = k = n if side ='R'.
a, tau, c, work REAL for sgeqrf
DOUBLE PRECISION for dgeqrf.
Arrays:
a(lda,*) and tau(*) are the arrays returned by sgeqrf / dgeqrf or
sgeqpf / dgeqpf. The second dimension of a must be at least max(1, k).
The dimension of tau must be at least max(1, k).
c(ldc,*) contains the matrix C.
The second dimension of c must be at least max(1, n)
work is a workspace array, its dimension max(1, lwork).
lda INTEGER. The leading dimension of a. Constraints:
lda = max(1, m) if side = 'L';
lda = max(1, n) if side = 'R'.
ldc INTEGER. The leading dimension of c. Constraint:
ldc = max(1, m).
lwork INTEGER. The size of the work array. Constraints:
lwork = max(1, n) if side = 'L';
lwork = max(1, m) if side = 'R'.
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the first
entry of the work array, and no error message related to lwork is issued by
xerbla.
See Application Notes for the suggested value of lwork.
Output Parameters
c Overwritten by the product Q*C, QT*C, C*Q, or C*QT (as specified by side
and trans).
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent runs.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95
Interface Conventions.
Specific details for the routine ormqr interface are the following:
4 Intel® Math Kernel Library Reference Manual
684
a Holds the matrix A of size (r,k).
r = m if side = 'L'.
r = n if side = 'R'.
tau Holds the vector of length (k).
c Holds the matrix C of size (m,n).
side Must be 'L' or 'R'. The default value is 'L'.
trans Must be 'N' or 'T'. The default value is 'N'.
Application Notes
For better performance, try using lwork = n*blocksize (if side = 'L') or lwork = m*blocksize (if
side = 'R') where blocksize is a machine-dependent value (typically, 16 to 64) required for optimum
performance of the blocked algorithm.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The complex counterpart of this routine is unmqr.
?ungqr
Generates the complex unitary matrix Q of the QR
factorization formed by ?geqrf.
Syntax
Fortran 77:
call cungqr(m, n, k, a, lda, tau, work, lwork, info)
call zungqr(m, n, k, a, lda, tau, work, lwork, info)
Fortran 95:
call ungqr(a, tau [,info])
C:
lapack_int LAPACKE_ungqr( int matrix_order, lapack_int m, lapack_int n, lapack_int
k, * a, lapack_int lda, const * tau );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine generates the whole or part of m-by-m unitary matrix Q of the QR factorization formed by the
routines geqrf/geqrf or geqpf/geqpf. Use this routine after a call to cgeqrf/zgeqrf or cgeqpf/zgeqpf.
LAPACK Routines: Least Squares and Eigenvalue Problems 4
685
Usually Q is determined from the QR factorization of an m by p matrix A with m = p. To compute the whole
matrix Q, use:
call ?ungqr(m, m, p, a, lda, tau, work, lwork, info)
To compute the leading p columns of Q (which form an orthonormal basis in the space spanned by the
columns of A):
call ?ungqr(m, p, p, a, lda, tau, work, lwork, info)
To compute the matrix Qk of the QR factorization of the leading k columns of the matrix A:
call ?ungqr(m, m, k, a, lda, tau, work, lwork, info)
To compute the leading k columns of Qk (which form an orthonormal basis in the space spanned by the
leading k columns of the matrix A):
call ?ungqr(m, k, k, a, lda, tau, work, lwork, info)
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The order of the unitary matrix Q (m = 0).
n INTEGER. The number of columns of Q to be computed
(0 = n = m).
k INTEGER. The number of elementary reflectors whose product defines the
matrix Q (0 = k = n).
a, tau, work COMPLEX for cungqr
DOUBLE COMPLEX for zungqr
Arrays: a(lda,*) and tau(*) are the arrays returned by cgeqrf/zgeqrf or
cgeqpf/zgeqpf.
The second dimension of a must be at least max(1, n).
The dimension of tau must be at least max(1, k).
work is a workspace array, its dimension max(1, lwork).
lda INTEGER. The leading dimension of a; at least max(1, m).
lwork INTEGER. The size of the work array (lwork = n).
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the first
entry of the work array, and no error message related to lwork is issued by
xerbla.
See Application Notes for the suggested value of lwork.
Output Parameters
a Overwritten by n leading columns of the m-by-m unitary matrix Q.
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent runs.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95
Interface Conventions.
4 Intel® Math Kernel Library Reference Manual
686
Specific details for the routine ungqr interface are the following:
a Holds the matrix A of size (m,n).
tau Holds the vector of length (k).
Application Notes
For better performance, try using lwork =n*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
If it is not clear how much workspace to supply, use a generous value of lwork for the first run, or set lwork
= -1.
In first case the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If lwork = -1, then the routine returns immediately and provides the recommended workspace in the first
element of the corresponding array (work). This operation is called a workspace query.
Note that if lwork is less than the minimal required value and is not equal to -1, then the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The computed Q differs from an exactly unitary matrix by a matrix E such that ||E||2 = O(e)*||A||2,
where e is the machine precision.
The total number of floating-point operations is approximately 16*m*n*k - 8*(m + n)*k2 + (16/3)*k3.
If n = k, the number is approximately (8/3)*n2*(3m - n).
The real counterpart of this routine is orgqr.
?unmqr
Multiplies a complex matrix by the unitary matrix Q of
the QR factorization formed by ?geqrf.
Syntax
Fortran 77:
call cunmqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
call zunmqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
Fortran 95:
call unmqr(a, tau, c [,side] [,trans] [,info])
C:
lapack_int LAPACKE_unmqr( int matrix_order, char side, char trans, lapack_int m,
lapack_int n, lapack_int k, const * a, lapack_int lda, const *
tau, * c, lapack_int ldc );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine multiplies a rectangular complex matrix C by Q or QH, where Q is the unitary matrix Q of the QR
factorization formed by the routines geqrf/geqrf or geqpf/geqpf.
LAPACK Routines: Least Squares and Eigenvalue Problems 4
687
Depending on the parameters side and trans, the routine can form one of the matrix products Q*C, QH*C,
C*Q, or C*QH (overwriting the result on C).
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
side CHARACTER*1. Must be either 'L' or 'R'.
If side = 'L', Q or QH is applied to C from the left.
If side = 'R', Q or QH is applied to C from the right.
trans CHARACTER*1. Must be either 'N' or 'C'.
If trans = 'N', the routine multiplies C by Q.
If trans = 'C', the routine multiplies C by QH.
m INTEGER. The number of rows in the matrix C (m = 0).
n INTEGER. The number of columns in C (n = 0).
k INTEGER. The number of elementary reflectors whose product defines the
matrix Q. Constraints:
0 = k = m if side = 'L';
0 = k = n if side = 'R'.
a, c, tau, work COMPLEX for cgeqrf
DOUBLE COMPLEX for zgeqrf.
Arrays:
a(lda,*) and tau(*) are the arrays returned by cgeqrf / zgeqrf or
cgeqpf / zgeqpf.
The second dimension of a must be at least max(1, k).
The dimension of tau must be at least max(1, k).
c(ldc,*) contains the matrix C.
The second dimension of c must be at least max(1, n)
work is a workspace array, its dimension max(1, lwork).
lda INTEGER. The leading dimension of a. Constraints:
lda = max(1, m) if side = 'L';
lda = max(1, n) if side = 'R'.
ldc INTEGER. The leading dimension of c. Constraint:
ldc = max(1, m).
lwork INTEGER. The size of the work array. Constraints:
lwork = max(1, n) if side = 'L';
lwork = max(1, m) if side = 'R'.
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the first
entry of the work array, and no error message related to lwork is issued by
xerbla.
See Application notes for the suggested value of lwork.
Output Parameters
c Overwritten by the product Q*C, QH*C, C*Q, or C*QH (as specified by side
and trans).
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent runs.
info INTEGER.
4 Intel® Math Kernel Library Reference Manual
688
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95
Interface Conventions.
Specific details for the routine unmqr interface are the following:
a Holds the matrix A of size (r,k).
r = m if side = 'L'.
r = n if side = 'R'.
tau Holds the vector of length (k).
c Holds the matrix C of size (m,n).
side Must be 'L' or 'R'. The default value is 'L'.
trans Must be 'N' or 'C'. The default value is 'N'.
Application Notes
For better performance, try using lwork = n*blocksize (if side = 'L') or lwork = m*blocksize (if
side = 'R') where blocksize is a machine-dependent value (typically, 16 to 64) required for optimum
performance of the blocked algorithm.
If it is not clear how much workspace to supply, use a generous value of lwork for the first run, or set lwork
= -1.
In first case the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If lwork = -1, then the routine returns immediately and provides the recommended workspace in the first
element of the corresponding array (work). This operation is called a workspace query.
Note that if lwork is less than the minimal required value and is not equal to -1, then the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The real counterpart of this routine is ormqr.
?gelqf
Computes the LQ factorization of a general m-by-n
matrix.
Syntax
Fortran 77:
call sgelqf(m, n, a, lda, tau, work, lwork, info)
call dgelqf(m, n, a, lda, tau, work, lwork, info)
call cgelqf(m, n, a, lda, tau, work, lwork, info)
call zgelqf(m, n, a, lda, tau, work, lwork, info)
Fortran 95:
call gelqf(a [, tau] [,info])
LAPACK Routines: Least Squares and Eigenvalue Problems 4
689
C:
lapack_int LAPACKE_gelqf( int matrix_order, lapack_int m, lapack_int n, *
a, lapack_int lda, * tau );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine forms the LQ factorization of a general m-by-n matrix A (see Orthogonal Factorizations). No
pivoting is performed.
The routine does not form the matrix Q explicitly. Instead, Q is represented as a product of min(m, n)
elementary reflectors. Routines are provided to work with Q in this representation.
NOTE This routine supports the Progress Routine feature. See Progress Function section for details.
Input Parameters
The data types are given for the Fortran interface. A placeholder, if present, is used for the C
interface data types in the C interface section above. See the C Interface Conventions section for the C
interface principal conventions and type definitions.
m INTEGER. The number of rows in the matrix A (m = 0).
n INTEGER. The number of columns in A (n = 0).
a, work REAL for sgelqf
DOUBLE PRECISION for dgelqf
COMPLEX for cgelqf
DOUBLE COMPLEX for zgelqf.
Arrays:
a(lda,*) contains the matrix A.
The second dimension of a must be at least max(1, n).
work is a workspace array, its dimension max(1, lwork).
lda INTEGER. The leading dimension of a; at least max(1, m).
lwork INTEGER. The size of the work array; at least max(1, m).
If lwork = -1, then a workspace query is assumed; the routine only
calculates the optimal size of the work array, returns this value as the first
entry of the work array, and no error message related to lwork is issued by
xerbla.
See Application Notes for the suggested value of lwork.
Output Parameters
a Overwritten by the factorization data as follows:
If m = n, the elements above the diagonal are overwritten by the details of
the unitary (orthogonal) matrix Q, and the lower triangle is overwritten by
the corresponding elements of the lower triangular matrix L.
If m > n, the strictly upper triangular part is overwritten by the details of the
matrix Q, and the remaining elements are overwritten by the corresponding
elements of the m-by-n lower trapezoidal matrix L.
4 Intel® Math Kernel Library Reference Manual
690
tau REAL for sgelqf
DOUBLE PRECISION for dgelqf
COMPLEX for cgelqf
DOUBLE COMPLEX for zgelqf.
Array, DIMENSION at least max(1, min(m, n)).
Contains additional information on the matrix Q.
work(1) If info = 0, on exit work(1) contains the minimum value of lwork
required for optimum performance. Use this lwork for subsequent runs.
info INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Fortran 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77
counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95
Interface Conventions.
Specific details for the routine gelqf interface are the following:
a Holds the matrix A of size (m,n).
tau Holds the vector of length min(m,n).
Application Notes
For better performance, try using lwork =m*blocksize, where blocksize is a machine-dependent value
(typically, 16 to 64) required for optimum performance of the blocked algorithm.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set
lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value
described, the routine completes the task, though probably not so fast as with a recommended workspace,
and provides the recommended workspace in the first element of the corresponding array work on exit. Use
this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the
first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns
immediately with an error exit and does not provide any information on the recommended workspace.
The computed factorization is the exact factorization of a matrix A + E, where
||E||2 = O(e) ||A||2.
The approximate number of floating-point operations for real flavors is
(4/3)n3 if m = n,
(2/3)n2(3m-n) if m > n,
(2/3)m2(3n-m) if m < n.
The number of operations for complex flavors is 4 times greater.
To find the minimum-norm solution of an underdetermined least squares problem minimizing ||A*x - b||2
for all columns b of a given matrix B, you can call the following:
?gelqf (this routine) to factorize A = L*Q;
trsm (a BLAS routine) to solve L*Y = B for Y;
ormlq to compute X = (Q1)T*Y (for real matrices);
LAPACK Routines: Least Squares and Eigenvalue Problems 4
691
unmlq to compute X = (Q1)H*Y (for complex matrices).
(The columns of the computed X are the minimum-norm solution vectors x. Here A is an m-by-n matrix with m
< n; Q1 denotes the first m columns of Q).
To compute the elements of Q explicitly, call
orglq (for real matrices)
unglq (for complex matrices).
See Also
mkl_progress
?orglq
Generates the real orthogonal matrix Q of the LQ
factorization formed by ?gelqf.
Syntax
Fortran 77:
call sorglq(m, n, k, a, lda, tau, work, lwork, info)
call dorglq(m, n, k, a, lda, tau, work, lwork, info)
Fortran 95:
call orglq(a, tau [,info])
C:
lapack_int LAPACKE_orglq( int matrix_order, lapack_int m, lapack_int n, lapack_int
k, * a, lapack_int lda, const * tau );
Include Files
• Fortran: mkl_lapack.fi and mkl_lapack.h
• Fortran 95: lapack.f90
• C: mkl_lapacke.h
Description
The routine generates the whole or part of n-by-n orthogonal matrix Q of the LQ factorization formed by the
routines gelqf/gelqf. Use this routine after a call to sgelqf/dgelqf.
Usually Q is determined from the LQ factorization of an p-by-n matrix A with n = p. To compute the whole
matrix Q, use:
call ?orglq(n, n, p, a, lda, tau, work, lwork, info)
To compute the leading p rows of Q, which form an orthonormal basis in the space spanned by the rows of A,
use:
call ?orglq(p, n, p, a, lda, tau, work, lwork, info)
To compute the matrix Qk of the LQ factorization of the leading k rows of A, use:
call ?orglq(n, n, k, a, lda, tau, work, lwork, info)
To compute the leading k rows of Qk, which form an orthonormal basis in the space spanned by the leading k
rows of A, use:
call ?orgqr(k, n, k, a, lda, tau, work, lwork, info)
4 Intel® Math Kernel Library Reference Manual
692
Input Parameters
The data types are given for the Fortran interface. A