Skip to content

Conversation

LucasBoTang
Copy link
Contributor

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

  • Added interface.c and interface.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.
  • Updated README.md:
    • New section C API Example, with detailed documentation and sample code.
  • Added a small test program under test/ that demonstrates solving a toy LP using the interface.

@@ -0,0 +1,37 @@
#!/bin/bash
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants