Build a faster Fortran "ismember" function

Job ID: 31479292

Budget: $250 – $750 USD

I'm a hobbyist who has written quite a few Octave programs. In an effort to speed up those programs, I've translated many of them into Fortran.

Octave has a native function called "ismember", but Fortran doesn't. In order for many of my programs to work, I had to build my own Fortran version of ismember. Unfortunately, my Fortran version is considerably slower than Octave's version. For this reason, I'm looking for someone who will build a Fortran ismember function that is, at least, as fast as Octave's.

I've written two programs which are designed to show the vast speed differences between Octave's function, and the one that I have built. If you run these two programs, you'll quickly find that my function is many times slower than Octave's.

Among the files which I have uploaded, there is one called "testspeed.m". If you run this program in Octave, it will generate a test file, and will also display the speeds of Octave's ismember function, when working with that file. If you then compile and run "testspeed.f08", it will read the contents of the file that "testspeed.m" built, and will show its corresponding speeds for my Fortran ismember function. As was mentioned before, your goal will be to build a new Fortran ismember function that is as fast as Octave's. If you run "testspeed.f08", with your new function, instead of my slow one, it should show speeds that are as fast as Octave's version.

If you look at these programs, you'll see that both "testspeed.m" and "testspeed.f08" have a character string variable called 'filename'. You will have to change this to whatever file name that you want to give the file. I used an absolute path, so you'll get an error if you don't give it a name that will work on your system.

I'm highly confident that it's possible to build a Fortran version of the ismember function that is as fast as Octave's. Because Octave is an open source project, a person is able to see the inner-workings of what they've done. I don't care if you imitate their algorithm exactly, or if you devise your own. I just need your Fortran version to be as fast as the Octave version.

I should also note that the Fortran version, that I have built, works with matricies, instead of arrays. So it's like using Octave's ismember function with their 'rows' option. It performs an ismember account, based on the rows of its input matrix. If you're familiar with Octave's function, which is the same as MATLAB's, you'll know what I'm talking about.

I have uploaded thirteen files. All but two of them, are support files which are needed in order for "testspeed.m" and "testspeed.f08" to work. They're generally subfunctions of my version of ismember.

If you're familiar with Fortran and Octave (or MATLAB), then you likely have the skills to perform this task, and I'd love to hear from you. I'm willing to pay a flat fee for your faster version of the function.

Thank you for reading about my project, and if you're able/willing to help, I hope to hear from you.
Related categories: Fortran MATLAB