You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-13Lines changed: 23 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
-
# *** WORK IN PROGRESS ***
1
+
# fortran-lapack
2
+
This package provides precision-agnostig, high-level linear algebra APIs for `real` and `complex` arguments in Modern Fortran. The APIs are similar to NumPy/SciPy operations, and leverage a Modern Fortran implementation of the [Reference-LAPACK](http://github.com/reference-LAPACK) library.
2
3
3
4
# Current API
4
5
Procedure | Type | Description | Optional arguments
All procedures work with all types (`real`, `complex`) and kinds (32, 64, 128-bit floats).
27
28
28
-
# fortran-lapack
29
-
This package contains a Modern Fortran implementation of the [Reference-LAPACK](http://github.com/reference-LAPACK) library.
30
-
The reference Fortran-77 library is automatically downloaded from its master repository, and processed to create Modern Fortran modules with full explicit typing features.
31
-
Release 3.10.1 is currently targeted. Function interfaces are unchanged from the original implementation, and allow future extension to handle its usage through external implementations.
29
+
# BLAS, LAPACK
30
+
Modern Fortran modules with full explicit typing features are available as modules `la_blas` and `la_lapack`.
31
+
The reference Fortran-77 library, forked from Release 3.10.1, was automatically processed and modernized.
32
32
The following refactorings are applied:
33
33
- All datatypes and accuracy constants standardized into a module (`stdlib`-compatible names)
34
34
- Both libraries available for 32, 64 and 128-bit floats
This task is in progress. The names of all procedures have been prefixed not to pollute the original BLAS/LAPACK namespace, so that handling of external libraries can be accomplished via a preprocessor flag. For example:
59
+
Generic interfaces to most BLAS/LAPACK functions are exposed to modules `la_blas` and `la_lapack`. These interfaces drop the initial letter to wrap a precision-agnostic version. For example, `axpy` is a precision-agnostic interface to `saxpy`, `daxpy`, `caxpy`, `zaxpy`, `qaxpy`, `waxpy`.
60
+
The naming convention is:
61
+
62
+
Type | 32-bit | 64-bit | 128-bit
63
+
--- | --- | --- | ---
64
+
real | `s` | `d` | `q`
65
+
complex | `c` | `z` | `w`
66
+
67
+
All public interfaces in `la_blas` and `la_lapack` allow seamless linking against external libraries via a simple pre-processor flag.
68
+
When an external library is available, just define macros `LA_EXTERNAL_BLAS` and `LA_EXTERNAL_LAPACK`. The kind-agnostic interface
69
+
will just point to the external function. All such interfaces follow this template:
60
70
61
71
```fortran
62
-
#ifdef EXTERNAL_BLAS
63
-
interface
72
+
interface axpy
73
+
#ifdef LA_EXTERNAL_BLAS
74
+
! Use external library
64
75
pure subroutine saxpy(n, a, x, incx, y, incy)
65
76
import :: ik, sp
66
77
integer, parameter :: wp = sp
@@ -71,12 +82,11 @@ interface
71
82
real(wp), intent(inout) :: y(*)
72
83
integer(ik), intent(in) :: incy
73
84
end subroutine saxpy
74
-
end interface
75
85
#else
76
-
interface saxpy
77
-
module procedure stdlib_saxpy
78
-
end interface
86
+
! Use internal implementation
87
+
module procedure la_saxpy
79
88
#endif
89
+
end interface
80
90
```
81
91
82
92
# Licensing
@@ -86,4 +96,4 @@ The license used for the software is the [modified BSD license](https://www.netl
86
96
According to the original license, we changed the name of the routines and commented the changes made to the original.
87
97
88
98
# Acknowledgments
89
-
The development of this package is supported by the [Sovereign Tech Fund](https://www.sovereigntechfund.de).
99
+
Part of this work was supported by the [Sovereign Tech Fund](https://www.sovereigntechfund.de).
0 commit comments