Martin Sandve Alnæs wrote:
> 2008/4/12, Garth N. Wells <[EMAIL PROTECTED]>:
>>
>>  Martin Sandve Alnæs wrote:
>>
>>> Circular dependencies... But we could put templated functions in Generic*.
>>>
>>> F.ex.:
>>> Foo & v = vector_cast<Foo>(genericvector);
>>>
>>> Templates must be renamed in the python interface though.
>>>
>>>
>>  I've added template functions to GenericTensor. Take a look.
>>
>>  Garth
> 
> 
> Looks good, but I'm not sure about all details around templated member
> functions. But I think they should return references. Then we'll have:
> 
> uBlasVector & v = gv.down_cast<uBlasVector>();
> ublas_vector & u = gv.down_cast<uBlasVector>()->vec();
> 

References would be nicer to work with, so that's fine by me.

Garth
_______________________________________________
DOLFIN-dev mailing list
[email protected]
http://www.fenics.org/mailman/listinfo/dolfin-dev

Reply via email to