Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29415 Diskussionen

Why does the same function have multiple different function?

Hongyizhao
Einsteiger
1.084Aufrufe

Say, for the function ssyevd, there are the following calling methods based on the document here:

Syntax
 call ssyevd(jobz, uplo, n, a, lda, w, work, lwork, iwork, liwork, info)
 call dsyevd(jobz, uplo, n, a, lda, w, work, lwork, iwork, liwork, info)
 call syevd(a, w [,jobz] [,uplo] [,info])

As you can see, there are multiple different names for the same function. For this case, the first two have exactly the same syntax expect the subtle difference in function name. Any hints/comments/explanations for this phenomenon will he highly appreciated.

 

Regards,

HY

0 Kudos
1 Lösung
mecej4
Geehrter Beitragender III
1.051Aufrufe

See the Netlib documentation.

In general, Lapack and BLAS routines come in four varieties, distinguished by the type and precision of those arguments that are real or complex.. The prefix 'S' is for single precision real, 'D' for double precision real, 'C' for single precision complex, 'Z' for double precision complex.

This was the situation before Fortran 90/95 came along. Now, you may call a single name regardless of the types of arguments, and the compiler will examine the types of the arguments and call the S,D,C or Z variant based on the type. 

Furthermore, the Fortran-95 style calls can have optional arguments and arguments passed by keyword rather than position. Workspace arrays need not be passed explicitly by the user, since in modern Fortran such arrays can be allocated dynamically in the callee.

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten
mecej4
Geehrter Beitragender III
1.052Aufrufe

See the Netlib documentation.

In general, Lapack and BLAS routines come in four varieties, distinguished by the type and precision of those arguments that are real or complex.. The prefix 'S' is for single precision real, 'D' for double precision real, 'C' for single precision complex, 'Z' for double precision complex.

This was the situation before Fortran 90/95 came along. Now, you may call a single name regardless of the types of arguments, and the compiler will examine the types of the arguments and call the S,D,C or Z variant based on the type. 

Furthermore, the Fortran-95 style calls can have optional arguments and arguments passed by keyword rather than position. Workspace arrays need not be passed explicitly by the user, since in modern Fortran such arrays can be allocated dynamically in the callee.

Hongyizhao
Einsteiger
1.045Aufrufe
Antworten