On 09/18/2016 10:01 AM, 'Franck Kalala' via deal.II User Group wrote:

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

Do you actually need to form the product matrix? Or are you only interested in *applying* this matrix to vectors?

In the latter case, the operation
  diag(V) * vec
can be achieved using the Vector::scale() function.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
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