Created
June 4, 2019 19:41
-
-
Save alphaville/ca71548e1b1fdd0add63996fbe347811 to your computer and use it in GitHub Desktop.
Compilation of auto-generated C file (C bindings to Rust code)
This file contains hidden or 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
| /* Compile with: | |
| * gcc optimizer.c -l:libthe_optimizer.a -L./target/debug -pthread -lm -ldl -o optimizer -Wall | |
| */ | |
| #include <stdio.h> | |
| #include "open_bindings.h" | |
| int main() { | |
| HomotopyCache * y = solver_new(); | |
| const double p[2] = {1.0, 10.0}; | |
| double u[5] = {0}; | |
| CHomotopySolverStatus status = solver_solve(y, u, p); | |
| int i; | |
| for (i=0; i<5; ++i) { | |
| printf("u[%d] = %g\n", i, u[i]); | |
| } | |
| printf("exit status = %d\n", status.exit_status); | |
| printf("iterations = %lu\n", status.num_inner_iterations); | |
| printf("outer iterations = %lu\n", status.num_outer_iterations); | |
| solver_free(y); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment