-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
50,360 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Tyler H. Chang, Layne T. Watson, Thomas C. H. Lux, | ||
Ali R. Butt, Kirk W. Cameron, and Yili Hong. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FORT = gfortran | ||
CC = gcc | ||
CFLAGS = -c | ||
OPTS = -fopenmp | ||
LIBS = blas.f lapack.f | ||
LEGACY = -std=legacy | ||
|
||
all: test_install.o delsparse_bind_c.o delsparse.o slatec.o delsparse.h | ||
$(FORT) $(OPTS) test_install.o delsparse_bind_c.o delsparse.o slatec.o $(LIBS) -o test_install | ||
./test_install | ||
|
||
test_install.o: test_install.c | ||
$(CC) $(CFLAGS) test_install.c -o test_install.o | ||
|
||
delsparse_bind_c.o: delsparse_bind_c.f90 delsparse.o | ||
$(FORT) $(CFLAGS) $(OPTS) delsparse_bind_c.f90 -o delsparse_bind_c.o | ||
|
||
delsparse.o: delsparse.f90 | ||
$(FORT) $(CFLAGS) $(OPTS) delsparse.f90 -o delsparse.o | ||
|
||
slatec.o : slatec.f | ||
$(FORT) $(CFLAGS) $(OPTS) $(LEGACY) slatec.f -o slatec.o | ||
|
||
clean: | ||
rm -f *.o *.mod test_install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
C bindings for the DELAUNAYSPARSE Fortran package. | ||
|
||
|
||
REQUIREMENTS: | ||
|
||
A Fortran compiler that supports BIND(C). | ||
|
||
USAGE: | ||
|
||
Use the C bindings in delsparse_bind_c.f90 to call DELAUNAYSPARSE from | ||
inside a C/C++ program. | ||
|
||
Because C does not support optional arguments, there are 4 variations of | ||
DELAUNAYSPARSE{S|P}: | ||
* c_delaunaysparse{s|p} accepts none of the optional arguments; | ||
* c_delaunaysparse{s|p}_interp accepts an integer ir for specifying the | ||
dimension of the response variables, plus the two variables needed | ||
for computing the value of the interpolant, interp_in and interp_out; | ||
* c_delaunaysparse{s|p}_opts accepts all of the optional arguments | ||
EXCEPT interp_in and interp_out; | ||
* c_delaunaysparse{s|p}_interp_opts accepts all of the optional arguments, | ||
plus the response dimension ir, which cannot be inferred as it is by | ||
the Fortran subroutines. | ||
|
||
When using the 4 subroutines above, keep in mind the following: | ||
* C passes by copy and Fortran passes by reference. Therefore, any non-array | ||
type variable must be manually passed by address (i.e., by using the `&` | ||
character); | ||
* C matrices are stored in row major ordering, while Fortran stores in | ||
column major ordering. Therefore, your data may need to be transposed | ||
before calling any of the above subroutines; | ||
* In C, a double-indexed array is treated as an array of pointers, whereas | ||
Fortran expects a contiguous chunk of memory. Often, it is better to | ||
allocate a one-dimensional array and manually index it, then pass this | ||
"flat" array to the Fortran subroutine. | ||
|
||
Usage examples are provided in the sample file, test_install.c. | ||
|
||
CONTRIBUTORS: | ||
|
||
Tyler Chang, [email protected] | ||
|
Oops, something went wrong.