Matrix multiplication optimization

17 views
Skip to first unread message

Marcus Brubaker

unread,
Jun 29, 2012, 2:37:12 PM6/29/12
to stan...@googlegroups.com
I've just checked in some code to further speed up matrix multiplication and push the dot_product_vv_vari-style classes a little further into the Eigen stack.  There are two distinct changes here.

1) dot_product_v[dv]_vari member functions which operate on Eigen types now take Eigen::DenseCoeffsBase<Derived> types instead of the previous Eigen::Matrix<var,R,C> types.  This allows the mutliply() functions to use ConstRowExpr and ConstColExpr types, in effect avoiding copying each row and column into a temporary array before constructing the dot_product varis.

2) I've provided specialized implementations of Eigen::internal::general_matrix_vector_product and Eigen::internal::general_matrix_matrix_product for the matrices of vars which uses a new dot_product_vv_vari-like class.  This is important because internal Eigen operations (e.g., factorizations, solving linear systems, etc) can end up doing matrix products which bypass our multiply() routines.  It may be possible to take this approach even further by specializing gebp_kernel for var type matrices.  Further, this code is not completely optimized, as it doesn't do the memory sharing that multiply() and dot_product_vv_vari do.

Also, on a related note, I highly recommend using cachegrind for profiling.  The first change above provided a ~20% speedup on my model but I never would have thought of doing it except I looked at the profile results.  It turned out ~15% of execution time was being spent just on memory allocation/deallocation, most of which was happening in multiply().

Cheers,
Marcus

Bob Carpenter

unread,
Jun 29, 2012, 2:54:08 PM6/29/12
to stan...@googlegroups.com
I'll check out cachegrind.

Nice to see more of the template expressions being pushed through.

The only issue now is that the unit tests are broken,
at least on the Windows server. Here's a link to the
error novel:

http://d1m1s1b1.stat.columbia.edu:8080/job/Stan%20Unit%20Tests/1224/console



On 6/29/12 2:37 PM, Marcus Brubaker wrote:
> I've just checked in some code to further speed up matrix multiplication and push the dot_product_vv_vari-style classes
> a little further into the Eigen stack. There are two distinct changes here.
>
> 1) dot_product_v[dv]_vari member functions which operate on Eigen types now take Eigen::DenseCoeffsBase<Derived> types
> instead of the previous Eigen::Matrix<var,R,C> types. This allows the mutliply() functions to use ConstRowExpr and
> ConstColExpr types, in effect avoiding copying each row and column into a temporary array before constructing the
> dot_product varis.

That's nice. The copies themselves probably aren't so expensive but
all the messing around with memory under the hood for Eigen (and std::vector
in other cases) can be a killer. But the only way to avoid the heap
is if you know the sizes at compile time, which we don't (and I believe
Eigen ignores it anyway if it's beyond a certain size).

> 2) I've provided specialized implementations of Eigen::internal::general_matrix_vector_product and
> Eigen::internal::general_matrix_matrix_product for the matrices of vars which uses a new dot_product_vv_vari-like
> class. This is important because internal Eigen operations (e.g., factorizations, solving linear systems, etc) can end
> up doing matrix products which bypass our multiply() routines.

The problem we've always had in the past trying to do what you
suggest in (2) is all the intermediate templates not being
defined. I don't know if that's related to the error above.

> It may be possible to take this approach even further by
> specializing gebp_kernel for var type matrices. Further, this code is not completely optimized, as it doesn't do the
> memory sharing that multiply() and dot_product_vv_vari do.

OK. Ben's looked at some of this.

> Also, on a related note, I highly recommend using cachegrind for profiling. The first change above provided a ~20%
> speedup on my model but I never would have thought of doing it except I looked at the profile results. It turned out
> ~15% of execution time was being spent just on memory allocation/deallocation, most of which was happening in multiply().

Thanks for the pointer. I'll take a look.

- Bob

Marcus Brubaker

unread,
Jun 29, 2012, 3:11:13 PM6/29/12
to stan...@googlegroups.com
On Fri, Jun 29, 2012 at 2:54 PM, Bob Carpenter <ca...@alias-i.com> wrote:
I'll check out cachegrind.

