Category : aliasing

I’m using Eigen, trying to minimize memory allocations and would like to do something like this: Eigen::SparseMatrix A(…); A.setFromTriplets(…); Eigen::MatrixXd X = <here some data>; Eigen::SparseLU<Eigen::SparseMatrix<double>> solver; solver.compute(A); // here comes the crucial thing I want to do: X = solver.solve(X); The documentation doesn’t say much about it. I’ve tested it with many matrices A ..

Read more

I was working on highly "vectorizable" code and noted that regarding the C++ __restrict keyword/extension ~, Clang’s behavior is different and impractical compared to GCC even in a simple case. For compiler generated code, the slowdown is about 15x (in my specific case, not the exemple below). Here is the code (also available at https://godbolt.org/z/sdGd43x75): ..

Read more