[eigen] To initialize or not to initialize

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

Looking into the code of various decompositions I've seen that the constructors for input matrix are sometimes implemented like this (dummy example):

fooDecomp(const MatrixType& matrix) : m_mat(matrix.rows(), matrix.rows())


and sometimes like this:

fooDecomp(const MatrixType& matrix) // <- Notice no initialization


First of all, I'd like to propose uniforming this (I could do it), but I also wanted to know how big a difference is there between the two alternatives.
I know that in general it's best to follow the first approach and initialize class members, but is it still so in the case of Eigen matrices?. Are the differences greater when certain macros are defines, such as EIGEN_INITIALIZE_BY_ZERO_IF_THAT_OPTION_IS_ENABLED?



Adolfo Rodríguez Tsouroukdissian, Ph.. D.

Robotics engineer
Tel. +34.93.414.53.47
AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden contener información privilegiada y/o confidencial que está dirigida exclusivamente a su destinatario. Si usted recibe este mensaje y no es el destinatario indicado, o el empleado encargado de su entrega a dicha persona, por favor, notifíquelo inmediatamente y remita el mensaje original a la dirección de correo electrónico indicada. Cualquier copia, uso o distribución no autorizados de esta comunicación queda estrictamente prohibida.

CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may contain confidential information which is privileged and intended only for the individual or entity to whom they are addressed.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or accompanying document(s) is strictly prohibited.  If you have received this e-mail in error, please immediately notify the sender at the above e-mail address.

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/