-
Notifications
You must be signed in to change notification settings - Fork 4
Add C API interface #3
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
base: main
Are you sure you want to change the base?
Conversation
Bug fixed: memory leak
Unify `solve_lp_problem` API to return `cupdlpx_result_t*`
Added C API section with example for solving LPs.
@@ -0,0 +1,37 @@ | |||
#!/bin/bash |
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.
Do we really want to upload this file to GitHub? This is already the test/test.sh
file. Maybe merge these two?
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.
These two tests are not the same: one runs from bash and reads an MPS file, while the other directly passes in coefficients. They exercise different code paths (file I/O parsing vs. API interface), so both are valuable to keep.
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.
Summary
This PR introduces a new C API interface (
interface.c
/interface.h
) that allows users to directly construct and solve LPs from in-memory data structures, without requiring MPS files.Key Changes
interface.c
andinterface.h
:make_problem_from_matrix(...)
for constructing LP problems from dense/CSR/CSC/COO matrices.solve_lp_problem(...)
for solving the constructed problems with optional custom PDHG parameters.README.md
:test/
that demonstrates solving a toy LP using the interface.