You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
426 B

  1. MatrixXd X = MatrixXd::Random(4,4);
  2. MatrixXd A = X * X.transpose();
  3. cout << "Here is a random positive-definite matrix, A:" << endl << A << endl << endl;
  4. SelfAdjointEigenSolver<MatrixXd> es(A);
  5. cout << "The inverse square root of A is: " << endl;
  6. cout << es.operatorInverseSqrt() << endl;
  7. cout << "We can also compute it with operatorSqrt() and inverse(). That yields: " << endl;
  8. cout << es.operatorSqrt().inverse() << endl;