Skip to content

How can I store the return value of 'derivativex' as a double? #147

Answered by allanleal
GaffaSnobb asked this question in Q&A
Discussion options

You must be logged in to vote

This is because var cannot be converted to double implicitly. Try:

M(i, 0) = double(ux[0]);   // This is what I want to do.
M(i, 1) = double(uxx[0]);  // This is what I want to do.

or

M(i, 0) = autodiff::val(ux[0]);   // This is what I want to do.
M(i, 1) = autodiff::val(uxx[0]);  // This is what I want to do.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GaffaSnobb
Comment options

Answer selected by GaffaSnobb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants