Skip to content

Commit

Permalink
240331.202958.HKT Merge branch 'main' of github.com:libprima/prima
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Mar 31, 2024
2 parents 6db5dcf + 46e9f17 commit 1f4459c
Show file tree
Hide file tree
Showing 35 changed files with 76 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint_hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Set up MATLAB
id: set-up-matlab
if: ${{ matrix.linter == 'mlint' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: latest
cache: false # We should not cache MATLAB; otherwise, an empty directory will be cached since we remove $MATLABROOT in the next step
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/parallel_test_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'

- name: Set up MATLAB with optimization toolbox
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
products: Optimization_Toolbox Parallel_Computing_Toolbox
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/profile_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox == 'yes' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
products: Optimization_Toolbox Parallel_Computing_Toolbox

- name: Set up MATLAB without optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox != 'yes' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_all_sq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_bobyqa_small.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_bobyqa_small_sq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/profile_cobyla_small.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox == 'yes' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
products: Optimization_Toolbox Parallel_Computing_Toolbox

- name: Set up MATLAB without optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox != 'yes' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_cobyla_small_sq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_compiler_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true'}}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_infnan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_integer_kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/profile_lincoa_small.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox == 'yes' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
products: Optimization_Toolbox Parallel_Computing_Toolbox

- name: Set up MATLAB without optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox != 'yes' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_lincoa_small_sq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_newuoa_small.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_newuoa_small_sq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_npt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true'}}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/profile_prima_small.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox == 'yes' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
products: Optimization_Toolbox Parallel_Computing_Toolbox

- name: Set up MATLAB without optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' && matrix.with_optim_toolbox != 'yes' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_quadruple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_rescue_idz_classical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_rescue_idz_modernized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:

- name: Set up MATLAB with optimization toolbox
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_uobyqa_small.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile_uobyqa_small_sq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/recursive_test_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'

- name: Set up MATLAB with optimization toolbox
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stress_test_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'

- name: Set up MATLAB with optimization toolbox
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'

- name: Set up MATLAB
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_matlab_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'

- name: Set up MATLAB
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_matlab_mac_intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'

- name: Set up MATLAB
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_matlab_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat 2023"'

- name: Set up MATLAB
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_archiva.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_big.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_large.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_small.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

- name: Set up MATLAB
if: ${{ steps.check_matlab.outputs.has_matlab != 'true' }}
uses: matlab-actions/[email protected].0
uses: matlab-actions/[email protected].1
with:
release: ${{ matrix.matlab }}
cache: true
Expand Down
16 changes: 11 additions & 5 deletions c/include/prima/prima.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ int prima_init_options(prima_options_t *const options);


// Structure to hold the result
// prima_minimize will allocate the memory for x and nlconstr (if needed),
// and as such the user is expected to free the memory using prima_free_result
// once they are done using the contents of the result (or have saved the contents).
typedef struct {

// x: returned point
Expand Down Expand Up @@ -277,11 +280,14 @@ int prima_free_result(prima_result_t *const result);


/*
* The function that does the minimization using a PRIMA solver
* algorithm : optimization algorithm (see prima_algorithm)
* problem : optimization problem (see prima_problem)
* options : optimization options (see prima_options)
* result : optimization result (see prima_result)
* The function that does the minimization using a PRIMA solver.
* After using (or saving) the result, the user is expected to call
* prima_free_result, regardless of the return value of prima_minimize,
* in order to avoid memory leaks.
* algorithm : optimization algorithm (see prima_algorithm_t)
* problem : optimization problem (see prima_problem_t)
* options : optimization options (see prima_options_t)
* result : optimization result (see prima_result_t)
* return : see prima_rc_t enum for return codes
*/
PRIMAC_API
Expand Down
Loading

0 comments on commit 1f4459c

Please sign in to comment.