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

How to use eigen to rewrite numpy's code

Tags: None
(comma "," separated)
leefty
Registered Member
Posts
2
Karma
0
I have a piece of numpy code.
Code: Select all
distance = np.ones((N,)) * 1e10
         mask = dist < distance     
        distance[mask] = dist[mask]


l think the distance and dist is a matrix or a vector.through comparing the value of distance and dist,I want to find a smaller value and store that in distance.
In c++,I can only do this with a for loop.Does eigen have a wrapped function to implement this operation.thank!!
leefty
Registered Member
Posts
2
Karma
0
"select" function can do it.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]