You're right that we don't have a sparse Hessian operation.
And you're right as to why --- we don't have a way to call
a mixed double/var vector function.
I don't know of a better way of doing this than promoting,
which is tantamount to just computing the whole dense
Hessian.
I played around with trying to have two implementations of
our var and fvar types, one that's a "real" autodiff variable
and one that just wraps doubles to get around the type problem,
but it just pushes it down one level, and the run-time costs
of doing it with virtual functions or conditionals is too high.
I still have the feeling that it must be possible to engineer
such a thing with a clever use of something like the CRTP, but
I could never figure out how to do it. I don't know if other
autodiff libs have reasonable solutions. If you find out, I'd
like to hear more about what they do.
- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
stan-users+...@googlegroups.com.
> To post to this group, send email to
stan-...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
> <basic.cpp><sub_hessian.hpp>