Documentation of Aos

This commit is contained in:
Anthony Scemama 2022-01-05 15:56:25 +01:00
parent 531c1d4a2d
commit 1be1a99529
2 changed files with 1112 additions and 771 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,17 +19,19 @@
** Table of function arguments
#+NAME: test
| ~qmckl_context~ | ~context~ | in | Global state |
| ~char~ | ~transa~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed |
| ~char~ | ~transb~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed |
| ~int64_t~ | ~m~ | in | Number of points in the first set |
| ~int64_t~ | ~n~ | in | Number of points in the second set |
| ~double~ | ~A[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ |
| ~int64_t~ | ~lda~ | in | Leading dimension of array ~A~ |
| ~double~ | ~B[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ |
| ~int64_t~ | ~ldb~ | in | Leading dimension of array ~B~ |
| ~double~ | ~C[n][ldc]~ | out | Array containing the $m \times n$ matrix $C$ |
| ~int64_t~ | ~ldc~ | in | Leading dimension of array ~C~ |
| Variable | Type | In/Out | Description |
|-----------+------------------+--------+-----------------------------------------------|
| ~context~ | ~qmckl_context~ | in | Global state |
| ~transa~ | ~char~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed |
| ~transb~ | ~char~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed |
| ~m~ | ~int64_t~ | in | Number of points in the first set |
| ~n~ | ~int64_t~ | in | Number of points in the second set |
| ~A~ | ~double[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ |
| ~lda~ | ~int64_t~ | in | Leading dimension of array ~A~ |
| ~B~ | ~double[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ |
| ~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
@ -74,9 +76,9 @@ def parse_table(table):
result = []
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(),
"name" : line[1],
"name" : line[0],
"comment" : line[3] }
# Handle inout
@ -88,7 +90,7 @@ def parse_table(table):
d["inout"] == "inout"
# 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
if d["rank"] == 0:
d["dims"] = []
@ -133,6 +135,22 @@ return template
#+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
#+NAME: generate_c_interface