This forum has been archived. All content is frozen. Please use KDE Discuss instead.

can a function take a std::vector of MatrixBase<Derived> ?

Tags: None
(comma "," separated)
xaffeine
Registered Member
Posts
24
Karma
0
When I define the following function:
template <typename Derived>
Code: Select all
void DoMany( std::vector< Eigen::MatrixBase<Derived> > & destVec )
{}

I can't get this calling code to compile:
std::vector< Eigen::MatrixXf > xx;
DoMany( xx);

Shouldn't I be able to do something like that?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
This does not make sense because Eigen::MatrixBase<Derived> is an abstract base class. You cannot construct object of type Eigen::MatrixBase<Derived>. Simply make "DoMany" more generic:
Code: Select all
template<typename MatType>
vod DoMany(std::vector<MatType>&);


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell