Declare a dolfin::matrix with size mxn

Asked by Nguyen Van Dang

Hello,

I would like to create a dolfin matrix with the size n
ex: dolfin::Matrix X(10, 10);
in c++ version.
I installed fenics recently but I can not declare like this. When I declared
dolfin::Matrix X;
I can compiled it without error. However, I can not run it. I took a look in http://dolfin.sourcearchive.com/documentation/0.9.8-1/Matrix_8h-source.html. Obviously, we can declare the dolfin matrix with a given size. Please help me.

Best regards

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Garth Wells (garth-wells) said :
#1

dolfin::Matrix is a sparse matrix, so is in general incomplete without a sparsity pattern. The Matrix(M, N) constructor throws an error in the most recent release.

Try using dolfin::uBLASSparseMatrix or dolfin::uBLASDenseMatrix.

Can you help with this problem?

Provide an answer of your own, or ask Nguyen Van Dang for more information if necessary.

To post a message you must log in.