Rank: 1331 based on 53 downloads (last 30 days) and 6 files submitted
photo

Peter Li

E-mail
Company/University
The Salk Institute

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Peter View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
27 Jun 2013 nth_element MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel. Author: Peter Li median, cpp, rank selection, nth_element, selection, selection algorithm 20 15
  • 4.5
4.5 | 2 ratings
13 Sep 2012 waitfordata Block Matlab while specified fig is open, then grab APPDATA when fig is closing. Author: Peter Li gui 2 0
08 Nov 2011 More intuitive subplot Matlab's subplot is useful for throwing figures together but the indexing is very counter-intuitive. Author: Peter Li plot, gui 1 2
29 Sep 2011 Faster/parallel random number generator via standard C++ Mersenne Twister from Boost Random: same as modern Matlab, faster. Plus flexible distributions! Author: Peter Li random number, monte carlo, mersenne twister, boost, c, actors 3 3
18 Apr 2007 LSM File Toolbox Functions for reading info databases of Zeiss LSM confocal microscope files. Author: Peter Li data import, data export, lsm, zeiss, confocal, laser scanning 25 10
  • 4.5
4.5 | 7 ratings
Comments and Ratings by Peter View all
Updated File Comments Rating
26 Jun 2013 nth_element MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel. Author: Peter Li

Well, this reply is very late, but Matthias I don't quite understand your issue. fast_median does work on the first dimension by default and seems to do the right thing with your example: med = fast_median(data(:));

The thing fast_median does not do is operate on row vectors, which is a common Matlab behavior I have not chosen to support; is that what you meant to ask about?

01 Jul 2012 Matlab Icon for Linux (with Transparency) A nice icon to use as Matlab start button in Linux. Author: Georg Stillfried

Looks good, but would be nice to have in 256x256.

07 Dec 2011 nth_element MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel. Author: Peter Li

Hi jianbo, I think this is the same as Martijn's request? I may have time to give this a try in the next month or two. Unfortunately I expect it to be significantly slower than just returning the partially-sorted output. This is a limitation of the way the C++ standard library is written and I'm not sure I can get around it. Bruno's version may have more flexibility to be efficient here.

03 Oct 2011 Faster/parallel random number generator via standard C++ Mersenne Twister from Boost Random: same as modern Matlab, faster. Plus flexible distributions! Author: Peter Li

It appears that the minimum spacing for Boost Random 1.47 uniform_01 distribution (doubles between 0 and 1) is ~2.3e-10, which indicates that the RNG is simply taking each int generated by the Twister and (effectively) dividing it by the maximum int.

Matlab's RNG appears to use two int from the Twister for each [0,1] double, using the first int for the more significant bits and the second for the less significant bits.

So essentially using this library will give you faster RNG over Matlab at the expense of lower resolution.

03 Oct 2011 Faster/parallel random number generator via standard C++ Mersenne Twister from Boost Random: same as modern Matlab, faster. Plus flexible distributions! Author: Peter Li

I've noticed that the minimum spacing of random numbers generated by Boost Random 1.47 is greater than the minimum produced by Matlab; it appears to me that Matlab is using twice as many underlying integer seeds from the Twister to produce each double compared to Boost's behavior. So if you need very fine-grained doubles, this may be an issue for you.

Comments and Ratings on Peter's Files View all
Updated File Comment by Comments Rating
26 Jun 2013 nth_element MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel. Author: Peter Li Li, Peter

Well, this reply is very late, but Matthias I don't quite understand your issue. fast_median does work on the first dimension by default and seems to do the right thing with your example: med = fast_median(data(:));

The thing fast_median does not do is operate on row vectors, which is a common Matlab behavior I have not chosen to support; is that what you meant to ask about?

15 Jun 2013 nth_element MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel. Author: Peter Li Jaehwan

27 Feb 2012 nth_element MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel. Author: Peter Li Klemm, Matthias

As a follow up on WurmD's comment: "all" Matlab functions work on the first dimension by default so I think a "replacement" method should do so too.
The current behavior of fast_median breaks things like:
med = median(data(:));

Currently I can't use fast_median in my code as I need to be able to change the filtering function and I don't want to code in some special treatment for fast_median... :/

Would that be possible?

07 Dec 2011 nth_element MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel. Author: Peter Li Li, Peter

Hi jianbo, I think this is the same as Martijn's request? I may have time to give this a try in the next month or two. Unfortunately I expect it to be significantly slower than just returning the partially-sorted output. This is a limitation of the way the C++ standard library is written and I'm not sure I can get around it. Bruno's version may have more flexibility to be efficient here.

05 Dec 2011 nth_element MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel. Author: Peter Li jianbo

Hi, I am interested to have index, rather of the n-th element output, thx.

Top Tags Applied by Peter
c, data export, data import, gui, io
Files Tagged by Peter View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
27 Jun 2013 nth_element MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel. Author: Peter Li median, cpp, rank selection, nth_element, selection, selection algorithm 20 15
  • 4.5
4.5 | 2 ratings
13 Sep 2012 waitfordata Block Matlab while specified fig is open, then grab APPDATA when fig is closing. Author: Peter Li gui 2 0
08 Nov 2011 More intuitive subplot Matlab's subplot is useful for throwing figures together but the indexing is very counter-intuitive. Author: Peter Li plot, gui 1 2
29 Sep 2011 Faster/parallel random number generator via standard C++ Mersenne Twister from Boost Random: same as modern Matlab, faster. Plus flexible distributions! Author: Peter Li random number, monte carlo, mersenne twister, boost, c, actors 3 3
22 Jun 2007 Add folders to path excluding .svn Changes to genpath to exclude the .svn to the path Author: H. Brian Hui addpath, genpath, svn 2 0

Contact us