dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #12995
matrix-matrix multiplication
hi,
I've been having a problem of calculating sparse matrix-matrix multiplication using uBLASSparseMatrix.
I declare matrices A and B as following.
Matrix A0;
uBLASSparseMatrix& A(A0.down_cast<uBLASSparseMatrix>());
Matrix B0;
uBLASSparseMatrix& B(B0.down_cast<uBLASSparseMatrix>());
After assigning matrix values, use "prod" from boost to multiply. but, I don't know where to return. From compiler error 'ublas_sparse_matrix' is not a member of ‘boost::numeric::ublas’. even if I use 'matrix' as follows, I don't know how to make this into uBLASSparseMatrix.
boost::numeric::ublas::matrix<double> C;
C = boost::numeric::ublas::prod(A.mat(), B.mat());
My first guess was to declare
uBLASSpareseMatrix& C1(C);
but this will give a compiler error "‘uBLASSpareseMatrix’ was not declared in this scope"
I would greatly appreciate any helpful suggestion.
Thank you,
Nana Arizumi
Follow ups