Re: [eigen] Static asserts in Eigen3 beta1/beta2

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


Hi. The problem is that your function test_v5 takes as its argument a 5x1 double matrix, and you are trying to pass it a 6x1 double matrix. So the message from Eigen makes sense. If you replace�Eigen::Matrix<double,5,1> by�Eigen::Matrix<double,6,1> in the definition of test_v5 then it will work. The problem with this approach is that test_v5 will only work with 6x1 double matrices. If you want to make it more general you can read here�http://eigen.tuxfamily.org/dox-devel/TopicFunctionTakingEigenTypes.html

cheers,
Carlos

On Fri, Nov 19, 2010 at 9:17 PM, hauke strasdat <strasdat@xxxxxxxxx> wrote:
Hi,

I fear this must be a known issue. However, I couldn't find any
information about it.

Let's look at the following minimal program.

---
#include <Eigen/Core>

void test_v5(const Eigen::Matrix<double,5,1> & v)
{
}

int main()
{
�Eigen::Matrix<double,6,1> v6;
�test_v5(v6);
}
---

Compiled against Eigen3 beta1, it leads to a compiler error/static
assert: YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES.
This is the desired behavior, right?

Compiling the same program against Eigen3 beta2, however, leads to no
compiler error! Only at run-time it triggers a assertion.

Is there any way to turn the static assertions back on in Eigen3 beta2?

I am using Ubuntu 10.04 Amd64, with gcc 4.4.

Thanks a lot,
Hauke





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