librarylink – Mathematica call C++ Eigen to calculate sparsematrix multiplication

I want to use the C++ Eigen library in Mathematica’s LibraryLink function.

In the past, matheorem called C++ Eigen in Mathematica successfully. However, I am not familiar with the call between different languages, especially the call to a language function package. I can not follow matheorem’s method, because I don’t even know where to put the Eigen package so that Mathematica can find it.

My goal is inputting two sparse matrices in Mathematica, and call C++ Eigen by LibraryLink to calculate their product.

The reason I want to call C++ Eigen is that the sparse matrices multiplication in Mathematica is very slow. I used LTemplate before. It provides a convenient way to call C++ Armadillo. After my verification, the time Armadillo sparse matrices multiplication cost is five sixth of Mathematica. Some people say that Eigen is faster than Armadillo in matrix multiplication, so I want to try.

This problem has been bothering me for a long time, and I would like to thank everyone for their suggestions.