Relative Content

Tag Archive for c++eigen

Strange results while trying to make matris symmetric in Eigen

In my project i work with covariance matrices and during many repetitive operation i have noticed that they gradually loose their symmetry. I put it down to numerical problems and when loss of symmetry exceed some level i try to restore matrix to proper form. I found in stack a simple method:

Matrix dimension assignment error encountered when solving matrix equation

I am trying to solve the equation T_SpSq=THS^-1·TPQ·THS.
I wrote a class to keep adding TPQ as a solution parameter.
But the compiler reports an error: C2338: YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES.
I don’t see where the data type is wrong. Please help me find the code and variables that may be wrong.