-
Notifications
You must be signed in to change notification settings - Fork 40
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
1 parent
35c3c73
commit bd02006
Showing
10 changed files
with
241 additions
and
163 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
# New C API | ||
|
||
The solver and problem definition options moved to a new `prima_options` struct | ||
that must be initialized before use with `prima_init_options`, | ||
and the results move to `prima_results`: | ||
The solver options and problem definition options moved to a new structs | ||
that must be initialized before use and the results moved also: | ||
``` | ||
prima_problem problem; | ||
prima_init_problem(&problem, n); | ||
problem.x0 = x0; | ||
prima_options options; | ||
prima_init_options(&options); | ||
options.iprint = PRIMA_MSG_EXIT; | ||
options.rhoend= 1e-3; | ||
options.maxfun = 200*n; | ||
prima_results results; | ||
const int rc = prima_bobyqa(&fun, n, x, &options, &results); | ||
prima_free_options(&options); | ||
prima_free_results(&results); | ||
prima_result result; | ||
const int rc = prima_bobyqa(&fun, &problem, &options, &result); | ||
prima_free_problem(&problem); | ||
prima_free_result(&result); | ||
``` | ||
Both should be freed after use with their dedicated free function. | ||
Problem and result structs should be freed after use with their dedicated free function. |
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
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
Oops, something went wrong.