Re: [eigen] unpleasant surprise mit math functions

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On 18.09.2012 20:25, Helmut Jarausch wrote:
int main() {
   int N= 5,  m= 2;
   VectorXd t(N);
   MatrixXd A(N,m);

   A.col(0).fill(0);
   t << 10, 20, 30, 40, 50;
   double F = 8*atan(1.0)/50;
   A.col(1)= sin(F*t);
   cout << A << endl;
}

IIRC, sin(t) is only supposed to work for array expressions, so sin(F*t.array()) should work. However, your example should give a compile-time error, so this seems to be a bug.

Christoph




--
----------------------------------------------
Dipl.-Inf. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252
----------------------------------------------



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/