I'm trying to apply a component-wise logical and (&&) to the elements of two different arrays. The first one maps an already allocated buffer while the second one is created from scratch:
Map<Array<unsigned short, DEPTHMAP_HEIGHT, DEPTHMAP_WIDTH, RowMajor> > hypothesisMat(hypothesis);
Array<short int, DEPTHMAP_HEIGHT, DEPTHMAP_WIDTH, RowMajor> depthmapDiff;
As suggested in http://eigen.tuxfamily.org/dox/classEigen_1_1ArrayBase.html#afce9cebae4c9cbb9883e73d515b5570f , I apply the logical and on two boolean arrays obtained applying the greater and lower operators on the previous two arrays:
Array<bool, DEPTHMAP_HEIGHT, DEPTHMAP_WIDTH, RowMajor> rm1;
rm1 = (hypothesisMat>0) && (depthmapDiff<m_dm);
The compilation gives me the following error:
/home/foo/workdir/pso_hand_tracker/palm_problem.cpp:82:50: error: no match for ‘operator&&’ in ‘((Eigen::ArrayBase<Eigen::Array<short int, 480, 640, 1> >*)(& depthmapDiff))->Eigen::ArrayBase<Derived>::operator><Eigen::Array<short int, 480, 640, 1> >((* &(Eigen::ArrayBase<Eigen::Array<short int, 480, 640, 1, 480, 640> >::Scalar)((PalmProblem*)this)->PalmProblem::m_dm)) && ((Eigen::ArrayBase<Eigen::Array<short int, 480, 640, 1> >*)(& depthmapDiff))->Eigen::ArrayBase<Derived>::operator< <Eigen::Array<short int, 480, 640, 1> >((* &(Eigen::ArrayBase<Eigen::Array<short int, 480, 640, 1, 480, 640> >::Scalar)((PalmProblem*)this)->PalmProblem::m_dm))’
/home/foo/workdir/pso_hand_tracker/palm_problem.cpp:82:50: note: candidate is:
/home/foo/workdir/pso_hand_tracker/palm_problem.cpp:82:50: note: operator&&(bool, bool) <built-in>
/home/foo/workdir/pso_hand_tracker/palm_problem.cpp:82:50: note: no known conversion for argument 2 from ‘const Eigen::CwiseUnaryOp<std::binder2nd<std::less<short int> >, const Eigen::Array<short int, 480, 640, 1> >’ to ‘bool’