Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top