Bob Carpenter
unread,Mar 4, 2015, 5:23:13 PM3/4/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to stan...@googlegroups.com
Ben inspired me to try again with ifdefs. I'm optimistic the
current pull request will work with this:
#ifdef _WIN64
// in WIN64, size_t = unsigned long long, which is a C++11
// feature, so use this ctor to enable it
var(size_t x) : vi_(new vari(static_cast<double>(x))) { }
var(ptrdiff_t x) : vi_(new vari(static_cast<double>(x))) { }
#endif
The one that just failed was missing ptrdiff_t, which is the signed
type big enough to hold pointer differences. On non-windows, this
is (long int); on Windows, it's (long long int).
The built-in type ptrdiff_t is equal to (long long int) without
triggering C++11 warnings. But we can't use it on anything but
Windows, because then there's ambiguity with (long int).
- Bob
P.S. The bigger issue is that there are issues with the way we do arithmetic.
I think I'll try to fix that next as it should make a huge difference
in speed. So should rewriting the way we do transforms with custom
(vectorized) derivatives. And I'm also going to work on getting the
line-number errors in along the lines of Marcus's suggestions.
Alas, none of this is getting us closer to new features of the language,
just better speed and better error reporting. For me, this is more
important than new features, but I should be available again for new
features in a few weeks once I knock off these two issues.
Now, off to do yet another talk on Stan in Sydney. They love us here!