blob: 114c65fb3e15ccd1797bf844e38b07b1a5ec9576 [file] [log] [blame]
Brian Silverman72890c22015-09-19 14:37:37 -04001MatrixXd X = MatrixXd::Random(4,4);
2MatrixXd A = X * X.transpose();
3cout << "Here is a random positive-definite matrix, A:" << endl << A << endl << endl;
4
5SelfAdjointEigenSolver<MatrixXd> es(A);
6cout << "The inverse square root of A is: " << endl;
7cout << es.operatorInverseSqrt() << endl;
8cout << "We can also compute it with operatorSqrt() and inverse(). That yields: " << endl;
9cout << es.operatorSqrt().inverse() << endl;