API change: ei_matrix_exponential(A) --> A.exp(), etc

As discussed on mailing list; see
http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2010/02/msg00190.html
This commit is contained in:
Jitse Niesen
2010-03-16 17:26:55 +00:00
parent d536fef1bb
commit 04a4e22c58
11 changed files with 74 additions and 75 deletions

View File

@@ -12,7 +12,5 @@ int main()
pi/4, 0, 0,
0, 0, 0;
std::cout << "The matrix A is:\n" << A << "\n\n";
MatrixXd B = ei_matrix_exponential(A);
std::cout << "The matrix exponential of A is:\n" << B << "\n\n";
std::cout << "The matrix exponential of A is:\n" << A.exp() << "\n\n";
}

View File

@@ -19,5 +19,5 @@ int main()
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix exponential of A is:\n"
<< ei_matrix_function(A, expfn) << "\n\n";
<< A.matrixFunction(expfn) << "\n\n";
}

View File

@@ -8,10 +8,10 @@ int main()
MatrixXd A = MatrixXd::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXd sinA = ei_matrix_sin(A);
MatrixXd sinA = A.sin();
std::cout << "sin(A) = \n" << sinA << "\n\n";
MatrixXd cosA = ei_matrix_cos(A);
MatrixXd cosA = A.cos();
std::cout << "cos(A) = \n" << cosA << "\n\n";
// The matrix functions satisfy sin^2(A) + cos^2(A) = I,

View File

@@ -8,10 +8,10 @@ int main()
MatrixXf A = MatrixXf::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXf sinhA = ei_matrix_sinh(A);
MatrixXf sinhA = A.sinh();
std::cout << "sinh(A) = \n" << sinhA << "\n\n";
MatrixXf coshA = ei_matrix_cosh(A);
MatrixXf coshA = A.cosh();
std::cout << "cosh(A) = \n" << coshA << "\n\n";
// The matrix functions satisfy cosh^2(A) - sinh^2(A) = I,