Nice to see more of the template expressions being pushed through.

The only issue now is that the unit tests are broken,
at least on the Windows server.  Here's a link to the
error novel:

http://d1m1s1b1.stat.columbia.edu:8080/job/Stan%20Unit%20Tests/1224/console


Hmmm, odd.  I was certain they had all passed before I pushed the change.  I just reran make clean-all ; make test-unit on Linux/clang++ and everything passed.  I'm running make test-models now and I'll run it with g++ if that passes to see if I can duplicate it.

I'll take a look.
 
On 6/29/12 2:37 PM, Marcus Brubaker wrote:
I've just checked in some code to further speed up matrix multiplication and push the dot_product_vv_vari-style classes
a little further into the Eigen stack.  There are two distinct changes here.

1) dot_product_v[dv]_vari member functions which operate on Eigen types now take Eigen::DenseCoeffsBase<Derived> types
instead of the previous Eigen::Matrix<var,R,C> types.  This allows the mutliply() functions to use ConstRowExpr and
ConstColExpr types, in effect avoiding copying each row and column into a temporary array before constructing the
dot_product varis.

That's nice.  The copies themselves probably aren't so expensive but
all the messing around with memory under the hood for Eigen (and std::vector
in other cases) can be a killer.  But the only way to avoid the heap
is if you know the sizes at compile time, which we don't (and I believe
Eigen ignores it anyway if it's beyond a certain size).

Actually, I think there's been enough other optimizations that, at least according to my profiling, the memory allocation and copying were hurting a fair bit.  I suppose this is a good sign as things like chain() are starting to show up near the top of the profile.
 


2) I've provided specialized implementations of Eigen::internal::general_matrix_vector_product and
Eigen::internal::general_matrix_matrix_product for the matrices of vars which uses a new dot_product_vv_vari-like
class.  This is important because internal Eigen operations (e.g., factorizations, solving linear systems, etc) can end
up doing matrix products which bypass our multiply() routines.

The problem we've always had in the past trying to do what you
suggest in (2) is all the intermediate templates not being
defined.  I don't know if that's related to the error above.

Those internal specializations are basically just the core routines that Eigen calls after all the intermediate templates are evaluated and actually do the calculations.  The expression templates shouldn't play into it all.
 

Ben Goodrich

unread,
Jun 29, 2012, 3:35:26 PM6/29/12
to stan...@googlegroups.com
I get that error on test-unit with g++ but not clang++.

Marcus Brubaker

unread,
Jun 29, 2012, 4:00:42 PM6/29/12
to stan...@googlegroups.com
So it's definitely a g++ vs clang++ issue.  The log was cluttered by a large number of warnings from my added code which I've now silenced.  It seems that g++ is having a hard type matching the new expression template constructors with normal matrices.  I've pushed a change which readds the old constructors to try to fix it but I can't reproduce it with my version of g++, as I get other errors.  (See below.)

With my version of g++ (4.4.6) I'm getting a different error than the one shown on Jenkins which doesn't manifest with clang++.  It seems like it's related to the recent update of boost:

g++ -I src -I lib/eigen_3.1.0 -I lib/eigen_3.1.0/unsupported -I lib/boost_1.50.0 -O0 -Wall -g   -c -lpthread -DGTEST_HAS_PTHREAD=0 -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 src/test/agrad/special_functions_test.cpp -o test/agrad/special_functions.o
In file included from src/stan/agrad/error_handling.hpp:5,
                 from src/stan/agrad/special_functions.hpp:8,
                 from src/test/agrad/special_functions_test.cpp:9:
