Comments (1)
With
diff --git a/src/interfaces/highs_c_api.cpp b/src/interfaces/highs_c_api.cpp
index 821b39e18..5806b60f1 100644
--- a/src/interfaces/highs_c_api.cpp
+++ b/src/interfaces/highs_c_api.cpp
@@ -463,6 +463,9 @@ HighsInt Highs_getBasis(const void* highs, HighsInt* col_status,
for (HighsInt i = 0; i < (HighsInt)basis.row_status.size(); i++) {
row_status[i] = (HighsInt)basis.row_status[i];
}
+ if (!basis.valid) {
+ return kHighsStatusError;
+ }
return kHighsStatusOk;
}
and
#include "interfaces/highs_c_api.h"
#include <stdlib.h>
#include <assert.h>
int main(int argc, char *argv[]) {
void* highs = Highs_create();
double inf = Highs_getInfinity(highs);
int num_col = 2;
int num_row = 1;
int num_nz = 2;
int q_num_nz = 3;
int a_format = kHighsMatrixFormatColwise;
int q_format = kHighsHessianFormatTriangular;
int sense = kHighsObjSenseMinimize;
double offset = 0.0;
double col_cost[] = {1.0, 1.0};
double col_lower[] = {-inf, -inf};
double col_upper[] = {inf, inf};
double row_lower[] = {-inf};
double row_upper[] = {-1.0};
int a_start[] = {0, 1};
int a_index[] = {0, 0};
double a_value[] = {1.0, 1.0};
int q_start[] = {0, 2};
int q_index[] = {0, 1, 1};
double q_value[] = {4.0, 1.0, 2.0};
int integrality[] = {kHighsVarTypeContinuous, kHighsVarTypeContinuous};
int ret;
ret = Highs_passModel(highs, num_col, num_row, num_nz, q_num_nz, a_format,
q_format, sense, offset, col_cost, col_lower,
col_upper, row_lower, row_upper, a_start, a_index,
a_value, q_start, q_index, q_value, NULL);
assert(ret == 0);
ret = Highs_run(highs);
assert(ret == 0);
int col_basis_status[] = {-123, -123};
int row_basis_status[] = {-123};
ret = Highs_getBasis(highs, col_basis_status, row_basis_status);
assert(ret == 0);
Highs_destroy(highs);
return 0;
}
I get
(base) oscar@Oscars-MBP examples % export highs=/Users/Oscar/Documents/Code/HiGHS/build;
(base) oscar@Oscars-MBP examples % export DYLD_LIBRARY_PATH=$highs/lib; ./main
Running HiGHS 1.5.1 [date: 2023-04-12, git hash: 46574b917-dirty]
Copyright (c) 2023 HiGHS under MIT licence terms
0, 1.000000, 1, 0.000768, 0.000000, 0, 0.000000, 0.000000
3, -0.125000, 1, 0.000844, 0.000000, 0, 0.000000, 1.000000
Model status : Optimal
QP ASM iterations: 3
Objective value : -1.2500000000e-01
HiGHS run time : 0.00
Assertion failed: (ret == 0), function main, file main.c, line 40.
zsh: abort ./main
Let me know if you want me to make a PR. At the very least, we should signal that the basis isn't valid instead of always returning kHighsStatusOk
.
from highs.jl.
Related Issues (20)
- time_limit is not respected HOT 4
- HiGHS_jll 1.5.3 not allowed? HOT 1
- time_limit behavior? HOT 3
- Bug in copy_to HOT 1
- Add support for HiGHS v1.6.0
- Julia threads and HiGHS `threads` interaction HOT 11
- LoadError: could not load symbol "Highs_zeroAllClocks" HOT 2
- v1.7 fails to precompile due to ObjectiveLimit not defined HOT 7
- Time limit not compliant with MOI interface HOT 3
- [documentation] Banner to indicate documentation version HOT 3
- Add ability to reset basis matrix HOT 3
- [MOI] allow batch modification HOT 1
- [MOI] Allow modifications in quadratic function
- HiGHS zlib support HOT 6
- Modify-after-free bug HOT 14
- HiGHS v1.7 HOT 2
- Numerical Bounds Check is slow HOT 6
- Solution and incumbent are different HOT 2
- `Highs_resetGlobalScheduler` not defined HOT 2
- Non-convex QPs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highs.jl.