MatrixFunction.cpp
Go to the documentation of this file.
00001 #include <unsupported/Eigen/MatrixFunctions>
00002 #include <iostream>
00003 
00004 using namespace Eigen;
00005 
00006 std::complex<double> expfn(std::complex<double> x, int)
00007 {
00008   return std::exp(x);
00009 }
00010 
00011 int main()
00012 {
00013   const double pi = std::acos(-1.0);
00014 
00015   MatrixXd A(3,3);
00016   A << 0,    -pi/4, 0,
00017        pi/4, 0,     0,
00018        0,    0,     0;
00019 
00020   std::cout << "The matrix A is:\n" << A << "\n\n";
00021   std::cout << "The matrix exponential of A is:\n" 
00022             << A.matrixFunction(expfn) << "\n\n";
00023 }


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:31:57