← Back to team overview

dolfin team mailing list archive

Re: down_cast for Matrix

 

On Thursday 18 September 2008 03:21:23 Ostien, Jakob T wrote:
> Hi,
>
> I got myself confused with the down_cast functionality.  Say I assemble
> three bilinear forms into Matrix A, B, and C, and then consider the
> expression:
>
> K  = A - A (B^-1) C
>
> (which I actually want to do, go figure).  I like the uBLAS backend so I
> would like to try
>
> A.mat() - ublas::prod( A.mat(), ublas::prod( B.invert(), C.mat() ) )
>
> But when I try and down_cast from dolfin::Matrix to uBLASMatrix with
>
> uBLASDenseMatrix AA = A.down_cast<uBLASDenseMatrix>();

Hello!

Did you mean:

  dolfin::uBLASMatrix AA = A.down_cast<dolfin::uBLASMatrix>()

Otherwise you should try that! :)

Johan

> I get a message that down_cast doesn't live in the Matrix class (even
> though its in the GenericTensor class).
>
> So I ask, what is the intended usage to get a uBLASMatrix from a Matrix?
>
> Thanks,
> Jake
>
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev




Follow ups

References