[CppAD] cout problem with AD<double> based Eigen vector

Di Liu flyingliudi at gmail.com
Fri Apr 19 07:29:45 EDT 2013


Hello,

I am trying to do "cout << X", where X is of
Eigen::Matrix<AD<double>,Dynamic,Dynamic> . However, the GNU g++
compiler gives me errors such as:" lib/eigen/Eigen/src/Core/IO.h:132:
error: no matching function for call to ‘ceil(CppAD::AD<double>)"

The original code is:

#include <cppad/cppad.hpp>
#include <cppad/example/cppad_eigen.hpp>
#include <iostream>

using CppAD::AD;
using namespace Eigen;
using std::cout;
using std::endl;

int main()
{
  size_t n=2;
  typedef Matrix< AD<double>,Dynamic,Dynamic > MatrixXAD;
  MatrixXAD X(2,2);
  X<< 1, 2,
  3,4;
  /*
  for (int i=0;i<4;++i)
    cout << X(i)<<endl;
  */
  cout << X;
}

Thank you very much.

Di



More information about the CppAD mailing list