|
| 1 | +C bindings for the DELAUNAYSPARSE Fortran package. |
| 2 | + |
| 3 | + |
| 4 | +REQUIREMENTS: |
| 5 | + |
| 6 | + A Fortran compiler that supports BIND(C). |
| 7 | + |
| 8 | +USAGE: |
| 9 | + |
| 10 | + Use the C bindings in delsparse_bind_c.f90 to call DELAUNAYSPARSE from |
| 11 | + inside a C/C++ program. |
| 12 | + |
| 13 | + Because C does not support optional arguments, there are 4 variations of |
| 14 | + DELAUNAYSPARSE{S|P}: |
| 15 | + * c_delaunaysparse{s|p} accepts none of the optional arguments; |
| 16 | + * c_delaunaysparse{s|p}_interp accepts an integer ir for specifying the |
| 17 | + dimension of the response variables, plus the two variables needed |
| 18 | + for computing the value of the interpolant, interp_in and interp_out; |
| 19 | + * c_delaunaysparse{s|p}_opts accepts all of the optional arguments |
| 20 | + EXCEPT interp_in and interp_out; |
| 21 | + * c_delaunaysparse{s|p}_interp_opts accepts all of the optional arguments, |
| 22 | + plus the response dimension ir, which cannot be inferred as it is by |
| 23 | + the Fortran subroutines. |
| 24 | + |
| 25 | + When using the 4 subroutines above, keep in mind the following: |
| 26 | + * C passes by copy and Fortran passes by reference. Therefore, any non-array |
| 27 | + type variable must be manually passed by address (i.e., by using the `&` |
| 28 | + character); |
| 29 | + * C matrices are stored in row major ordering, while Fortran stores in |
| 30 | + column major ordering. Therefore, your data may need to be transposed |
| 31 | + before calling any of the above subroutines; |
| 32 | + * In C, a double-indexed array is treated as an array of pointers, whereas |
| 33 | + Fortran expects a contiguous chunk of memory. Often, it is better to |
| 34 | + allocate a one-dimensional array and manually index it, then pass this |
| 35 | + "flat" array to the Fortran subroutine. |
| 36 | + |
| 37 | + Usage examples are provided in the sample file, test_install.c. |
| 38 | + |
| 39 | +CONTRIBUTORS: |
| 40 | + |
| 41 | + |
| 42 | + |
0 commit comments