Re: [eigen] Overloading componentwise binary operators for vectors

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On Fri, 2 Oct 2015, Cedric Doucet wrote:

Of course, there's a constructor:

template<typename ScalarType>
Vector<ScalarType>::Vector<ScalarType>(std::size_t size)
                            ^^^^^^^^^^^^
you can omit that part.

: wrapped_(size)
{}

It does not work because I get an error message:

erreur: ambiguous overload for ʽoperator+ʼ (operand types are ʽVector<double>ʼ and ʽVector<double>ʼ)
CPPUNIT_ASSERT_EQUAL(sum, left+right);

Sorry, it is impossible to debug random pieces of incomplete code. This is general advice, to get help, you need to give people a way to easily reproduce the error, which means the full program (preferably minimized).

--
Marc Glisse



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/