public static DMatrixRMaj symmetricWithEigenvalues ( int num , Random rand , double ... eigenvalues ) { DMatrixRMaj V = RandomMatrices_DDRM . orthogonal ( num , num , rand ) ; DMatrixRMaj D = CommonOps_DDRM . diag ( eigenvalues ) ; DMatrixRMaj temp = new DMatrixRMaj ( num , num ) ; CommonOps_DDRM . mult ( V , D , temp ) ; CommonOps_DDRM . multTransB ( temp , V , D ) ; return D ; }
Creates a new random symmetric matrix that will have the specified real eigenvalues .