Question: Symmetric matrix in Maple

I'm computing a matrix which is a hessian of a quadratic function and it should be symmetric.

Unfortunately, because of the numerical errors, the hessian matrix becomes unsymmetric. 

Then, I want to use this matrix as the input for the QPSolve procedure, and I get the error that the matrix is unsymmetric.  

To obtain the symmetric matrix, I'm doing the following redundant computation:

A := MTM[triu](B, 1) + Transpose(MTM[triu](B)):

Is there a better solution to this problem?

Please Wait...