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

Compare two vectors: element wise Minimum

Tags: None
(comma "," separated)
JLoveless
Registered Member
Posts
6
Karma
0
Given two vector u and v as in

Vector2d u(10.1,11), v(21.2,1.2);

Is there a faster element wise comparison for minimum which returns

(10.1,1.2)

Along the same lines, is there a vector comparison which returns a boolean vector (1 for the elements which are equal) as in


Vector2d u(10,11), v(10,1.2);

returns (1,0)

Thanks!
jake
BigDaddyDrew
Registered Member
Posts
14
Karma
0
Code: Select all
u.cwiseMin( v );

u.array() < v.array();
JLoveless
Registered Member
Posts
6
Karma
0
Thank you very much!
Jake


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell