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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

not able to vectorize min/max?

Werner_E
24-Ruby V

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

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?

Top Tags