Unclear sentence in examples #2502
-
|
Dear HiGHS community, mi was thinking of using HiGHS via the C interface and I was browning through the examples folder. I got to this sentence: // Note that a_start[0] must be zero You can find it here: HiGHS/examples/call_highs_from_c.c Line 41 in 8c76346 Why? The documentation states: “a_start is an array of length [num_col] containing the starting index of each column in a_index.” What if I do not have any non-nonzero elements in column 0? I’m confused. My apologies if it’s a stupid question, thank you for any clarification. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
If you have no nonzeros in column 0, then you set start_[1] to zero. Then a loop for (int i=start_[col], i<start_[col+1], i++) is vacuous for col=0 |
Beta Was this translation helpful? Give feedback.
-
|
My apologies, I had misunderstood the matrix format that HiGHS is expecting, which is kind-of CSC/CSR. "Kind of" because my understanding of the CSC format says: a_start: The pointers to the column offsets array of length number of columns + 1 that represents the starting position of each column in the columns and values arrays. While in HiGHS it seems to me that a_start is an array of length [num_col] containing the starting index of each column in a_index Unless of course I am misunderstanding again, which is quite possible. Will HiGHS complain if |
Beta Was this translation helpful? Give feedback.
The format is CSC except that HiGHS does not check
a_start[num_col], so the length need only benum_col. If you pass an array withnum_col+1elements HiGHS will ignore the last entry.