ralna / spral

Sparse Parallel Robust Algorithms Library
https://ralna.github.io/spral/
Other
102 stars 27 forks source link

Use malloc and variably-modified types for SSMFE C interface tests and examples #171

Closed mjacobse closed 8 months ago

mjacobse commented 8 months ago

On Windows, the tests ran out of stack space due to the many variable-length arrays on the stack (as found out in #162). So allocating on the heap with malloc instead. Fixes #156

To still be able to do all the matrix indexing, we use variably-modified types (also described in #162). That requires dereferencing to be added in many places and makes the syntax a bit unfamiliar, but it does avoid having to do the indexing manually. So to me this solution would be preferrable.

If the solution using manual indexing is preferred (https://github.com/mjacobse/spral/commit/b61dc5a6c2348647fefad0d1c9e93f1eaf35e453), let me know and I can create a pull request with that instead.