Registered Member
|
Hi all,
Is there a way to convince Eigen to turn something of the form a.exp() * b.exp() where a,b are Arrays into (a+b).exp() and similarly for quotients? Can one design a plugin to recognise these kinds of expression before evaluation? Thanks, MT. |
Moderator
|
In Eigen 3.3 you will be able to do that quite easily. In the meantime you might try to do a partial template specialization of:
CwiseBinaryOp<scalar_product_op<Scalar>, CwiseUnaryOp<scalar_exp_op<Scalar>,Lhs>, CwiseUnaryOp<scalar_exp_op<Scalar>,Rhs> and make it inherit something of the form: CwiseUnaryOp<scalar_exp_op<Scalar>, CwiseBinaryOp<scalar_sum_op<Scalar>, Lhs, Rhs> > with appropriate constructors. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]