Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

sbtrd call line variables

wilcox__nigel
Beginner
1,104 Views
I am trying to use F90 call to sbtrd but from the user manual I do not see how I get the output variables d and e.

the call line according to the manual is

call sbtrd(ab[, q] [,vect] [,uplo] [,info])

and the variables are listed as:

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 sbtrd interface are the following:

ab Holds the array A of size (kd+1,n).
q Holds the matrix Q of size (n,n).
d Holds the vector with the number of elements n.
e Holds the vector with the number of elements n - 1.
uplo Must be 'U' or 'L'. The default value is 'U'.
vect If omitted, this argument is restored based on the presence of argument q as follows: vect = 'V', if q is present, vect = 'N', if q is omitted.

If present, vect must be equal to 'V' or 'U' and the argument q must also be present. Note that there will be an error condition if vect is present and q omitted.

so where are d and e in the call line?

thanks for any help

Nigel
0 Kudos
6 Replies
ArturGuzik
Valued Contributor I
1,104 Views
Quoting - Nigel Wilcox
I am trying to use F90 call to sbtrd but from the user manual I do not see how I get the output variables d and e.

the call line according to the manual is

call sbtrd(ab[, q] [,vect] [,uplo] [,info])

and the variables are listed as:

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 sbtrd interface are the following:

ab Holds the array A of size (kd+1,n).
q Holds the matrix Q of size (n,n).
d Holds the vector with the number of elements n.
e Holds the vector with the number of elements n - 1.
uplo Must be 'U' or 'L'. The default value is 'U'.
vect If omitted, this argument is restored based on the presence of argument q as follows: vect = 'V', if q is present, vect = 'N', if q is omitted.

If present, vect must be equal to 'V' or 'U' and the argument q must also be present. Note that there will be an error condition if vect is present and q omitted.

so where are d and e in the call line?

thanks for any help

Nigel

Hi Nigel,

I guess as every F95 with optional parameters, say,

call sbtrd(ab, e=YOUR_MATRIX_E)

A.


0 Kudos
wilcox__nigel
Beginner
1,104 Views
Quoting - ArturGuzik

Hi Nigel,

I guess as every F95 with optional parameters, say,

call sbtrd(ab, e=YOUR_MATRIX_E)

A.



I tried that Artur but I get the following build error

C:Projects_NSWE2536_ Error: There is no matching specific subroutine for this generic subroutine call. [SBTRD]
C:Projects_NSWE2536_ Compilation Aborted (code 1)


d and e should not be optional because they are the output of the routine


Thanks


Nigel
0 Kudos
Vladimir_Koldakov__I
New Contributor III
1,104 Views
Hi Nigel,

d and e are simply duplicate (sub)diagonal elements of ab, so d & e areomitted in the F95 interface.
See also s/dSYTRD, c/zHETRD, s/dSPTRD, c/zHPTRD, s/dSBTRD, c/zHBTRD.

The documentation inaccuracies will be fixed.

Thanks,
Vladimir
0 Kudos
wilcox__nigel
Beginner
1,104 Views
Hi Nigel,

d and e are simply duplicate (sub)diagonal elements of ab, so d & e areomitted in the F95 interface.
See also s/dSYTRD, c/zHETRD, s/dSPTRD, c/zHPTRD, s/dSBTRD, c/zHBTRD.

The documentation inaccuracies will be fixed.

Thanks,
Vladimir

Sorry Vladimir I'm not sure I understand.

d and e are the diagonal and off diagonal terms of the matrix T which is the tri diagonal reduced form of ab. So are you saying that they are reurned in ab, in which case how are they packed? ab is (ku+1,N) in form and d is (N) long and e (N-1) long?

thanks

Nigel
0 Kudos
ArturGuzik
Valued Contributor I
1,104 Views
Quoting - Nigel Wilcox

Sorry Vladimir I'm not sure I understand.

d and e are the diagonal and off diagonal terms of the matrix T which is the tri diagonal reduced form of ab. So are you saying that they are reurned in ab, in which case how are they packed? ab is (ku+1,N) in form and d is (N) long and e (N-1) long?

thanks

Nigel

Nigel,

you may take a look at interface itself. The output arguments are
OPTIONAL :: INFO
INTENT(INOUT) :: AB(:,:)
INTENT(INOUT), OPTIONAL, TARGET :: Q(:,:)

The E, D are deallocated once F77 version completes its job, and as Vladimir said, they are not returned (and not available, so that's why the error about interface you received). I have to admit that I have no idea how T elements are returned. The easy solution would be just call pure (F77-style) LAPACK version:-)

A.


0 Kudos
Vladimir_Koldakov__I
New Contributor III
1,104 Views
Hi, Nigel,

As you can see at the NETLIB site: http://www.netlib.org/lapack/double/dsbtrd.f

* On exit, the diagonal elements of AB are overwritten by the
* diagonal elements of the tridiagonal matrix T; if KD > 0, the
* elements on the first superdiagonal (if UPLO = 'U') or the
* first subdiagonal (if UPLO = 'L') are overwritten by the
* off-diagonal elements of T; the rest of AB is overwritten by
* values generated during the reduction.

You can find on this pagethe code to copy (sub)diagonal elements for UPPER and LOWER cases.

Thanks,
Vladimir
0 Kudos
Reply