<div dir="ltr"><div><div><div><div><div><div><div>Hi,<br></div>I need the diagonal elements from result of multiplying matrix A, B together. <br></div>I can get by multiplying the 2 matrices and then call MatGetDiagonal.<br></div>However, I only need the values on the diagonal and the rest of the elements are useless for me.<br></div><div>As the size of matrices increase, I am afraid it affect the performance.<br><br></div>So, I am looking for another method that only calculates the diagonal of multiplication and not the rest of elements.<br></div>If there is not such a method for matrix, how can I use the vector's operations to reach the same results?<br><br><br></div>Best,<br></div>Ehsan<br></div>