mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-09 04:43:28 +01:00
Add fortran interface
This commit is contained in:
parent
90212829ee
commit
37a408c9dd
@ -1,6 +1,7 @@
|
|||||||
#+TITLE: Sherman-Morrison-Woodbury
|
#+TITLE: Sherman-Morrison-Woodbury
|
||||||
#+SETUPFILE: ../tools/theme.setup
|
#+SETUPFILE: ../tools/theme.setup
|
||||||
#+INCLUDE: ../tools/lib.org
|
#+INCLUDE: ../tools/lib.org
|
||||||
|
#+STARTUP: content
|
||||||
|
|
||||||
Low- and high-level functions that use the Sherman-Morrison and
|
Low- and high-level functions that use the Sherman-Morrison and
|
||||||
Woodbury matrix inversion formulas to update the inverse of a
|
Woodbury matrix inversion formulas to update the inverse of a
|
||||||
@ -95,7 +96,26 @@ int main() {
|
|||||||
double* Slater_inv );
|
double* Slater_inv );
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Source
|
*** Fortran source
|
||||||
|
|
||||||
|
#+begin_src c :tangle (eval c) :comments org
|
||||||
|
integer function qmckl_sherman_morrison_f(context, Dim, N_updates, Updates, &
|
||||||
|
Updates_index, breakdown, Slater_inv) result(info)
|
||||||
|
use qmckl
|
||||||
|
implicit none
|
||||||
|
integer(qmckl_context) , intent(in) :: context
|
||||||
|
integer*8 , intent(in) :: Dim, N_updates
|
||||||
|
integer*8 , intent(in) :: Updates_index(N_updates)
|
||||||
|
real*8 , intent(in) :: breakdown
|
||||||
|
real*8 , intent(in) :: Updates(N_updates*Dim)
|
||||||
|
real*8 , intent(inout) :: Slater_inv(Dim*Dim)
|
||||||
|
info = qmckl_sherman_morrison(context, Dim, N_updates, Updates, &
|
||||||
|
Updates_index, breakdown, Slater_inv)
|
||||||
|
)
|
||||||
|
end function qmckl_sherman_morrison_f
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** C source
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c) :comments org
|
#+begin_src c :tangle (eval c) :comments org
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
@ -169,6 +189,8 @@ qmckl_exit_code qmckl_sherman_morrison_c(const qmckl_context context,
|
|||||||
|
|
||||||
#+CALL: generate_c_interface(table=qmckl_sherman_morrison_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
|
#+CALL: generate_c_interface(table=qmckl_sherman_morrison_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
|
||||||
|
|
||||||
|
#+RESULTS:
|
||||||
|
|
||||||
#+CALL: generate_f_interface(table=qmckl_sherman_morrison_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
|
#+CALL: generate_f_interface(table=qmckl_sherman_morrison_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
|
||||||
|
|
||||||
*** Test :noexport:
|
*** Test :noexport:
|
||||||
|
Loading…
Reference in New Issue
Block a user