cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

not able to vectorize min/max?

Werner_E
25-Diamond I

not able to vectorize min/max?

Why can we not vectorize the built-in min() or max() function? Is it a bug or a feature?

Would be convenient in some situations to be able to do so without creating a dummy function like below:

12.10.png

1 REPLY 1
Werner_E
25-Diamond I
(To:Werner_E)

Found a statement by Tom Gutman here http://communities.ptc.com/message/59886#59886:

"max and min are defined to work on arrays, so they do not vectorize."

As I understand it, the vectorization is kind of an implicit loop over the elements of the argument vectors of a funbtion before it is called. If thats true, it should work with min and max, too. An then, my dummy function f() would work with scalars and vectors alike, as does min() and vectorization works with it. Built-in operators like multiplication accept vector and scalars alike and can be veoctorized.

So whats the problem with min/max? Should it considered a bug or just a missing feature?

Announcements

Top Tags