Boost logo

Ublas :

From: Paul C. Leopardi (leopardi_at_[hidden])
Date: 2005-10-06 18:02:39


Hello Thomas,
I reply below, but unfortunately, only with more questions.
Best regards

On Thu, 6 Oct 2005 23:23, Thomas Lemaire wrote:
> I have a method which needs to be virtual and takes a vector as parameter.
> Some times it would be convenient to pass a vector_range instead... Since
> my method is virtual, it cannot be template....

Could you please elaborate? If your method is virtual, why can it not be
template? In what way is it different from the virtual template member
functions which are used in the template class glucat::clifford_algebra in
GluCat, for example? See http://sourceforge.net/projects/glucat/
These functions are inherited at compile time by the template classes
glucat::matrix_multi and glucat::framed_multi, using a variant of the
Barton-Nackman trick, otherwise known as Curiously Recurring Templates.

> I have read information about polymorphism from the wiki:
> http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Extensions_A
>nd_New_Usage_Patterns_In_UBLAS

This part of the Wiki talks about runtime polymorphism. The template class
glucat::clifford_algebra uses compile time polymorphism. Do you need runtime
polymorphism or could you do what you want using only compile time
polymorphism?

> What is the recommended solution for this kind of problem with the current
> ublas implementation ?

I don't know. I am also curious to find out.