Thanks Alan, at the end I found the issue, I needed to index the SerialDense matrix as: (*blockM)[1][1] instead of: *blockM[1][1] it was probably just an issue with the pointer, what was misleading was that accessing the first line was working... cheers, andrea