lib/boost_1.50.0/boost/math/policies/policy.hpp: In function ‘bool stan::math::check_not_nan(const char*, const T_y&, const char*, T_result*, const Policy&) [with T_y = stan::agrad::var, T_result = double, Policy = stan::math::default_policy]’:
src/stan/agrad/special_functions.hpp:744:   instantiated from ‘stan::agrad::var stan::agrad::exp2(const stan::agrad::var&, const Policy&) [with Policy = stan::math::default_policy]’
src/stan/agrad/special_functions.hpp:762:   instantiated from here
lib/boost_1.50.0/boost/math/policies/policy.hpp:184: error: ‘template<boost::math::policies::error_policy_type N> struct boost::math::policies::domain_error’ is not a function,
src/stan/math/error_handling.hpp:52: error:   conflict with ‘template<class T_y, class T_result, class T_msg2, class Policy> bool stan::math::<unnamed>::domain_error(const char*, const T_y&, const char*, const char*, T_msg2, T_result*, const Policy&)’
src/stan/math/error_handling.hpp:115: error:   in call to ‘domain_error’
lib/boost_1.50.0/boost/math/policies/policy.hpp: In function ‘bool stan::math::check_greater_or_equal(const char*, const T_x&, const T_low&, const char*, T_result*, const Policy&) [with T_x = stan::agrad::var, T_low = double, T_result = double, Policy = stan::math::default_policy]’:
src/stan/agrad/special_functions.hpp:1187:   instantiated from ‘stan::agrad::var stan::agrad::log2(const stan::agrad::var&, const Policy&) [with Policy = stan::math::default_policy]’
src/stan/agrad/special_functions.hpp:1204:   instantiated from here
lib/boost_1.50.0/boost/math/policies/policy.hpp:184: error: ‘template<boost::math::policies::error_policy_type N> struct boost::math::policies::domain_error’ is not a function,
src/stan/math/error_handling.hpp:52: error:   conflict with ‘template<class T_y, class T_result, class T_msg2, class Policy> bool stan::math::<unnamed>::domain_error(const char*, const T_y&, const char*, const char*, T_msg2, T_result*, const Policy&)’
src/stan/math/error_handling.hpp:258: error:   in call to ‘domain_error’
lib/boost_1.50.0/boost/math/policies/policy.hpp: In function ‘bool stan::math::check_not_nan(const char*, const T_y&, const char*, T_result*, const Policy&) [with T_y = stan::agrad::var, T_result = double, Policy = errno_policy]’:
src/stan/agrad/special_functions.hpp:744:   instantiated from ‘stan::agrad::var stan::agrad::exp2(const stan::agrad::var&, const Policy&) [with Policy = errno_policy]’
src/test/agrad/special_functions_test.cpp:293:   instantiated from here
lib/boost_1.50.0/boost/math/policies/policy.hpp:184: error: ‘template<boost::math::policies::error_policy_type N> struct boost::math::policies::domain_error’ is not a function,
src/stan/math/error_handling.hpp:52: error:   conflict with ‘template<class T_y, class T_result, class T_msg2, class Policy> bool stan::math::<unnamed>::domain_error(const char*, const T_y&, const char*, const char*, T_msg2, T_result*, const Policy&)’
src/stan/math/error_handling.hpp:115: error:   in call to ‘domain_error’
lib/boost_1.50.0/boost/math/policies/policy.hpp: In function ‘bool stan::math::check_not_nan(const char*, const T_y&, const char*, T_result*, const Policy&) [with T_y = stan::agrad::var, T_result = stan::agrad::var, Policy = errno_policy]’:
src/stan/math/special_functions.hpp:40:   instantiated from ‘typename boost::math::tools::promote_args<RT, float, float, float, float, float>::type stan::math::exp2(T, const Policy&) [with T = stan::agrad::var, Policy = errno_policy]’
src/test/agrad/special_functions_test.cpp:302:   instantiated from here
lib/boost_1.50.0/boost/math/policies/policy.hpp:184: error: ‘template<boost::math::policies::error_policy_type N> struct boost::math::policies::domain_error’ is not a function,
src/stan/math/error_handling.hpp:52: error:   conflict with ‘template<class T_y, class T_result, class T_msg2, class Policy> bool stan::math::<unnamed>::domain_error(const char*, const T_y&, const char*, const char*, T_msg2, T_result*, const Policy&)’
src/stan/math/error_handling.hpp:115: error:   in call to ‘domain_error’
lib/boost_1.50.0/boost/math/policies/policy.hpp: In function ‘bool stan::math::check_greater_or_equal(const char*, const T_x&, const T_low&, const char*, T_result*, const Policy&) [with T_x = stan::agrad::var, T_low = double, T_result = stan::agrad::var, Policy = errno_policy]’:
src/stan/math/special_functions.hpp:119:   instantiated from ‘typename boost::math::tools::promote_args<RT, float, float, float, float, float>::type stan::math::log2(T, const Policy&) [with T = stan::agrad::var, Policy = errno_policy]’
src/test/agrad/special_functions_test.cpp:620:   instantiated from here
lib/boost_1.50.0/boost/math/policies/policy.hpp:184: error: ‘template<boost::math::policies::error_policy_type N> struct boost::math::policies::domain_error’ is not a function,
src/stan/math/error_handling.hpp:52: error:   conflict with ‘template<class T_y, class T_result, class T_msg2, class Policy> bool stan::math::<unnamed>::domain_error(const char*, const T_y&, const char*, const char*, T_msg2, T_result*, const Policy&)’
src/stan/math/error_handling.hpp:258: error:   in call to ‘domain_error’
lib/boost_1.50.0/boost/math/policies/policy.hpp: In function ‘bool stan::math::check_not_nan(const char*, const T_y&, const char*, T_result*, const Policy&) [with T_y = double, T_result = double, Policy = stan::math::default_policy]’:
src/stan/math/special_functions.hpp:117:   instantiated from ‘typename boost::math::tools::promote_args<RT, float, float, float, float, float>::type stan::math::log2(T, const Policy&) [with T = double, Policy = stan::math::default_policy]’
src/stan/math/special_functions.hpp:139:   instantiated from ‘typename boost::math::tools::promote_args<RT, float, float, float, float, float>::type stan::math::log2(T) [with T = double]’
src/stan/agrad/special_functions.hpp:283:   instantiated from here
lib/boost_1.50.0/boost/math/policies/policy.hpp:184: error: ‘template<boost::math::policies::error_policy_type N> struct boost::math::policies::domain_error’ is not a function,
src/stan/math/error_handling.hpp:52: error:   conflict with ‘template<class T_y, class T_result, class T_msg2, class Policy> bool stan::math::<unnamed>::domain_error(const char*, const T_y&, const char*, const char*, T_msg2, T_result*, const Policy&)’
src/stan/math/error_handling.hpp:115: error:   in call to ‘domain_error’
lib/boost_1.50.0/boost/math/policies/policy.hpp: In function ‘bool stan::math::check_greater_or_equal(const char*, const T_x&, const T_low&, const char*, T_result*, const Policy&) [with T_x = double, T_low = double, T_result = double, Policy = stan::math::default_policy]’:
src/stan/math/special_functions.hpp:119:   instantiated from ‘typename boost::math::tools::promote_args<RT, float, float, float, float, float>::type stan::math::log2(T, const Policy&) [with T = double, Policy = stan::math::default_policy]’
src/stan/math/special_functions.hpp:139:   instantiated from ‘typename boost::math::tools::promote_args<RT, float, float, float, float, float>::type stan::math::log2(T) [with T = double]’
src/stan/agrad/special_functions.hpp:283:   instantiated from here
lib/boost_1.50.0/boost/math/policies/policy.hpp:184: error: ‘template<boost::math::policies::error_policy_type N> struct boost::math::policies::domain_error’ is not a function,
src/stan/math/error_handling.hpp:52: error:   conflict with ‘template<class T_y, class T_result, class T_msg2, class Policy> bool stan::math::<unnamed>::domain_error(const char*, const T_y&, const char*, const char*, T_msg2, T_result*, const Policy&)’
src/stan/math/error_handling.hpp:258: error:   in call to ‘domain_error’
src/stan/math/special_functions.hpp: At global scope:
src/stan/math/special_functions.hpp:637: warning: ‘double stan::math::log_sum_exp(const std::vector<double, std::allocator<double> >&)’ defined but not used
src/stan/agrad/agrad.hpp:2200: warning: ‘void stan::agrad::free_memory()’ defined but not used
make: *** [test/agrad/special_functions.o] Error 1


