Anyone care if the tests have C++-11 features? I'm wanting to use default template parameters for functions. This would make testing the distributions a lot easier and we might have a real chance at testing the distributions with the bounds included.
clang++ -I src -I lib/eigen_3.1.2 -I lib/boost_1.52.0 -O0 -Wall -Wno-unused-function -Wno-tautological-compare -I ../../../../../lib/boost_1.52.0 -I../../../../../lib/eigen_3.1.2 -I ../../../../../src -c -Wno-c++11-extensions -std=gnu++0x -D__STRICT_ANSI__ -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 src/test/file_includes/stan_gm_test.cpp -o test/file_includes/stan_gm.o
In file included from src/test/file_includes/stan_gm_test.cpp:1:
In file included from src/stan/gm.hpp:4:
In file included from src/stan/gm/ast_def.cpp:5:
In file included from lib/boost_1.52.0/boost/variant/recursive_variant.hpp:17:
In file included from lib/boost_1.52.0/boost/variant/detail/enable_recursive.hpp:21:
lib/boost_1.52.0/boost/mpl/eval_if.hpp:38:26: error: no type named 'type' in 'boost::result_of<boost::phoenix::actor<boost::spirit::attribute<1> > (boost::spirit::unused_type,
boost::spirit::context<boost::fusion::cons<std::vector<stan::gm::var_decl, std::allocator<stan::gm::var_decl> > &, boost::fusion::cons<bool, boost::fusion::cons<int, boost::fusion::nil>
> >, boost::fusion::vector1<bool> >)>'
typedef typename f_::type type;
~~~~~~~~~~~~~^~~~
Ben
On Thursday, November 15, 2012 11:39:14 PM UTC-5, Daniel Lee wrote:Anyone care if the tests have C++-11 features? I'm wanting to use default template parameters for functions. This would make testing the distributions a lot easier and we might have a real chance at testing the distributions with the bounds included.
This seems to be a bit more problematic on clang than I would have guessed. I didn't notice before because --std wasn't actually getting set on linux until now.
CFLAGS_GTEST += -std=c++0x
CFLAGS += -DGTEST_USE_OWN_TR1_TUPLE
CFLAGS += -stdlib=libc++
goodrich@CYBERPOWERPC:/opt/stan$ make clean-all && time make CC=clang++ O=0 test-unit
rm -f
rm -f
rm -f -r models src/stan/model/model_header.hpp.gch src/stan/model/model_header.hpp.pch src/stan/model/model_header.hpp.d
rm -f -r doc/api
cd src/docs/stan-reference; rm -f *.aux *.bbl *.blg *.log *.toc *.pdf *.out *.idx *.ilg *.ind *.cb *.cb2 *.upa
rm -f -r demo
rm -f -r test bin doc
rm -f
clang++ -I src -I lib/eigen_3.1.2 -I lib/boost_1.52.0 -O0 -Wall -Wno-unused-function -Wno-tautological-compare -DGTEST_USE_OWN_TR1_TUPLE -stdlib=libc++ -I ../../../../../lib/boost_1.52.0 -I../../../../../lib/eigen_3.1.2 -I ../../../../../src -c -Wno-c++11-extensions -std=c++0x -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 lib/gtest_1.6.0/src/gtest-all.cc -o test/gtest.o
ar rv test/libgtest.a test/gtest.o
ar: creating test/libgtest.a
a - test/gtest.o
clang++ -I src -I lib/eigen_3.1.2 -I lib/boost_1.52.0 -O0 -Wall -Wno-unused-function -Wno-tautological-compare -DGTEST_USE_OWN_TR1_TUPLE -stdlib=libc++ -I ../../../../../lib/boost_1.52.0 -I../../../../../lib/eigen_3.1.2 -I ../../../../../src -c -Wno-c++11-extensions -std=c++0x -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 src/test/io/csv_writer_test.cpp -o test/io/csv_writer.o
clang++ -I src -I lib/eigen_3.1.2 -I lib/boost_1.52.0 -O0 -Wall -Wno-unused-function -Wno-tautological-compare -DGTEST_USE_OWN_TR1_TUPLE -stdlib=libc++ -I ../../../../../lib/boost_1.52.0 -I../../../../../lib/eigen_3.1.2 -I ../../../../../src -c -o bin/stan/agrad/agrad.o src/stan/agrad/agrad.cpp
clang++ -I src -I lib/eigen_3.1.2 -I lib/boost_1.52.0 -O0 -Wall -Wno-unused-function -Wno-tautological-compare -DGTEST_USE_OWN_TR1_TUPLE -stdlib=libc++ -I ../../../../../lib/boost_1.52.0 -I../../../../../lib/eigen_3.1.2 -I ../../../../../src -c -o bin/stan/math/matrix.o src/stan/math/matrix.cpp
clang++ -I src -I lib/eigen_3.1.2 -I lib/boost_1.52.0 -O0 -Wall -Wno-unused-function -Wno-tautological-compare -DGTEST_USE_OWN_TR1_TUPLE -stdlib=libc++ -I ../../../../../lib/boost_1.52.0 -I../../../../../lib/eigen_3.1.2 -I ../../../../../src -c -o bin/stan/agrad/matrix.o src/stan/agrad/matrix.cpp
In file included from src/stan/agrad/matrix.cpp:4:
In file included from src/stan/agrad/matrix.hpp:4:
In file included from src/stan/math/matrix.hpp:12:
In file included from lib/eigen_3.1.2/Eigen/Dense:1:
In file included from lib/eigen_3.1.2/Eigen/Core:22:
/usr/include/c++/v1/complex:672:19: error: no matching function for call to 'logb'
_Tp __logbw = logb(fmax(fabs(__c), fabs(__d)));
^~~~
lib/eigen_3.1.2/Eigen/src/Core/SelfCwiseBinaryOp.h:188:94: note: in instantiation of function template specialization 'std::__1::operator/<stan::agrad::var>' requested here
tmp = PlainObject::Constant(rows(),cols(), NumTraits<Scalar>::IsInteger ? other : Scalar(1)/other);
^
lib/eigen_3.1.2/Eigen/src/Core/Dot.h:155:9: note: in instantiation of member function 'Eigen::DenseBase<Eigen::Block<Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, -1, 0, -1, -1>, -1,
1, true, true> >::operator/=' requested here
*this /= norm();
^
lib/eigen_3.1.2/Eigen/src/Eigenvalues/EigenSolver.h:332:19: note: in instantiation of member function 'Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1,
-1, 0, -1, -1>, -1, 1, true, true> >::normalize' requested here
matV.col(j).normalize();
^
src/stan/agrad/matrix.cpp:70:21: note: in instantiation of member function 'Eigen::EigenSolver<Eigen::Matrix<stan::agrad::var, -1, -1, 0, -1, -1> >::eigenvectors' requested here
return solver.eigenvectors().real();
^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:135:13: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'double' for 1st argument;
__MATHCALL (logb,, (_Mdouble_ __x));
^
/usr/include/math.h:55:25: note: expanded from macro '__MATHCALL'
__MATHDECL (_Mdouble_,function,suffix, args)
^
/usr/include/math.h:57:22: note: expanded from macro '__MATHDECL'
__MATHDECL_1(type, function,suffix, args); \
^
/usr/include/math.h:65:31: note: expanded from macro '__MATHDECL_1'
extern type __MATH_PRECNAME(function,suffix) args __THROW
^
/usr/include/math.h:68:42: note: expanded from macro '__MATH_PRECNAME'
#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
^
/usr/include/x86_64-linux-gnu/sys/cdefs.h:80:23: note: expanded from macro '__CONCAT'
#define __CONCAT(x,y) x ## y
^
/usr/include/c++/v1/cmath:1386:46: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'float' for 1st argument;
inline _LIBCPP_INLINE_VISIBILITY float logb(float __x) _NOEXCEPT {return logbf(__x);}
^
/usr/include/c++/v1/cmath:1387:46: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'long double' for 1st argument;
inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) _NOEXCEPT {return logbl(__x);}
^
/usr/include/c++/v1/cmath:1392:1: note: candidate template ignored: substitution failure [with _A1 = stan::agrad::var]
logb(_A1 __x) _NOEXCEPT {return logb((double)__x);}
^
In file included from src/stan/agrad/matrix.cpp:4:
In file included from src/stan/agrad/matrix.hpp:4:
In file included from src/stan/math/matrix.hpp:12:
In file included from lib/eigen_3.1.2/Eigen/Dense:1:
In file included from lib/eigen_3.1.2/Eigen/Core:22:
/usr/include/c++/v1/complex:680:15: error: no matching function for call to 'scalbn'
_Tp __x = scalbn((__a * __c + __b * __d) / __denom, -__ilogbw);
^~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:293:13: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'double' for 1st argument;
__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
^
/usr/include/math.h:55:25: note: expanded from macro '__MATHCALL'
__MATHDECL (_Mdouble_,function,suffix, args)
^
/usr/include/math.h:57:22: note: expanded from macro '__MATHDECL'
__MATHDECL_1(type, function,suffix, args); \
^
/usr/include/math.h:65:31: note: expanded from macro '__MATHDECL_1'
extern type __MATH_PRECNAME(function,suffix) args __THROW
^
/usr/include/math.h:68:42: note: expanded from macro '__MATH_PRECNAME'
#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
^
/usr/include/x86_64-linux-gnu/sys/cdefs.h:80:23: note: expanded from macro '__CONCAT'
#define __CONCAT(x,y) x ## y
^
/usr/include/c++/v1/cmath:1570:46: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'float' for 1st argument;
inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __x, int __y) _NOEXCEPT {return scalbnf(__x, __y);}
^
/usr/include/c++/v1/cmath:1571:46: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'long double' for 1st argument;
inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) _NOEXCEPT {return scalbnl(__x, __y);}
^
/usr/include/c++/v1/cmath:1576:1: note: candidate template ignored: substitution failure [with _A1 = stan::agrad::var]
scalbn(_A1 __x, int __y) _NOEXCEPT {return scalbn((double)__x, __y);}
^
In file included from src/stan/agrad/matrix.cpp:4:
In file included from src/stan/agrad/matrix.hpp:4:
In file included from src/stan/math/matrix.hpp:12:
In file included from lib/eigen_3.1.2/Eigen/Dense:1:
In file included from lib/eigen_3.1.2/Eigen/Core:22:
/usr/include/c++/v1/complex:681:15: error: no matching function for call to 'scalbn'
_Tp __y = scalbn((__b * __c - __a * __d) / __denom, -__ilogbw);
^~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:293:13: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'double' for 1st argument;
__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
^
/usr/include/math.h:55:25: note: expanded from macro '__MATHCALL'
__MATHDECL (_Mdouble_,function,suffix, args)
^
/usr/include/math.h:57:22: note: expanded from macro '__MATHDECL'
__MATHDECL_1(type, function,suffix, args); \
^
/usr/include/math.h:65:31: note: expanded from macro '__MATHDECL_1'
extern type __MATH_PRECNAME(function,suffix) args __THROW
^
/usr/include/math.h:68:42: note: expanded from macro '__MATH_PRECNAME'
#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
^
/usr/include/x86_64-linux-gnu/sys/cdefs.h:80:23: note: expanded from macro '__CONCAT'
#define __CONCAT(x,y) x ## y
^
/usr/include/c++/v1/cmath:1570:46: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'float' for 1st argument;
inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __x, int __y) _NOEXCEPT {return scalbnf(__x, __y);}
^
/usr/include/c++/v1/cmath:1571:46: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'long double' for 1st argument;
inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) _NOEXCEPT {return scalbnl(__x, __y);}
^
/usr/include/c++/v1/cmath:1576:1: note: candidate template ignored: substitution failure [with _A1 = stan::agrad::var]
scalbn(_A1 __x, int __y) _NOEXCEPT {return scalbn((double)__x, __y);}
^
In file included from src/stan/agrad/matrix.cpp:4:
In file included from src/stan/agrad/matrix.hpp:4:
In file included from src/stan/math/matrix.hpp:12:
In file included from lib/eigen_3.1.2/Eigen/Dense:1:
In file included from lib/eigen_3.1.2/Eigen/Core:22:
/usr/include/c++/v1/complex:598:9: error: no matching function for call to 'isnan'
if (isnan(__x) && isnan(__y))
^~~~~
lib/eigen_3.1.2/Eigen/src/Core/Functors.h:54:110: note: in instantiation of function template specialization 'std::__1::operator*<stan::agrad::var>' requested here
EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar& b) const { return a * b; }
^
lib/eigen_3.1.2/Eigen/src/Core/SelfCwiseBinaryOp.h:103:13: note: in instantiation of member function 'Eigen::internal::scalar_product_op<std::__1::complex<stan::agrad::var>,
std::__1::complex<stan::agrad::var> >::operator()' requested here
tmp = m_functor(tmp, _other.coeff(index));
^
lib/eigen_3.1.2/Eigen/src/Core/Assign.h:304:11: note: in instantiation of function template specialization
'Eigen::SelfCwiseBinaryOp<Eigen::internal::scalar_product_op<std::__1::complex<stan::agrad::var>, std::__1::complex<stan::agrad::var> >,
Eigen::Block<Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, -1, 0, -1, -1>, -1, 1, true, true>,
Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::__1::complex<stan::agrad::var> >, Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, 1, 0, -1, 1> >
>::copyCoeff<Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::__1::complex<stan::agrad::var> >, Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, 1, 0, -1, 1> > >'
requested here
dst.copyCoeff(i, src);
^
lib/eigen_3.1.2/Eigen/src/Core/SelfCwiseBinaryOp.h:137:61: note: in instantiation of member function
'Eigen::internal::assign_impl<Eigen::SelfCwiseBinaryOp<Eigen::internal::scalar_product_op<std::__1::complex<stan::agrad::var>, std::__1::complex<stan::agrad::var> >,
Eigen::Block<Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, -1, 0, -1, -1>, -1, 1, true, true>,
Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::__1::complex<stan::agrad::var> >, Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, 1, 0, -1, 1> > >,
Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::__1::complex<stan::agrad::var> >, Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, 1, 0, -1, 1> >, 1, 0, 0>::run'
requested here
internal::assign_impl<SelfCwiseBinaryOp, RhsDerived>::run(*this,rhs.derived());
^
lib/eigen_3.1.2/Eigen/src/Core/Assign.h:522:97: note: in instantiation of function template specialization
'Eigen::SelfCwiseBinaryOp<Eigen::internal::scalar_product_op<std::__1::complex<stan::agrad::var>, std::__1::complex<stan::agrad::var> >,
Eigen::Block<Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, -1, 0, -1, -1>, -1, 1, true, true>,
Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::__1::complex<stan::agrad::var> >, Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, 1, 0, -1, 1> >
>::lazyAssign<Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::__1::complex<stan::agrad::var> >, Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, 1, 0, -1, 1> > >'
requested here
static EIGEN_STRONG_INLINE Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.derived()); }
^
lib/eigen_3.1.2/Eigen/src/Core/Assign.h:562:59: note: (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see all)
return internal::assign_selector<Derived,OtherDerived>::run(derived(), other.derived());
^
lib/eigen_3.1.2/Eigen/src/Core/SelfCwiseBinaryOp.h:150:20: note: in instantiation of function template specialization
'Eigen::MatrixBase<Eigen::SelfCwiseBinaryOp<Eigen::internal::scalar_product_op<std::__1::complex<stan::agrad::var>, std::__1::complex<stan::agrad::var> >,
Eigen::Block<Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, -1, 0, -1, -1>, -1, 1, true, true>,
Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::__1::complex<stan::agrad::var> >, Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, 1, 0, -1, 1> > >
>::operator=<Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::__1::complex<stan::agrad::var> >, Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, 1, 0, -1, 1> > >'
requested here
return Base::operator=(rhs);
^
lib/eigen_3.1.2/Eigen/src/Core/SelfCwiseBinaryOp.h:188:7: note: in instantiation of member function
'Eigen::SelfCwiseBinaryOp<Eigen::internal::scalar_product_op<std::__1::complex<stan::agrad::var>, std::__1::complex<stan::agrad::var> >,
Eigen::Block<Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, -1, 0, -1, -1>, -1, 1, true, true>,
Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<std::__1::complex<stan::agrad::var> >, Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, 1, 0, -1, 1> > >::operator='
requested here
tmp = PlainObject::Constant(rows(),cols(), NumTraits<Scalar>::IsInteger ? other : Scalar(1)/other);
^
lib/eigen_3.1.2/Eigen/src/Core/Dot.h:155:9: note: in instantiation of member function 'Eigen::DenseBase<Eigen::Block<Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1, -1, 0, -1, -1>, -1,
1, true, true> >::operator/=' requested here
*this /= norm();
^
lib/eigen_3.1.2/Eigen/src/Eigenvalues/EigenSolver.h:332:19: note: in instantiation of member function 'Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<std::__1::complex<stan::agrad::var>, -1,
-1, 0, -1, -1>, -1, 1, true, true> >::normalize' requested here
matV.col(j).normalize();
^
src/stan/agrad/matrix.cpp:70:21: note: in instantiation of member function 'Eigen::EigenSolver<Eigen::Matrix<stan::agrad::var, -1, -1, 0, -1, -1> >::eigenvectors' requested here
return solver.eigenvectors().real();
^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:235:19: note: candidate function not viable: no known conversion from 'stan::agrad::var' to 'double' for 1st argument;
__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
^
/usr/include/math.h:65:31: note: expanded from macro '__MATHDECL_1'
extern type __MATH_PRECNAME(function,suffix) args __THROW
^
/usr/include/math.h:68:42: note: expanded from macro '__MATH_PRECNAME'
#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
^
/usr/include/x86_64-linux-gnu/sys/cdefs.h:80:23: note: expanded from macro '__CONCAT'
#define __CONCAT(x,y) x ## y
^
/usr/include/c++/v1/cmath:424:1: note: candidate template ignored: substitution failure [with _A1 = stan::agrad::var]
isnan(_A1 __x) _NOEXCEPT
^
4 errors generated.
make: *** [bin/stan/agrad/matrix.o] Error 1
I just tried test-unit with Clang's version of the C++ standard library. To do this, you need to install it and addCFLAGS_GTEST += -std=c++0x
CFLAGS += -DGTEST_USE_OWN_TR1_TUPLE
CFLAGS += -stdlib=libc++
somewhere like make/os_*. But we get errors
Eigen::EigenSolver<matrix_v> solver(m);
return solver.eigenvectors().real();
Eigen::SelfAdjointEigenSolver<matrix_v> solver(m,Eigen::EigenvaluesOnly);
return solver.eigenvalues().real();
SelfAdjointEigenSolver are real by construction.In file included from src/test/io/dump_test.cpp:1:
src/stan/io/dump.hpp:550:14: error: no viable conversion from 'std::__1::basic_istream<char>' to 'bool'
bool ok = in_.get(c);
^ ~~~~~~~~~~
1 error generated.In file included from src/test/io/cmd_line_test.cpp:1:
src/stan/io/cmd_line.hpp:190:16: error: no viable conversion from 'basic_istream<char, std::__1::char_traits<char> >' to 'bool'
return s >> x;
^~~~~~
In file included from src/test/file_includes/stan_gm_test.cpp:1:
In file included from src/stan/gm.hpp:4:
In file included from src/stan/gm/ast_def.cpp:5:
In file included from lib/boost_1.52.0/boost/variant/recursive_variant.hpp:17:
In file included from lib/boost_1.52.0/boost/variant/detail/enable_recursive.hpp:21:
lib/boost_1.52.0/boost/mpl/eval_if.hpp:38:26: error: no type named 'type' in 'boost::result_of<boost::phoenix::actor<boost::spirit::attribute<1> > (boost::spirit::unused_type,
boost::spirit::context<boost::fusion::cons<std::__1::vector<stan::gm::var_decl, std::__1::allocator<stan::gm::var_decl> > &, boost::fusion::cons<bool, boost::fusion::cons<int,
boost::fusion::nil> > >, boost::fusion::vector1<bool> >)>'
typedef typename f_::type type;
~~~~~~~~~~~~~^~~~
In file included from src/test/file_includes/stan_gm_test.cpp:1:
In file included from src/stan/gm.hpp:6:
In file included from src/stan/gm/compiler.hpp:6:
In file included from src/stan/gm/parser.hpp:8:
In file included from lib/boost_1.52.0/boost/spirit/include/qi.hpp:16:
In file included from lib/boost_1.52.0/boost/spirit/home/qi.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/action.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/action/action.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/meta_compiler.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/support/meta_compiler.hpp:19:
In file included from lib/boost_1.52.0/boost/proto/proto.hpp:12:
In file included from lib/boost_1.52.0/boost/proto/core.hpp:21:
In file included from lib/boost_1.52.0/boost/proto/fusion.hpp:24:
In file included from lib/boost_1.52.0/boost/fusion/include/transform.hpp:10:
In file included from lib/boost_1.52.0/boost/fusion/algorithm/transformation/transform.hpp:10:
In file included from lib/boost_1.52.0/boost/fusion/view/transform_view/transform_view.hpp:14:
In file included from lib/boost_1.52.0/boost/fusion/view/transform_view/transform_view_iterator.hpp:17:
lib/boost_1.52.0/boost/fusion/view/transform_view/detail/value_of_impl.hpp:36:74: error: no type named 'type' in
'boost::mpl::apply<boost::fusion::detail::apply_transform_result<boost::spirit::detail::expand_arg<boost::spirit::context<boost::fusion::cons<std::__1::vector<stan::gm::var_decl,
std::__1::allocator<stan::gm::var_decl> > &, boost::fusion::cons<bool, boost::fusion::cons<int, boost::fusion::nil> > >, boost::fusion::vector1<bool> > > >,
boost::phoenix::actor<boost::spirit::attribute<1> >, mpl_::na, mpl_::na, mpl_::na, mpl_::na>'
typedef typename mpl::apply<transform_type, value_type>::type type;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from src/test/file_includes/stan_gm_test.cpp:1:
In file included from src/stan/gm.hpp:6:
In file included from src/stan/gm/compiler.hpp:6:
In file included from src/stan/gm/parser.hpp:8:
In file included from lib/boost_1.52.0/boost/spirit/include/qi.hpp:16:
In file included from lib/boost_1.52.0/boost/spirit/home/qi.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/action.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/action/action.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/meta_compiler.hpp:15:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/domain.hpp:18:
lib/boost_1.52.0/boost/spirit/home/support/context.hpp:108:13: error: no matching constructor for initialization of 'boost::fusion::cons<stan::gm::var_decl &, boost::fusion::cons<bool,
boost::fusion::cons<int, boost::fusion::nil> > >'
) : attributes(
^
In file included from src/test/file_includes/stan_gm_test.cpp:1:
In file included from src/stan/gm.hpp:6:
In file included from src/stan/gm/compiler.hpp:6:
In file included from src/stan/gm/parser.hpp:8:
In file included from lib/boost_1.52.0/boost/spirit/include/qi.hpp:16:
In file included from lib/boost_1.52.0/boost/spirit/home/qi.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/action.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/action/action.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/meta_compiler.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/support/meta_compiler.hpp:19:
In file included from lib/boost_1.52.0/boost/proto/proto.hpp:12:
In file included from lib/boost_1.52.0/boost/proto/core.hpp:21:
In file included from lib/boost_1.52.0/boost/proto/fusion.hpp:25:
In file included from lib/boost_1.52.0/boost/fusion/include/as_list.hpp:10:
In file included from lib/boost_1.52.0/boost/fusion/container/list/convert.hpp:11:
lib/boost_1.52.0/boost/fusion/container/list/detail/build_cons.hpp:51:50: error: no type named 'type' in
'boost::fusion::result_of::value_of<boost::fusion::transform_view_iterator<boost::fusion::vector_iterator<const boost::fusion::vector<boost::phoenix::actor<boost::spirit::attribute<1>
>, boost::phoenix::actor<boost::spirit::attribute<2> >, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>, 0>, boost::spirit::detail::expand_arg<boost::spirit::context<boost::fusion::cons<std::__1::vector<stan::gm::var_decl,
std::__1::allocator<stan::gm::var_decl> > &, boost::fusion::cons<bool, boost::fusion::cons<int, boost::fusion::nil> > >, boost::fusion::vector1<bool> > > > >'
typename result_of::value_of<First>::type v = *f;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from src/test/file_includes/stan_gm_test.cpp:1:
In file included from src/stan/gm.hpp:6:
In file included from src/stan/gm/compiler.hpp:6:
In file included from src/stan/gm/parser.hpp:8:
In file included from lib/boost_1.52.0/boost/spirit/include/qi.hpp:16:
In file included from lib/boost_1.52.0/boost/spirit/home/qi.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/action.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/action/action.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/qi/meta_compiler.hpp:14:
In file included from lib/boost_1.52.0/boost/spirit/home/support/meta_compiler.hpp:19:
In file included from lib/boost_1.52.0/boost/proto/proto.hpp:12:
In file included from lib/boost_1.52.0/boost/proto/core.hpp:21:
In file included from lib/boost_1.52.0/boost/proto/fusion.hpp:25:
In file included from lib/boost_1.52.0/boost/fusion/include/as_list.hpp:10:
In file included from lib/boost_1.52.0/boost/fusion/container/list/convert.hpp:11:
lib/boost_1.52.0/boost/fusion/container/list/detail/build_cons.hpp:51:50: error: no type named 'type' in
'boost::fusion::result_of::value_of<boost::fusion::transform_view_iterator<boost::fusion::vector_iterator<const boost::fusion::vector<boost::phoenix::actor<boost::spirit::attribute<1>
>, boost::phoenix::actor<boost::spirit::attribute<2> >, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>, 0>, boost::spirit::detail::expand_arg<boost::spirit::context<boost::fusion::cons<stan::gm::statement &,
boost::fusion::cons<bool, boost::fusion::cons<int, boost::fusion::nil> > >, boost::fusion::vector0<void> > > > >'
typename result_of::value_of<First>::type v = *f;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
clang++ -I src -I lib/eigen_3.1.2 -I lib/boost_1.52.0 -O0 -Wall -Wno-unused-function -Wno-tautological-compare -DGTEST_USE_OWN_TR1_TUPLE -stdlib=libc++ -I ../../../../../lib/boost_1.52.0 -I../../../../../lib/eigen_3.1.2 -I ../../../../../src -lpthread -o src/test/gm/model_specs/function_signatures1 src/test/gm/model_specs/function_signatures1.o -Lbin -lstan
src/test/gm/model_specs/function_signatures1.o: In function `function_signatures1_model_namespace::function_signatures1_model::log_prob(std::__1::vector<stan::agrad::var, std::__1::allocator<stan::agrad::var> >&, std::__1::vector<int, std::__1::allocator<int> >&, std::__1::basic_ostream<char, std::__1::char_traits<char> >*)':
src/test/gm/model_specs/function_signatures1.cpp:(.text._ZN36function_signatures1_model_namespace26function_signatures1_model8log_probERNSt3__16vectorIN4stan5agrad3varENS1_9allocatorIS5_EEEERNS2_IiNS6_IiEEEEPNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE[_ZN36function_signatures1_model_namespace26function_signatures1_model8log_probERNSt3__16vectorIN4stan5agrad3varENS1_9allocatorIS5_EEEERNS2_IiNS6_IiEEEEPNS1_13basic_ostreamIcNS1_11char_traitsIcEEEE]+0x8201): undefined reference to `stan::agrad::eigenvectors(Eigen::Matrix<stan::agrad::var, -1, -1, 0, -1, -1> const&)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [src/test/gm/model_specs/function_signatures1] Error 1
Can you check in the fixes? I've been working
on the matrix libs, so a merge at this point may be
hairy. I'm happy to do it by hand if you send me the
fixes.
My linear algebra's wobbly at best -- I'm happy to
restrict to symmetric inputs to guarantee real-valued
results.
I see that you're using SelfAdjointEigenSolver. With that,
we could either test for symmetry (within some tolerance)
or just doc it as working on the replicated lower-triangular
matrix (which is what it does according to its doc). I'm
happy with either solution.
I'm happy to get rid of eigen decompositions for
asymmetric matrices and change the doc.
The only reason I can see to not get rid of it is because it is already there. But I doubt anyone is using it because it doesn't really make sense. It is rare to see eigenvalues being calculated in statistical models, rarer that the matrix in question is not positive definite, even rarer that the matrix is not symmetric, and I've never seen a statistical model where the relevant quantity is the real part of complex eigenvalues.
> 3) From Ben:
> I'm not sure we should just disappear exposed functions. Can the parser be configured to give a deprecation message /
> suggested alternative if eig() appears in a .stan file?
I'm OK with just disappearing functions that don't make sense.
(See the second quote above for why it doesn't make sense.)
I think Ben's still on the fence. What's everyone else think?
I'm about to change the categorical distribution's behavior
to match the doc and treat outcomes as ranging from 1 to N instead
of the current implementation of 0 to (N-1). This is also a better
fit with the multinomial. This either fixes a bug or breaks backward
compatibility, depending on how you look at it. :-)
If I understand Ben's (3) above, we would leave eigenvalues() and
eigenvectors() as they were and print deprecation warnings if
they're used in a model. Ben -- will we need the .real() to pull
out the real part and if so, will that cause us problems? I'd not
bother with checking complex parts are all zero and printing a warning.
There's not a good way to do that in the current setup without throwing
an exception.
transformed parameters {
vector[K] e;
e <- eigenvalues(Sigma); // or eigenvectors()
}