Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29283 Discussions

is there anything faster than maxloc for a sort vector

rodrigo_acj
Beginner
726 Views
I have to find the greater number in a sorted vector (descending) with a condition (e.g. .LT. ), is there anything faster than maxloc to do it? Equivalently, i'd like to find the first element in a vector thatcomply acondition, e.g. x.EQ.5
0 Kudos
2 Replies
JVanB
Valued Contributor II
726 Views
Given that the vector is already sorted, a binary search ought to converge to the appropriate index rapidly.
0 Kudos
rodrigo_acj
Beginner
726 Views
thnx, i'll prove it
0 Kudos
Reply