rjhogan / Adept-2

Combined array and automatic differentiation library in C++
http://www.met.reading.ac.uk/clouds/adept/
Apache License 2.0
163 stars 29 forks source link

adept and std::vector and Eigen #1

Closed lengagne closed 6 years ago

lengagne commented 8 years ago

Hi,

I would like to test adept for auto differentiation in an optimization process (using IPOPT). I have a template class that use double or adouble.

In the class, I have some std::vector of Eigen::Matrix defined as : std::vector < Eigen::Matrix < T, 6, 1 >, Eigen::aligned_allocator < Eigen::Matrix < T, 6, 1 > > > a;

I have a segmentation fault when I try to resize the vector.

If I resize this kind of vector in a simple program (out of any class), I do not have any trouble

Do you have any clue about it ? Thank you

S. Lengagne

aeoleader commented 7 years ago

I think the purpose of adept 2.0 is to use the native matrix functionalities, so the user doesn't need to worry about the compatibility issue while using Eigen for linear algebra calculations. So my suggestion is to try the native implementation of matrix manipulation.

lengagne commented 7 years ago

Thank you for your answer

Unfortunately, I need to compute derivative of a complex and specific function that is described using std::vectors and eigen matrices.

rcalxrc08 commented 7 years ago

If i remember well Adept 2.0 does not support (hope currently) adjoint inversion or adjoint of the linear solver. so the "matrix" that you are talking about is simply a container and not a mathematical object.

rjhogan commented 6 years ago

Since the query is not about Adept, I'm closing it.