[mlpack] Question about Armadillo
Ryan Curtin
ryan at ratml.org
Tue Jun 27 11:35:35 EDT 2017
On Tue, Jun 27, 2017 at 08:28:00PM +0500, Kirill Mishchenko wrote:
> > I believe this is a result of strange inference by the compiler. You
> > should double-check my explanation here, I'm not 100% sure that it is
> > correct, but my gut feeling is that it is…
>
> It looks like there is some other reason. I got the same error when I tried the following
>
> template<typename T>
> void g(const T&)
> {
> const T& ref = arma::join_rows(arma::zeros(2).t(), arma::zeros(2).t());
> arma::mat m = ref;
> }
>
> BOOST_AUTO_TEST_CASE(RefTest4)
> {
> g(arma::join_rows(arma::zeros(2).t(), arma::zeros(2).t()));
> }
I think this is the same thing, the compiler deduces a strange type for
T. Also, sometimes Armadillo can give better output when compiled in
debugging mode (so I guess reconfigure CMake with -DDEBUG=ON), that may
provide a better output for diagnosis than just a segfault.
I am curious, do you know what the deduced type for T is? That may shed
additional light on the failure.
--
Ryan Curtin | "Wha' happened?"
ryan at ratml.org | - Mike LaFontaine
More information about the mlpack
mailing list