Construct a matrix by accumulation of indexed values (C, C++, or Fortran)
$30-250 USD
Terminado
Publicado hace más de 6 años
$30-250 USD
Pagado a la entrega
INTRO: The function 'accumarray' in MATLAB is too slow for my codes (because they use large vectors and matrices), so I am seeking a FASTER version satisfying my needs. I am seeking the fastest possible implementation.
GOAL: Write a C, C++, or Fortran code which performs part of the functionality of the MATLAB function "accumarray". Your code must then be made into a MEX function for calling from MATLAB.
DETAILS: Your function must reproduce the following behavior (or similar):
%% GIVEN EXAMPLE INPUTS (This is MATLAB code):
numvalues = 10^6; % number of values to accumulate
matSize = 288; % width of matrix
vals = ones(numvalues,1); % values to be accumulated
xn = uint32(randi(matSize,numvalues,1)); % x index for values
yn = uint32(randi(matSize,numvalues,1)); % y index for values
zn = uint32(randi(matSize,numvalues,1)); % z index for values
pos3 = yn+(xn-1)*matSize+(zn-1)*matSize^2; % only needed for alternative code
%% YOUR FUNCTION WILL GIVE THE SAME OUTPUT THAT MATLAB GIVES USING ACCUMARRAY AS FOLLOWS:
newMat3 = accumarray([yn, xn, zn], vals, [matSize matSize matSize]); % a 3D evaluation
newMat2 = accumarray([yn, xn], vals, [matSize matSize]); % a 2D evaluation
newMat1 = accumarray(yn, vals, [matSize 1]); % a 1D evaluation
%% The above form is preferred, but the following alternative is also acceptable if it improves speed in your function:
newMat3 = accumarray(pos3,vals,[matSize^3 1]);
If possible, please report your expected speedup times.
I am also open to other ideas about how to speedup this function.
I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environment. I made many great projects using c++, for example, I made the tools which could convert java codes into c++ scripts, of course garbage collection included, this was very similar to a compiler, and was very complex. I also made our own mobile game using c++, I can show you the demo of client, if you like. I am very proficient in java also. I have a very good review on Freelancer.com, I never miss a project once I accept the job, you can check my review. Trust me, please let expert help you.
$60 USD en 2 días
4,9 (157 comentarios)
7,1
7,1
14 freelancers están ofertando un promedio de $144 USD por este trabajo
How are you today?
I have good experience with c/c++ and fortran also matlab
i prefer working with c/c++
I have worked similar work but i got without clear algorithm
It is very hard to convert to other code.
Let's discussion chat
Best regards!
Hello I can help you with your task please check my reviews for more information
I have also some questions
Relevant Skills and Experience
MATLAB c cpp python algorithms
Hi. I am good in both Matlab and Fortran (you can find this from my profile with a lot of projects done). So I am sure I will be able to do this functionality using Fortran. Regards
cool project, speeding up is always a challenge I enjoy.
I quickly tested your Matlab script,
the 3D version is 10x faster when gpuArray() (needs CUDA support)
is used, with 1D I don't think you can see any special difference
but the 10x with GPU seems strong
Greetings,
I can help you in Construct a matrix by accumulation of indexed values . Please ping me for more discussion. Please see my profile i have deliver almost 280 projects with 100% client satisfaction.
I have more than 5 years of experience in Algorithm, C Programming, C++ Programming, Matlab and Mathematica, Software Architecture and can deliver your with 100% quality.