Skip to content

Add C interface to HiPO linear solver#3066

Draft
filikat wants to merge 40 commits into
latestfrom
hipo-c
Draft

Add C interface to HiPO linear solver#3066
filikat wants to merge 40 commits into
latestfrom
hipo-c

Conversation

@filikat

@filikat filikat commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Changes requested in order to use the HiPO linear solver within UNO.

New features:

  • pivoting can now be switched off at runtime.
  • the expected sign of a pivot, used by the factorisation to decide how to perform dynamic regularisation, can now be unknown.
  • the interface to the linear solver now uses pointers T* instead of std::vector<T>.
  • logging for errors or statistics of the linear solver can now use printf, if HiGHS logging is not available.
  • a function to compute the inertia of the factorisation has been added.
  • the linear solver can now be used outside of HiGHS, through the C API in highs/ipm/hipo/factorhighs/FactorHighs_c_api.h. An example is provided in highs/ipm/hipo/factorhighs/FactorHighs_c_api_example.c.

@filikat

filikat commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

@amontoison @cvanaret could you have a look and check if these changes are ok?

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0.22989% with 434 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.85%. Comparing base (666909f) to head (2581f1c).
⚠️ Report is 7 commits behind head on latest.

Files with missing lines Patch % Lines
highs/ipm/hipo/factorhighs/FactorHighs.cpp 0.00% 93 Missing ⚠️
highs/ipm/hipo/factorhighs/HybridSolveHandler.cpp 0.00% 76 Missing ⚠️
highs/ipm/hipo/factorhighs/FactorHighs_c_api.cpp 0.00% 47 Missing ⚠️
highs/ipm/hipo/ipm/FactorHighsSolver.cpp 0.00% 41 Missing ⚠️
highs/ipm/hipo/factorhighs/Numeric.cpp 0.00% 37 Missing ⚠️
highs/ipm/hipo/factorhighs/DenseFactKernel.cpp 0.00% 27 Missing ⚠️
highs/ipm/hipo/factorhighs/Analyse.cpp 0.00% 26 Missing ⚠️
highs/ipm/hipo/auxiliary/Auxiliary.cpp 0.00% 15 Missing ⚠️
highs/ipm/hipo/factorhighs/Factorise.cpp 0.00% 14 Missing ⚠️
highs/ipm/hipo/ipm/KktMatrix.cpp 0.00% 12 Missing ⚠️
... and 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #3066      +/-   ##
==========================================
- Coverage   73.04%   72.85%   -0.19%     
==========================================
  Files         426      428       +2     
  Lines      102324   102592     +268     
  Branches    16459    16522      +63     
==========================================
+ Hits        74745    74747       +2     
- Misses      27303    27569     +266     
  Partials      276      276              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@filikat

filikat commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

@amontoison the C API is more or less ready. Please have a look at highs/ipm/hipo/factorhighs/FactorHighs_c_api.h and highs/ipm/hipo/factorhighs/FactorHighs_c_api_example.h.

@cvanaret it's better if you use the C API as well, rather then CPP. I set up the C API to be usable outside of HiGHS, so that it automatically sets up everything by itself. If you want to use the CPP interface, you would need to perform the actions in FactorHighs_initialise and FactorHighs_terminate explicitly.

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.

1 participant