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

Project Vector Function

Tags: None
(comma "," separated)
xtrawurst
Registered Member
Posts
2
Karma
0

Project Vector Function

Mon Feb 28, 2011 11:48 pm
Hi,
I have an N-Vector I want to get the N-1 vector that results from dividing each element by the last element (i.e. projecting the vector).
I wanted to write a neat function for that:
Code: Select all
template<class D1>
inline Eigen::Matrix<typename D1::Scalar, typename D1::SizeAtCompileTime-1, 1> const vectorProject(const D1& vec) {
  // ... code
}


My compiler doesn't accept this, stating argument 2 and 5 of the return type would be invalid.
Removing the 'typename' makes the compiler complain about the missing 'typename' before accessing type members of template parameters.

Is there a way to solve this in Eigen (without having to write N-1 functions...)?

Thanks
xtrawurst
Registered Member
Posts
2
Karma
0

Re: Project Vector Function  Topic is solved

Tue Mar 01, 2011 12:36 am
issue solved. The 2nd 'typename' was too much..


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora