Rank: 184 based on 463 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.


 

Watch this Author's files

 

Files Posted by James Tursa 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 29 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 6 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 4 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 14 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 6 3
  • 5.0
5.0 | 2 ratings
Comments and Ratings by James Tursa 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 Tursa's Files View all
Updated File Comment by Comments Rating
15 Dec 2014 reshape0, reshaping with padding or truncating A c-mex routine for reshaping with padding or truncating Author: James Tursa Andrew

A great efficient mex file, but because it makes use of the undocumented mxCreateReference function, which was removed in R2014a, it will only work up to R2013b.

13 Dec 2014 MTIMESX - Fast Matrix Multiply with Multi-Dimensional Support Beats MATLAB 300% - 400% in some cases ... really! Author: James Tursa Royi Avital

Can anyone compare the performance to MATLAB R2014b?

Thank You.

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

Is mtimesx working on linux? I have ubuntu 12.04, and it cannot compile. Also, does it work with gpuArrays?
Thanks,

Octavian

11 Dec 2014 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 Sagar

I got the following error, any idea?

mex('C:\Users\spp554\Desktop\Research_UT_Backup\NCAR\uninit.c','-output','C:\Users\spp554\Desktop\Research_UT_Backup\NCAR\uninit')


No supported SDK or compiler was found on this computer.
For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013b/win64.html


Error using uninit (line 148)
Unable to compile uninit ... Contact author.

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

Hi James,
I had a question about how the flags 't' and 'c' are used by sparse matrix arguments. I assume that the flags are there to circumvent explicit transposes and its associated overhead. Yet, it doesn't appear that sparse mtimesx operations make use of them. In the test below, I see basically the same execution speeds in all 3 versions. Is it true that sparse operations can't make use of the flags, and is it deliberate/inevitable? It would be a great benefit to be able to avoid transposing tall sparse matrices because of the high memory consumption that comes with that.

J=sprand(3192027,3225,.0001);

tic;
mtimesx(J,'t',J);
toc

tic;
mtimesx(J.',J);
toc

tic;
J.'*J;
toc

Contact us