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

Is there any builtin round(), floor(), ceil() in Eigen?

Tags: None
(comma "," separated)
sth4nth
Registered Member
Posts
13
Karma
0
round(), floor(), ceil() are very useful functions. It will be great If there are vectorized versions of them in EIgen.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
We don't have them because we don't want to become an all-purpose math library, only a matrix library and related features, but we've never needed round/ceil/floor in this context.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
I disagree, I think these functions are very useful, e.g., when you deal with 2D/3D grids...
User avatar
bjacob
Registered Member
Posts
658
Karma
3
OK, well feel free to add them then :)


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
User avatar
fearhope
Registered Member
Posts
20
Karma
0
OS
I agree that those are useful function.
so, if not possible to add many functions under the Matrix definition,
how about include a function to call user-defined function by a reference ?

for example:

double floorX(double &a)
{
b=floor(a)

return b;
}

Matrix2D A(2,2);
A.iterate(floorX); // call user-defined function

please take into account this~
I think it's good to get better performance.
compared to Matlab, it's still far away in terms of efficiency.

hope it to be real !
User avatar
fearhope
Registered Member
Posts
20
Karma
0
OS
I have found really what I want in KDE. ;D
==> viewtopic.php?t=47915

haha~ now I could make beautiful codes ! ^-^

fearhope wrote:I agree that those are useful function.
so, if not possible to add many functions under the Matrix definition,
how about include a function to call user-defined function by a reference ?

for example:

double floorX(double &a)
{
b=floor(a)

return b;
}

Matrix2D A(2,2);
A.iterate(floorX); // call user-defined function

please take into account this~
I think it's good to get better performance.
compared to Matlab, it's still far away in terms of efficiency.

hope it to be real !


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]