Anyone with a suggestion on this?  This is a 32bit RHEL machine which runs the unit tests fine with clang++.

Cheers,
Marcus

Marcus Brubaker

unread,
Jun 29, 2012, 4:41:55 PM6/29/12
to stan...@googlegroups.com
Argh!  So g++ is apparently not recognizing the result of m.col(i) or m.row(i) as a valid DenseCoeffsBase type!  Does anyone have any suggestions?  According to the Eigen doc this should be fine and certainly clang has no trouble with this.  I've tried some explicit type casting but with only partial success and I'm running out of time to track this down right now.

Suggestions?

Cheers,
Marcus

Marcus Brubaker

unread,
Jun 29, 2012, 5:16:51 PM6/29/12
to stan...@googlegroups.com
Ok, I've pushed a fix for the unit tests.  Passing a DenseBase works but DenseCoeffsBase doesn't.  However, DenseCoeffsBase is a parent of DenseBase!  Probably a strange g++ bug...

Cheers,
Marcus

Ben Goodrich

unread,
Jun 29, 2012, 5:57:09 PM6/29/12
to stan...@googlegroups.com
On Friday, June 29, 2012 4:00:42 PM UTC-4, Marcus Brubaker wrote:
So it's definitely a g++ vs clang++ issue.  The log was cluttered by a large number of warnings from my added code which I've now silenced.  It seems that g++ is having a hard type matching the new expression template constructors with normal matrices.  I've pushed a change which readds the old constructors to try to fix it but I can't reproduce it with my version of g++, as I get other errors.  (See below.)

