This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Component-wise exponentials

Tags: None
(comma "," separated)
mtabbara
Registered Member
Posts
1
Karma
0

Component-wise exponentials

Sun May 12, 2013 11:01 am
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.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Component-wise exponentials

Sun May 12, 2013 8:30 pm
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.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]