strange behavior of eigen::select()

烈酒焚心 提交于 2019-12-12 01:12:14

问题


in eigen, the construct:

(R.array() < s).select(P,Q); 

works when either one or both of P,Q are vectors (of the same length as R). But as soon as both of them are scalars, I get a compilation error.

My question is; is the behavior of select in the presence of two scalars a way for eigen to warn me that there are more efficient constructs? If so, what are they?


回答1:


You can workaround by using VectorXd::Constant(size,value) for one argument.



来源:https://stackoverflow.com/questions/21440511/strange-behavior-of-eigenselect

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!