With my version of g++ (4.4.6) I'm getting a different error than the one shown on Jenkins which doesn't manifest with clang++.  It seems like it's related to the recent update of boost:

make test-unit is now fine with g++4.5 and above (and clang++ 3.1), but with g++4.4 and boost 1.49, I still get the domain_error below.

src/stan/agrad/special_functions.hpp:1204:   instantiated from here
lib/boost_1.50.0/boost/math/policies/policy.hpp:184: error: ‘template<boost::math::policies::error_policy_type N> struct boost::math::policies::domain_error’ is not a function,
src/stan/math/error_handling.hpp:52: error:   conflict with ‘template<class T_y, class T_result, class T_msg2, class Policy> bool stan::math::<unnamed>::domain_error(const char*, const T_y&, const char*, const char*, T_msg2, T_result*, const Policy&)’
src/stan/math/error_handling.hpp:258: error:   in call to ‘domain_error’

 Hopefully, it also occurs with g++4.2 and Bob can fix it.

Ben

Bob Carpenter

unread,
Jun 29, 2012, 6:42:19 PM6/29/12
to stan...@googlegroups.com


On 6/29/12 5:16 PM, Marcus Brubaker wrote:
> Ok, I've pushed a fix for the unit tests. Passing a DenseBase works but DenseCoeffsBase doesn't. However,
> DenseCoeffsBase is a parent of DenseBase! Probably a strange g++ bug...

That doesn't seem so surprising -- there could be functions
in DenseBase not in DenseCoeffsBase. I'd be more surprised
if the inheritance were reversed.

I'm going to have to see how you did this, as I was never
able to get anything working across all of our tests.

I'm just waiting now for the unit tests to do something
on my little notebook.

It does look like Jenkins is happy.

- Bob

Bob Carpenter

unread,
Jun 29, 2012, 9:33:47 PM6/29/12
to stan...@googlegroups.com
Everything ran fine in clang++ 2.9 on Mac OS X.

g++ 4.2.1 was having a problem with anonymous namespaces,
so I just changed the name of a structure and it shut up.

Unfortunately, agrad/.../inv_wishart is up to its old tricks.

~/stan>make CC=g++ O=0 test/agrad/distributions/multivariate/continuous/inv_wishart

...major snip...

