Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9320733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:42:37+00:00 2026-06-19T03:42:37+00:00

I am using Intel’s Visual Fortran Composer XE 2011, 12.1.3537.2010 and as it appears,

  • 0

I am using Intel’s Visual Fortran Composer XE 2011, 12.1.3537.2010 and as it appears, the intrinsic findloc function is not supported (added at 2008 fortran mid-size extrension).

What I want to do is to look up for a specific value in an array and have the index returned. Mostly I work with small size arrays.

I have 2 questions:

  1. I would like to replace linear and binary searches with this functionality, and as I read in other threads it is not clear which algorithm is preferred for optimal performance. How does the intrinsic function deals with the problem?
  2. Since with my compiler this is not supported, a way to emulate findloc would be the following:

    minloc( (array-value)**2 )
    

    But… what about the performance? Any other ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T03:42:39+00:00Added an answer on June 19, 2026 at 3:42 am

    If I understand your first question correctly you want to know how an, as yet unimplemented, function is implemented ? Specifically, you want to know the performance characteristics of findloc compared with linear and binary search as you might have implemented them yourself ? There is certainly nothing in the language standard which mandates how the function is to be implemented, so the answer to your question is entirely compiler specific.

    As to your second question, I would expect most compilers to cause the creation of a temporary array in response to your expression array-value. The creation of such a temporary is likely to be a relatively time-consuming operation and will be added to the execution time of the call to minloc. How the Intel implementation of minloc works I don’t know but I expect that it is a linear scan through the array. There’s no way for the intrinsic function to know that an array is sorted and that binary search might be faster.

    If your arrays are small and unsorted I would expect linear search to be the fastest option. If they are small and sorted you might be able to write a binary search (or similar) to outperform linear search. I expect the performance graphs of the two approaches to have a crossover, where that crossover sits wrt your idea of small size I haven’t a clue.

    However, as always with performance matters, what I (or anybody else) think is useless, data is what you need, why don’t you go ahead and make some measurements ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Intel Visual Fortran Composer XE 2011 to build my Fortran project
I'm using Intel Fortran Composer 2011 on a Linux Mint 12 system. Every time
I am using Intel Fortran Composer XE. I just built a static library which
I am using Intel's FORTRAN compiler to compile a numerical library. The test case
Is anyone here using the Intel C++ compiler instead of Microsoft's Visual c++ compiler?
I'm using x86 intel machine, and windows 7, plus Visual C++ (versions 2005/2012 express)
I am using Intel VTune Amplifier XE 2011 to analyze the performance of my
I'm writing a matrix multiplication subroutine in Fortran. I'm using the Intel Fortran compiler.
I have some legacy Fortran code which I'm recompiling using the latest Intel compiler
I have compiled my application on Linux (Intel) machine using this command gcc –g

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.