Registered Member
|
Hi, I have a simple question.
I want to define a function taking a Eigen matrix (a kernel matrix K) and if that kernel matrix is separable (i.e. rank(K)==1), returns the column and row vectors respectively X,Y such that K=X*Y but I want to do it in a templatized and more general possible way.
where clearly the EIGENCOLUMNVECTORTYPE and EIGENROWVECTORTYPE words are placeholders for the correct inferred type. In the case kernel matrix is of type Matrix<float,10,10> for example, row vector should be Matrix<float,1,10> and column vector Matrix<float,10,1>. How can I do that? Is it possible in a templatized fashion? Otherwise other prototypes are warmly welcome |
Registered Member
|
I second this question. I too would like to tighten declaration, which now reads
to some thing like
It is not obvious to me this is possible, but I would love to be proven wrong. |
Moderator
|
Matrix<typename Derived::Scalar,1,Derived::ColsAtCompileTime>
but that prevent to call the function with e.g., blocks or arrays. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]