src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:94: error: no matching function for call to
‘mdivide_left_tri(Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>&, Eigen::Matrix<stan::agrad::var, -0x00000000000000001,
-0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&)’

...

I'm not sure why it's not matching. Here's the signature
from agrad/matrix.hpp (there are all versions of var/double):

template<int TriView,int R1,int C1,int R2,int C2>
inline Eigen::Matrix<var,R1,C2> mdivide_left_tri(const Eigen::Matrix<var,R1,C1> &A,
const Eigen::Matrix<var,R2,C2> &b) {

At one point, I thought we were going to change those to
hard code in the upper or lower triangular bits. So I went
ahead and added an mdivide_left_tri_low() w/o the TriView template
param and inv_wishart (and the other multivariates using mdivide_left)
work just fine.

g++ takes forever on my little Macbook Air, but when it's done,
I'll push the fixes.

- Bob

P.S. Here's what was snipped:

g++ -I src -I lib/eigen_3.1.0 -I lib/eigen_3.1.0/unsupported -I lib/boost_1.50.0 -O0 -Wall -g -Wno-unused-function -c
-I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp
-o test/agrad/distributions/multivariate/continuous/inv_wishart.o
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp: In function ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, const Policy&) [with bool propto = false, T_y = stan::agrad::var, T_dof = stan::agrad::var,
T_scale = stan::agrad::var, Policy = boost::math::policies::policy<boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’:
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:110: instantiated from ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&) [with bool propto = false, T_y = stan::agrad::var, T_dof = stan::agrad::var, T_scale =
stan::agrad::var]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:13: instantiated from ‘void
expect_propto(T_y, T_dof, T_scale, T_y, T_dof, T_scale, std::string) [with T_y = Eigen::Matrix<stan::agrad::var,
-0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>, T_dof = stan::agrad::var,
T_scale = Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:56: instantiated from here
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:94: error: no matching function for call to
‘mdivide_left_tri(Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>&)’
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp: In function ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, const Policy&) [with bool propto = true, T_y = stan::agrad::var, T_dof = stan::agrad::var,
T_scale = stan::agrad::var, Policy = boost::math::policies::policy<boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’:
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:110: instantiated from ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&) [with bool propto = true, T_y = stan::agrad::var, T_dof = stan::agrad::var, T_scale =
stan::agrad::var]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:13: instantiated from ‘void
expect_propto(T_y, T_dof, T_scale, T_y, T_dof, T_scale, std::string) [with T_y = Eigen::Matrix<stan::agrad::var,
-0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>, T_dof = stan::agrad::var,
T_scale = Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:56: instantiated from here
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:94: error: no matching function for call to
‘mdivide_left_tri(Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>&)’
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp: In function ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, const Policy&) [with bool propto = false, T_y = stan::agrad::var, T_dof = double, T_scale =
double, Policy = boost::math::policies::policy<boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’:
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:110: instantiated from ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&) [with bool propto = false, T_y = stan::agrad::var, T_dof = double, T_scale = double]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:13: instantiated from ‘void
expect_propto(T_y, T_dof, T_scale, T_y, T_dof, T_scale, std::string) [with T_y = Eigen::Matrix<stan::agrad::var,
-0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>, T_dof = double, T_scale =
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:61: instantiated from here
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:94: error: no matching function for call to
‘mdivide_left_tri(Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>&)’
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp: In function ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, const Policy&) [with bool propto = true, T_y = stan::agrad::var, T_dof = double, T_scale =
double, Policy = boost::math::policies::policy<boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’:
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:110: instantiated from ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&) [with bool propto = true, T_y = stan::agrad::var, T_dof = double, T_scale = double]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:13: instantiated from ‘void
expect_propto(T_y, T_dof, T_scale, T_y, T_dof, T_scale, std::string) [with T_y = Eigen::Matrix<stan::agrad::var,
-0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>, T_dof = double, T_scale =
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:61: instantiated from here
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:94: error: no matching function for call to
‘mdivide_left_tri(Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>&)’
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp: In function ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, const Policy&) [with bool propto = false, T_y = stan::agrad::var, T_dof = stan::agrad::var,
T_scale = double, Policy = boost::math::policies::policy<boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’:
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:110: instantiated from ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&) [with bool propto = false, T_y = stan::agrad::var, T_dof = stan::agrad::var, T_scale = double]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:13: instantiated from ‘void
expect_propto(T_y, T_dof, T_scale, T_y, T_dof, T_scale, std::string) [with T_y = Eigen::Matrix<stan::agrad::var,
-0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>, T_dof = stan::agrad::var,
T_scale = Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:66: instantiated from here
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:94: error: no matching function for call to
‘mdivide_left_tri(Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>&)’
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp: In function ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, const Policy&) [with bool propto = true, T_y = stan::agrad::var, T_dof = stan::agrad::var,
T_scale = double, Policy = boost::math::policies::policy<boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’:
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:110: instantiated from ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&) [with bool propto = true, T_y = stan::agrad::var, T_dof = stan::agrad::var, T_scale = double]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:13: instantiated from ‘void
expect_propto(T_y, T_dof, T_scale, T_y, T_dof, T_scale, std::string) [with T_y = Eigen::Matrix<stan::agrad::var,
-0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>, T_dof = stan::agrad::var,
T_scale = Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:66: instantiated from here
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:94: error: no matching function for call to
‘mdivide_left_tri(Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>&)’
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp: In function ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, const Policy&) [with bool propto = false, T_y = stan::agrad::var, T_dof = double, T_scale =
stan::agrad::var, Policy = boost::math::policies::policy<boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’:
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:110: instantiated from ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&) [with bool propto = false, T_y = stan::agrad::var, T_dof = double, T_scale = stan::agrad::var]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:13: instantiated from ‘void
expect_propto(T_y, T_dof, T_scale, T_y, T_dof, T_scale, std::string) [with T_y = Eigen::Matrix<stan::agrad::var,
-0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>, T_dof = double, T_scale =
Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:71: instantiated from here
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:94: error: no matching function for call to
‘mdivide_left_tri(Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>&)’
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp: In function ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, const Policy&) [with bool propto = true, T_y = stan::agrad::var, T_dof = double, T_scale =
stan::agrad::var, Policy = boost::math::policies::policy<boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy,
boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’:
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:110: instantiated from ‘typename
boost::math::tools::promote_args<T_y, T_dof, T_scale, float, float, float>::type stan::prob::inv_wishart_log(const
Eigen::Matrix<T_y, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, const
T_dof&, const Eigen::Matrix<T_scale, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&) [with bool propto = true, T_y = stan::agrad::var, T_dof = double, T_scale = stan::agrad::var]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:13: instantiated from ‘void
expect_propto(T_y, T_dof, T_scale, T_y, T_dof, T_scale, std::string) [with T_y = Eigen::Matrix<stan::agrad::var,
-0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>, T_dof = double, T_scale =
Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>]’
src/test/agrad/distributions/multivariate/continuous/inv_wishart_test.cpp:71: instantiated from here
src/stan/prob/distributions/multivariate/continuous/inv_wishart.hpp:94: error: no matching function for call to
‘mdivide_left_tri(Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>&, Eigen::Matrix<stan::agrad::var, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>&)’
src/stan/prob/constants.hpp: At global scope:
src/stan/prob/constants.hpp:15: warning: ‘stan::prob::<unnamed>::LOG_ZERO’ defined but not used
src/stan/prob/constants.hpp:19: warning: ‘stan::prob::<unnamed>::NEG_LOG_TWO’ defined but not used
src/stan/prob/constants.hpp:21: warning: ‘stan::prob::<unnamed>::NEG_LOG_SQRT_TWO_PI’ defined but not used
src/stan/prob/constants.hpp:24: warning: ‘stan::prob::<unnamed>::NEG_LOG_PI’ defined but not used
src/stan/prob/constants.hpp:26: warning: ‘stan::prob::<unnamed>::NEG_LOG_SQRT_PI’ defined but not used
make: *** [test/agrad/distributions/multivariate/continuous/inv_wishart.o] Error 1

- Bob
Reply all
Reply to author
Forward
0 new messages