Let's say A and B are sparse matrices with complex values, which are stored in sparse handles (CSR format). I want to calculate D = A x conjugate(B), where conjugate is the complex conjugate of matrix B entries. Is there an efficient way to perform this multiplication? Right now, I have to export the sparse handle that contains matrix B to a CSR 3-array format, change the values to complex conjugate, create the handle again, and then perform the multiplication. I really appreciate if you can provide a more efficient solution.
The most flexible interface to sparse matrix-matrix multiplication is currently given by mkl_sparse_sp2m, https://software.intel.com/en-us/mkl-developer-reference-c-mkl-sparse-sp2m. This routine doesn't support just conjugation of an operand (but rather conjugate transpose). So, what you did with manually conjugating the values is the most efficient way. Of course, you could play with converters which will involve transposition but this would be slower.
Presumably taking the conjugation manually (say, by a simply parallelized openmp for-loop) will be negligible (in terms of time) in comparison to the matrix-matrix multiplication itself. I believe that a counterexample will be a very special case. But if this turns out to be critical for you, please let us know.