Registered Member
|
Can someone please provide some more information about the Nested typedef in NumTraits?
Specifically, in NumTraits<AutoDiffScalar<DerType> > why is it a reference: typedef AutoDiffScalar<DerType>& Nested; I am using a modified version of the AutoDiffScalar class to compute second derivatives and DerType is itself a fixed size Eigen::Matrix of AutoDiffScalars. In this case I am getting some strange errors that I can't explain. For example I can print the values of the derivatives inside a function such as sqrt and see that they are correct, but the returned value has garbage. However if I remove the "&" from the Nested typedef everything seems to be working. |
Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar