value_of vs value_of_rec?

11 views
Skip to first unread message

Michael Betancourt

unread,
Sep 28, 2015, 8:40:10 AM9/28/15
to stan...@googlegroups.com
What is the purpose of the two functions? As far as I can tell the
prim/rev/fwd implementations are all identical.

Rob Trangucci

unread,
Sep 28, 2015, 9:47:50 AM9/28/15
to stan...@googlegroups.com
value_of_rec returns the underlying double value, no matter the autodiff order (fvar<var> or fvar<fvar<var> >) whereas value_of will return the nested var or fvar.

So, value_of(fvar<var> x) returns x.val_ whereas value_of_rec(fvar<var> x) returns x.val_.val()


Rob

On Mon, Sep 28, 2015 at 8:40 AM, Michael Betancourt <betan...@gmail.com> wrote:
What is the purpose of the two functions?  As far as I can tell the
prim/rev/fwd implementations are all identical.

--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages