Forum Discussion

FICO's avatar
FICO
Community Manager
3 years ago

Removing O(rows) in XPRSbtran and XPRSftran

XPRSbtran and XPRSftran takes a dense array as input, hence there will be at least one scan over the basis dimension. If you solve multiple times the the extra complexity becomes a bottleneck, since we don't exploit sparsity to the fullest.

Is it possible to have regular sparse solves i.e input and output as a sparse vector ? If not is it something you will consider adding :-)

2 Replies

  • FICO's avatar
    FICO
    Community Manager

    Hi Bo,

    we did actually already implement those as XPRSsparseftran and XPRSsparsebtran, and they should already be available. They are undocumented as of now, but they are already in use elsewhere so should have sufficient testing and we will look into fully documenting them for the next release. For example for ftran, the call should be

    int XPRS_CC XPRSsparseftran(XPRSprob prob, double val[], int ind[], int* p_ncoefs)

    where vec is the sparse vector to be multiplied by the basis inverse on input and the result of the transformation on output, ind are the corresponding indices and p_ncoefs is the number of elements which will also get overwritten by the corresponding value for the result of the transformation.

    int XPRS_CC XPRSsparsebtran(XPRSprob prob, double val[], int ind[], int* p_ncoefs)

    works exactly the same. (And like the dense ones, these will also not be thread-safe at the moment.)

    Best,

    Tristan

  • FICO's avatar
    FICO
    Community Manager

    Thank you, I did not know there was a sparse version already, so that's great. It's good enough for now to know that it can be made thread safe if needed. I am working on a proto type idea, so for now I will not make it run in parallel.