mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-07-22 10:47:45 +02:00
Documentation of Aos
This commit is contained in:
parent
531c1d4a2d
commit
1be1a99529
1829
org/qmckl_ao.org
1829
org/qmckl_ao.org
File diff suppressed because it is too large
Load Diff
@ -19,17 +19,19 @@
|
|||||||
** Table of function arguments
|
** Table of function arguments
|
||||||
|
|
||||||
#+NAME: test
|
#+NAME: test
|
||||||
| ~qmckl_context~ | ~context~ | in | Global state |
|
| Variable | Type | In/Out | Description |
|
||||||
| ~char~ | ~transa~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed |
|
|-----------+------------------+--------+-----------------------------------------------|
|
||||||
| ~char~ | ~transb~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed |
|
| ~context~ | ~qmckl_context~ | in | Global state |
|
||||||
| ~int64_t~ | ~m~ | in | Number of points in the first set |
|
| ~transa~ | ~char~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed |
|
||||||
| ~int64_t~ | ~n~ | in | Number of points in the second set |
|
| ~transb~ | ~char~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed |
|
||||||
| ~double~ | ~A[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ |
|
| ~m~ | ~int64_t~ | in | Number of points in the first set |
|
||||||
| ~int64_t~ | ~lda~ | in | Leading dimension of array ~A~ |
|
| ~n~ | ~int64_t~ | in | Number of points in the second set |
|
||||||
| ~double~ | ~B[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ |
|
| ~A~ | ~double[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ |
|
||||||
| ~int64_t~ | ~ldb~ | in | Leading dimension of array ~B~ |
|
| ~lda~ | ~int64_t~ | in | Leading dimension of array ~A~ |
|
||||||
| ~double~ | ~C[n][ldc]~ | out | Array containing the $m \times n$ matrix $C$ |
|
| ~B~ | ~double[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ |
|
||||||
| ~int64_t~ | ~ldc~ | in | Leading dimension of array ~C~ |
|
| ~ldb~ | ~int64_t~ | in | Leading dimension of array ~B~ |
|
||||||
|
| ~C~ | ~double[n][ldc]~ | out | Array containing the $m \times n$ matrix $C$ |
|
||||||
|
| ~ldc~ | ~int64_t~ | in | Leading dimension of array ~C~ |
|
||||||
|
|
||||||
|
|
||||||
*** Fortran-C type conversions
|
*** Fortran-C type conversions
|
||||||
@ -74,9 +76,9 @@ def parse_table(table):
|
|||||||
result = []
|
result = []
|
||||||
|
|
||||||
for line in [ [x.replace('~','') for x in y] for y in table]:
|
for line in [ [x.replace('~','') for x in y] for y in table]:
|
||||||
d = { "c_type" : line[0],
|
d = { "c_type" : line[1].split('[')[0],
|
||||||
"inout" : line[2].lower(),
|
"inout" : line[2].lower(),
|
||||||
"name" : line[1],
|
"name" : line[0],
|
||||||
"comment" : line[3] }
|
"comment" : line[3] }
|
||||||
|
|
||||||
# Handle inout
|
# Handle inout
|
||||||
@ -88,7 +90,7 @@ def parse_table(table):
|
|||||||
d["inout"] == "inout"
|
d["inout"] == "inout"
|
||||||
|
|
||||||
# Find dimensions (replace [] by [*] to get * in Fortran dimensions)
|
# Find dimensions (replace [] by [*] to get * in Fortran dimensions)
|
||||||
dims = d["name"].replace("[]","[*]").split('[')
|
dims = d["c_type"].replace("[]","[*]").split('[')
|
||||||
d["rank"] = len(dims) - 1
|
d["rank"] = len(dims) - 1
|
||||||
if d["rank"] == 0:
|
if d["rank"] == 0:
|
||||||
d["dims"] = []
|
d["dims"] = []
|
||||||
@ -133,6 +135,22 @@ return template
|
|||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
#+RESULTS: generate_c_header
|
||||||
|
#+begin_src c :tangle (eval h_func) :comments org
|
||||||
|
[] [] (
|
||||||
|
const context qmckl_context,
|
||||||
|
const transa char,
|
||||||
|
const transb char,
|
||||||
|
const m int64_t,
|
||||||
|
const n int64_t,
|
||||||
|
const A* double,
|
||||||
|
const lda int64_t,
|
||||||
|
const B* double,
|
||||||
|
const ldb int64_t,
|
||||||
|
C* const double,
|
||||||
|
const ldc int64_t );
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** Generates a C interface to the Fortran function
|
*** Generates a C interface to the Fortran function
|
||||||
|
|
||||||
#+NAME: generate_c_interface
|
#+NAME: generate_c_interface
|
||||||
|
Loading…
Reference in New Issue
Block a user