enhance `coo2csr` procedure by allowing to internally sort the coo matrix
Motivation
In https://github.com/fortran-lang/stdlib/pull/1034#discussion_r2404572171 a discussion about sparse transformation for linear systems was opened.
Currently, if one first creates a COO matrix, it is requested to:
call coo2sorted( COO,sort_data) : sort and ensure unique (i,j,v) entries. This procedure reallocates the COO matrix to remove duplicates.
call coo2csr(COO,CSR) : assumes COO is sorted and unique
It could be possible to enhance the second call with a boolean flag to carry out both steps with a single call.
Prior Art
No response
Additional Information
No response
Could it be something like:
call coo2csr(COO, CSR, [coo_sorted])
with coo_sorted=.true. is COO is sorted, and coo_sorted=.false. is COO must be sorted by coo2csr . The default would be .false., such there is no assumption that the user provides a sorted COO.