-
-
Notifications
You must be signed in to change notification settings - Fork 47
[WIP] MATLAB interface #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stefphd
wants to merge
90
commits into
cvanaret:main
Choose a base branch
from
stefphd:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 34 commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
47929da
Renamed UNO_OPTION_TYPE_INT to UNO_OPTION_TYPE_INTEGER
stefphd 873c2df
Moved stream callbacks to UserModel.hpp
stefphd a4ae849
Added Vector(begin, end) constructor
stefphd c74073a
Added typed option getters
stefphd ce7ece0
Added Matlab MEX interface
stefphd 3bb120a
Create README for Matlab interface
stefphd ff6f04c
Added Matlab example
stefphd c322a01
Fixed missing include
stefphd c79b6bf
Matlab libut not required
stefphd 571f82b
Added explicit sparsity patterns in matlab interface
stefphd ea06c51
Updated matlab example to use explicit sparsity
stefphd d6474ec
Updated matlab README
stefphd 9f1a5b2
Simplified struct to option conversion
stefphd ef5fb87
Added conversion of matlab string to std::string
stefphd 2ade211
Accept matlab string in option preset
stefphd e731182
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd 28f2af1
Removed redundant callbacks in matlab interface
stefphd f671410
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd a7cdf6c
Updated matlab with number model evaluations
stefphd 35c8b36
Updated the matlab example
stefphd bdfb559
Added function argument validation
stefphd e364415
Reorganized matlab interface sources
stefphd e5c888c
Link matlab interface to uno default lib
stefphd 568e59b
Validate user callback outputs during optimization
stefphd 577b605
Removed unused functions
stefphd c83e3f5
Update example_hs015.m
stefphd d0b7d8b
Added matlab Polak5 example
stefphd 252f39f
Flip multiplier sign back before eval (data are copied)
stefphd 95bda52
Update example_polak5.m
stefphd fd716f3
Renamed validate_matlab_handle to validate_matlab_handle_field
stefphd 5e516dd
Added high-level Matlab interface
stefphd 0668266
Fixed missing (:) in uno.m
stefphd f333c0b
Fixed typo in Matlab readme
stefphd 26bade9
Added Test Matlab interface workflow
stefphd 7fe875b
Fixed typo in Matlab readme
stefphd 71b1b3d
Exclude auto build of Matlab interface
stefphd 9a4d24d
Try install Matlab files
stefphd f17e229
Added explicit error messages in Uno matlab interface
stefphd d9101e2
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd 9843722
Fixed unomex_optimize hessian and problem type
stefphd 09e3a74
Clear uno_optimize after calling uno
stefphd 3f5a38a
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd 799876c
Merged C API with main changes
stefphd cc4329a
unomex_* renamed to uno_
stefphd 16ae619
Added validate_string_field
stefphd eb36f1e
Added missing return
stefphd 88abf78
Updated Matlab examples with new problem_type
stefphd 390bd6b
Link Matlab libut in unomex-options target
stefphd 08bbf4f
Divided C++ classes for Matlab interface into multiple files
stefphd 6f6eca7
Added Matlab test example on MacOS
stefphd 0ddef43
Fixed platform in github workflow
stefphd b0f5d1d
Try adding fortran compiler in macod workflow
stefphd 2842a66
Fixed wrong slash in include
stefphd 1988033
Fixed wrong slash in include (missing)
stefphd 0fc34b5
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd 49165f3
Updated multiplier sign convention in Materlab interface
stefphd 752601d
compile the Unomex source files once
stefphd 8cce827
Try fix rpath for macos Matlab interface
stefphd 717131a
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd 6d55ff1
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd 3048834
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd c9c6e2d
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd e307407
Update C interface for breaking changes
stefphd 6feed33
Update CMakeLists.txt for breaking changes
stefphd 60a42e3
Remove old function members (not needed)
stefphd f1929ba
Update for braking changes in Uno interface
stefphd 73f56ea
Use HessianFnc to mimic Matlab fmincon
stefphd 6313475
Add minimum equired version
stefphd 732679e
Fix typo
stefphd 0c4e0bf
Update MATLAB documentation
stefphd 44b7943
Fix wrong matlab install dir
stefphd 7dbaaff
Make sure to print all messages into matlab command window
stefphd d51f8e4
Update matlab-test workflow
stefphd 75fc5ba
Fix wrong line separator in Windows configure
stefphd d825726
Try to add pause before exiting to avoid matlab crash
stefphd b5ba9c7
Remove pause (not wroking to avoid matlab crash)
stefphd 1f0ceb1
Use 'cmd' shell for Windows configure
stefphd d481125
Remove options.HessianFnc after use to avoid Uno warning
stefphd 6020886
Try to lock mex to prevent matlab crash on cleanup
stefphd 3a41b5c
Add link for mexLock() workaround
stefphd 8ffaa20
Merge branch 'main' of https://github.com/cvanaret/Uno
stefphd c5571ad
Add missing result fields
stefphd 1f5788d
Fix typo in error strings
stefphd 46657a8
Fix wrong line for initial_primal_iterate
stefphd cf05ae6
Handle the option preset
stefphd 63294c5
Added missing include
cvanaret 8b85f02
Removed LTO
cvanaret f901899
Fixed linking order of (C)BLAS
cvanaret 875e66f
Merge branch 'main' of https://github.com/stefphd/Uno
stefphd 4dff350
Fix wrong initial iterate for interior-point
stefphd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: Test the Matlab interface on the example | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| paths-ignore: | ||
| - '*.md' | ||
| - 'LICENSE' | ||
| - '*.cff' | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| paths-ignore: | ||
| - '*.md' | ||
| - 'LICENSE' | ||
| - '*.cff' | ||
|
|
||
| env: | ||
| BUILD_TYPE: Release | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [windows-latest] | ||
| architecture: [x64] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up MATLAB | ||
| uses: matlab-actions/setup-matlab@v2 | ||
|
|
||
| - name: Download dependency (BQPD) | ||
| shell: bash | ||
| run: | | ||
| VERSION_BQPD="1.0.0" | ||
| PLATFORM="x86_64-w64-mingw32" | ||
| choco install wget | ||
| wget https://github.com/leyffer/BQPD_jll.jl/releases/download/BQPD-v${VERSION_BQPD}%2B0/BQPD.v${VERSION_BQPD}.$PLATFORM-libgfortran5.tar.gz | ||
| mkdir deps | ||
| tar -xzvf BQPD.v${VERSION_BQPD}.$PLATFORM-libgfortran5.tar.gz -C deps | ||
|
|
||
| - name: add MinGW64 directory to path | ||
| run: echo "C:\tools\msys64\mingw64\bin" >> "$GITHUB_PATH" | ||
|
|
||
| - name: Configure Uno CMake | ||
| shell: cmd | ||
| run: | | ||
| cmake -G "MinGW Makefiles" -B ${{github.workspace}}\build ^ | ||
| -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ | ||
| -DBQPD=${{github.workspace}}\deps\lib\libbqpd.a | ||
|
|
||
| - name: Build uno | ||
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j4 | ||
|
|
||
| - name: Build unomex | ||
| run: cmake --build ${{github.workspace}}/build --target unomex --config ${{env.BUILD_TYPE}} -j4 | ||
|
|
||
| - name: Run example (high-level interface) | ||
| uses: matlab-actions/run-command@v2 | ||
| with: | ||
| command: | | ||
| addpath('build'); | ||
| run('interfaces/Matlab/example/example_uno.m') | ||
|
|
||
| - name: Run example (low-level interface) | ||
| uses: matlab-actions/run-command@v2 | ||
| with: | ||
| command: | | ||
| addpath('build'); | ||
| run('interfaces/Matlab/example/example_hs015.m') | ||
|
|
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you've verified this works with a particular matlab version I'd recommend pinning it on that version. There have been several minor changes in the mex behaviour over the past couple of versions that could cause unnecessary heartache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified up to release R2023b (corresponding to version 23.2).
Now minimum required version is 23.2, see commit 6313475.