Registered Member
|
Hello,
we need a P=UDU' decomposition for an algorithm (U = unit upper triangular, D = diagonal) and hence thought of customizing Eigen in way which would make the following statement possible:
We already tried to add a corresponding method to MatrixBase via the customizing tutorial, but had only partial success. The function looked something like:
Whereas it seemed to work, when called from a ordinary Eigen::Matrix, calling above function from a Eigen::Map<Matrix<...>> we get segmentation faults. It probably has somehting to do with the Derived type. Can somebody clearify how such a function would be added to Eigen in a way that works an Matrixes and Maps. Best regards, Sebastian |
Moderator
|
if you want to return a matrix, then use the PlainObject type which should be readily available at this stage:
PlainObject factorizeUD() { PlainObject res; return res } |
Registered Member
|
Thank you, this works.
One additional question: What is the supposed data type to be used when a function should accept any kind of matrix as parameter (dynamic, fixed size matrices and Maps of matrices). I tried with 'void function(MatrixXd &m){};' but this made problems. I don't remember exactly, but either fixed size matrixes or mapped fixed size matrixes gave compiler errors. Should the PlainObject-type be used again? Regards, Sebastian |
Moderator
|
you need to define a template function taking a MatrixBase<Derived>. see this:
http://eigen.tuxfamily.org/dox/TopicFun ... Types.html |
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]