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
+34-13Lines changed: 34 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
-
# *** WORK IN PROGRESS ***
1
+
# fortran-lapack
2
+
This package provides precision-agnostic, 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
5
+
6
+
[The documentation site](https://perazz.github.io/fortran-lapack/index.html) contains full documentation for the library.
7
+
4
8
Procedure | Type | Description | Optional arguments
5
9
--- | --- | --- | ---
6
10
`solve(A,b)` | function | Solve linear systems - one (`b(:)`) or many (`b(:,:)`) | `solve(A,b,overwrite_a,err)`: option to let A be destroyed, return state handler `err`
All procedures work with all types (`real`, `complex`) and kinds (32, 64, 128-bit floats).
27
31
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.
32
+
# BLAS, LAPACK
33
+
Modern Fortran modules with full explicit typing features are available as modules `la_blas` and `la_lapack`.
34
+
The reference Fortran-77 library, forked from Release 3.10.1, was automatically processed and modernized.
32
35
The following refactorings are applied:
33
36
- All datatypes and accuracy constants standardized into a module (`stdlib`-compatible names)
34
37
- Both libraries available for 32, 64 and 128-bit floats
@@ -54,13 +57,32 @@ To add fortran-lapack to your project, simply add it as a dependency:
`fortran-lapack` is compatible with the LAPACK API. If high-performance external BLAS/LAPACK libraries are available, it is sufficient to define macros
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:
70
+
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`.
71
+
The naming convention is:
72
+
73
+
Type | 32-bit | 64-bit | 128-bit
74
+
--- | --- | --- | ---
75
+
real | `s` | `d` | `q`
76
+
complex | `c` | `z` | `w`
77
+
78
+
All public interfaces in `la_blas` and `la_lapack` allow seamless linking against external libraries via a simple pre-processor flag.
79
+
When an external library is available, just define macros `LA_EXTERNAL_BLAS` and `LA_EXTERNAL_LAPACK`. The kind-agnostic interface
80
+
will just point to the external function. All such interfaces follow this template:
60
81
61
82
```fortran
62
-
#ifdef EXTERNAL_BLAS
63
-
interface
83
+
interface axpy
84
+
#ifdef LA_EXTERNAL_BLAS
85
+
! Use external library
64
86
pure subroutine saxpy(n, a, x, incx, y, incy)
65
87
import :: ik, sp
66
88
integer, parameter :: wp = sp
@@ -71,12 +93,11 @@ interface
71
93
real(wp), intent(inout) :: y(*)
72
94
integer(ik), intent(in) :: incy
73
95
end subroutine saxpy
74
-
end interface
75
96
#else
76
-
interface saxpy
77
-
module procedure stdlib_saxpy
78
-
end interface
97
+
! Use internal implementation
98
+
module procedure la_saxpy
79
99
#endif
100
+
end interface
80
101
```
81
102
82
103
# Licensing
@@ -86,4 +107,4 @@ The license used for the software is the [modified BSD license](https://www.netl
86
107
According to the original license, we changed the name of the routines and commented the changes made to the original.
87
108
88
109
# Acknowledgments
89
-
The development of this package is supported by the [Sovereign Tech Fund](https://www.sovereigntechfund.de).
110
+
Part of this work was supported by the [Sovereign Tech Fund](https://www.sovereigntechfund.de).
0 commit comments