Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Can this run any faster?
Replies: 36   Last Post: May 9, 2013 12:04 PM

 Messages: [ Previous | Next ]
 Marc Posts: 108 Registered: 7/2/10
Re: Can this run any faster?
Posted: May 8, 2013 10:28 PM

"Elnaz " <ebsadeghian@gmail.com> wrote in message <kmelul\$5ku\$1@newscl01ah.mathworks.com>...
> Hi all,
>
> After a long time while I 'm still suffering from long simulations I came back to this thread and vow!
> Thanks so much Bruno, Roger, and Steve.
> To sum everything up let me go over the problem and let's agree over the final solution:
> Here is the original excerpt from MATLAB:
> a=zeros(16,length);
> a=a-inf;
> a(1,1)=0;
> for i= 2:length
> for j= 1:32
> A = a(transitions(j,2),i);
> B = a(transitions(j,1),i-1) + ug(j, i-1) + eg(j, i-1);
> if(A == -inf && B == -inf)
> a(transitions(j,2),i) = -inf;
> else
> a(transitions(j,2),i) = max(A,B) + log(1+exp(-abs(A-B)));
> end
> end
> end
> The main time-consuming part is the line with "max(A,B) + log(1+exp(-abs(A-B))); " which is the exact calculation of Jacobian Logarithm. We want to minimize the overall time either by reducing the number of times this calculation is required or by manipulating the calculation itself.
> In parantheses, if I substitute the Jac Log with a LUT it'll make it much faster but then the accuracy is lost. So, we knowingly avoid that solution.
> Bruno and/or Roger, could you please give the final solution in MATLAB script (not in mex) in the following?
>
> Thanks,
> Elnaz

What is wrong with mex? Seems like you have several final answers. Now it is up to you to find out which one works best.

Believe it or not, Bruno has a day job.

Date Subject Author
4/10/13 Roger Stafford
4/10/13 dpb
4/10/13 Roger Stafford
4/10/13 Bruno Luong
4/10/13 EBS
4/10/13 Bruno Luong
4/10/13 Bruno Luong
4/11/13 Bruno Luong
4/11/13 Bruno Luong
4/10/13 Steven Lord
4/10/13 Bruno Luong
4/11/13 Robert Miethe
4/11/13 Yair Altman
4/11/13 EBS
4/11/13 Bruno Luong
4/11/13 Steven Lord
4/11/13 Bruno Luong
4/11/13 Bruno Luong
4/11/13 Steven Lord
4/12/13 Roger Stafford
4/12/13 Bruno Luong
4/12/13 Roger Stafford
4/13/13 Bruno Luong
4/13/13 Bruno Luong
4/13/13 Bruno Luong
4/13/13 Bruno Luong
4/13/13 Bruno Luong
4/14/13 Roger Stafford
4/14/13 Bruno Luong