Franck,

> How to perform the matrix multiplication
>
> A*diag(V)

There is no function inside the library to do this, but you can write
it yourself by scaling the entry a_ij by v_i. Code should be something
like this (not tested):

  for (SparseMatrix<double>::iterator it=A.begin();it!=A.end(); ++it)
    it->value() = it->value * v[it->column()];

Best,
Timo

On Sun, Sep 18, 2016 at 12:01 PM, 'Franck Kalala' via deal.II User
Group <dealii@googlegroups.com> wrote:
> I am having a SparseMatrix A which has a certain sparsity pattern and a
> vector V.
>
> How to perform the matrix multiplication
>
> A*diag(V)
>
> where diag(V) is a diagonal matrix with the vector V in the main diagonal.
>
> is there any such function in dealii?
>
> how to create the SparseMatrix diag(V) for a given vector V?
>
> to my knowledge dealii on provided
>
> A.mmult(C,B,V)  for   C= A*diag(V)*B or
>
> A.mmult(C,B)  for   C= A*B
>
> Cheers
>
> --
> The deal.II project is located at 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_&d=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=nutqCiVLmVstYWjGLzjVBnkpm9fqmaOfCj5dSBZ-TZM&s=AzRYY0doLxrkmdpDhGlH6HDbgqaABDuNDwbbd0aM2GY&e=
>  
> For mailing list/forum options, see
> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_forum_dealii-3Fhl-3Den&d=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=nutqCiVLmVstYWjGLzjVBnkpm9fqmaOfCj5dSBZ-TZM&s=7v1hoCoTBoEMxL_KX9Daw91tj6p8_JXh4CUuacMt1Sg&e=
>  
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+unsubscr...@googlegroups.com.
> For more options, visit 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=nutqCiVLmVstYWjGLzjVBnkpm9fqmaOfCj5dSBZ-TZM&s=tMPN5KkkAsE6vymVUM-x3zYLWLqrNf_ZjIcVzniBkDk&e=
>  .



-- 
Timo Heister
http://www.math.clemson.edu/~heister/

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to