← Back to team overview

dolfin team mailing list archive

Re: GenericTensor and shared_ptr (update)

 

Or as a 4th option:

  4) Keep it as it is because the error only turns up when a matrix is
     down_casted, which is done in the la unit test. 
     This is a little risky as it should just work...

Johan

***************************************************************

It turns out that SWIG has introduced a regression wrt shared ptr handling in 
its 2.0.0 release. The bug causes things like GenericMatrix.data() to not 
work, as it expects a GenericMatrix but gets a subclass. So basically the swig 
handled upcast algorithm is screwed. See buildbots for error message...

I have to file a bug for this and try to fix it upstream. Possible solutions 
are:

  1) Force people to downgrade SWIG to 1.3.40 until a fix excist
  2) Remove shared_ptr handling of GenericTensors until fix excist
  3) Trye to hack a fix fox this for the moment (I tried once and it did not 
     work...)

I reluctantly vote for 2.

Johan


On Wednesday January 19 2011 12:16:13 Johan Hake wrote:
> Hello!
> 
> GenericTensors and its derived classes are now stored using shared_ptr.
> SWIG provides dereference typemaps to all reference and value calls.
> 
> It should now be straight forward to add shared_ptr functions in the C++
> interface, like the one Garth implemented for BlockFoo.
> 
> If the interface is extended with shared_ptr version of a method, remember
> to %ignore the reference version (if excisting).
> 
> Johan
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp