Rank: 102 based on 558 downloads (last 30 days) and 28 files submitted
photo

James Tursa

E-mail
Lat/Long
47.68167, -122.2075

Personal Profile:

Interested in external applications, mex & engine applications with Fortran, C, C++, etc.

Professional Interests:

 

Watch this Author's files

 

Files Posted by James View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
30 Oct 2013 Screenshot LOADFIXNAMES loads a mat file, fixing invalid names Loads a mat file into the caller's workspace, fixing invalid variable and field names. Author: James Tursa load, mat, invalid 19 1
13 Jun 2013 Screenshot mexPutVariableSharedDataCopy This C routine puts a shared data copy of a variable into a workspace from a mex routine Author: James Tursa mex, mexputvariable, mexputvariablesharedd..., shared data copy 8 0
14 Mar 2013 SPARSECLEAN - Efficiently cleans a sparse matrix of small values or nan SPARSECLEAN cleans a double sparse matrix of small or nan values or values within a range. Author: James Tursa sparse, clean, nan 12 0
11 Dec 2011 Screenshot Fortran 95 Interface to MATLAB API with extras! This is the one you have been waiting for, a clean interface using assumed shape Fortran pointers. Author: James Tursa fortran 95, fortran, 95, mex, engine, api 27 33
  • 5.0
5.0 | 5 ratings
09 May 2011 Screenshot UNINIT - Create an uninitialized variable (like ZEROS but faster) UNINIT is similar to ZEROS, except UNINIT returns uninitialized values instead of zero values. Author: James Tursa uninit, zeros, ones, allocate, preallocate 21 2
  • 5.0
5.0 | 2 ratings
Comments and Ratings by James View all
Updated File Comments Rating
07 Jun 2014 MTIMESX - Fast Matrix Multiply with Multi-Dimensional Support Beats MATLAB 300% - 400% in some cases ... really! Author: James Tursa

Hmmm ... Well, I don't have access to R2014 so I will have to code in the blind on this. My understanding is that MATLAB will in real time make a guess as to the correct compiler to use based on source code extension. So the information that was in mexopts.bat (user had already selected a compiler) is no longer available for my automatic build stuff. I will put out an update shortly, but may have to ask for info direct from the user for compiler stuff. I will try to get it out there sometime next week.

25 Jan 2014 Fortran 95 Interface to MATLAB API with extras! This is the one you have been waiting for, a clean interface using assumed shape Fortran pointers. Author: James Tursa

@ageage Juan: When you compile the modules, the compiler will typically generate both .obj and .mod files (the .mod file maybe with a machine specific extension). When you mex routines that USE these modules, include the .obj file name at the end of your mex command line (you don't need to include the .mod file name in the mex command line because the compiler/linker will automatically look for that)

23 Jan 2014 Cody Problem Two Answer to Cody Problem Two Author: Justin

Cody solutions should not be posted to the FEX. Please remove this submission.

23 Jan 2014 Cody Problem One Answer to Cody Problem One Author: Justin

Cody solutions should not be posted to the FEX. Please remove this submission.

22 Jul 2013 Decimal real number -1.0 to 1.0 to 2's comp binary Transforms a decimal real number in range of -1.0 to 1.0 into a 2's comp binary number Author: Carsten

OK, re-evaluation. The function does seem to work for the fractional number range as stated ... at least it is matching the MATLAB built-in function results. However, my other comments about not having a help section at the top of the file and not being vectorized (e.g., see last example below that doesn't match) still stand. Also there should probably be some input error checking to throw an error if the input is not in the expected range. So I will bump up my rating based on this.

>> x = 2*rand-1
x =
-0.5377
>> dec2bin(typecast(int32(x*2^31),'uint32'),32)
ans =
10111011001010111110010011000101
>> dec2bit(x,32)
ans =
10111011001010111110010011000101
>> x = 2*rand-1
x =
0.2137
>> dec2bin(typecast(int32(x*2^31),'uint32'),32)
ans =
00011011010110100000100100011010
>> dec2bit(x,32)
ans =
00011011010110100000100100011010
>> x = 2*rand-1
x =
-0.0280
>> dec2bin(typecast(int32(x*2^31),'uint32'),32)
ans =
11111100011010010101100011011010
>> dec2bit(x,32)
ans =
11111100011010010101100011011010
>> x = 1
x =
1
>> dec2bin(typecast(int32(x*2^31),'uint32'),32)
ans =
01111111111111111111111111111111
>> dec2bit(x,32)
ans =
01111111111111111111111111111111
>> x = -1
x =
-1
>> dec2bin(typecast(int32(x*2^31),'uint32'),32)
ans =
10000000000000000000000000000000
>> dec2bit(x,32)
ans =
10000000000000000000000000000000
>> x = [rand;rand]
x =
0.8913
0.7621
>> dec2bin(typecast(int32(x*2^31),'uint32'),32)
ans =
01110010000101100001010110100011
01100001100011000110001110010111
>> dec2bit(x,32)
ans =
01110010000101100001010110100011
01100001100011000110001110010111
>> x = [1 0.5 -0.5 -1]
x =
1.0000 0.5000 -0.5000 -1.0000
>> dec2bin(typecast(int32(x*2^31),'uint32'),32)
ans =
01111111111111111111111111111111
01000000000000000000000000000000
11000000000000000000000000000000
10000000000000000000000000000000
>> dec2bit(x,32)
ans =
10000000000000000000000000000000
01000000000000000000000000000000
01000000000000000000000000000000
10000000000000000000000000000000

Comments and Ratings on James' Files View all
Updated File Comment by Comments Rating
28 Aug 2014 mxGetPropertyPtr C-mex function Fast memory efficient alternative to the API function mxGetProperty. Author: James Tursa Bar, Ilan

Works great for Windows. Is there a solution for LINUX as well?

04 Jul 2014 MTIMESX - Fast Matrix Multiply with Multi-Dimensional Support Beats MATLAB 300% - 400% in some cases ... really! Author: James Tursa Julien

From my understanding, the file "mex_C_win64.xml" replaces "mexopts.bat".
"Error using mtimesx_build (line 169)
A C/C++ compiler has not been selected with mex -setup". I replaced line 169 by : mexopts = [prefdir '\mex_C_win64.xml'];. It did work with a few warnings...

18 Jun 2014 MTIMESX - Fast Matrix Multiply with Multi-Dimensional Support Beats MATLAB 300% - 400% in some cases ... really! Author: James Tursa Matt J

Thanks, James. This thread describes where the information has moved to

http://www.mathworks.com/matlabcentral/answers/67521#answer_138814

I can post those xml files somewhere, if you like. However, is there no way to get mtimesx to compile simply with the "mex" command, maybe with a small sacrifice in performance?

07 Jun 2014 MTIMESX - Fast Matrix Multiply with Multi-Dimensional Support Beats MATLAB 300% - 400% in some cases ... really! Author: James Tursa Tursa, James

Hmmm ... Well, I don't have access to R2014 so I will have to code in the blind on this. My understanding is that MATLAB will in real time make a guess as to the correct compiler to use based on source code extension. So the information that was in mexopts.bat (user had already selected a compiler) is no longer available for my automatic build stuff. I will put out an update shortly, but may have to ask for info direct from the user for compiler stuff. I will try to get it out there sometime next week.

03 Jun 2014 MTIMESX - Fast Matrix Multiply with Multi-Dimensional Support Beats MATLAB 300% - 400% in some cases ... really! Author: James Tursa Matt J

Thought I'd ping again. It doesn't look like mtimesx_build is compatible with R2014, since it looks for mexopts.bat, which is now gone. Can we hope to get a version that supports R2014? James?

Contact us