Re: [R] Find a rectangle of maximal area

2010-03-22 Thread Ray Brownrigg
On Tue, 23 Mar 2010, Jim Lemon wrote: > On 03/23/2010 10:23 AM, Ray Brownrigg wrote: > > ... > > > > How about less than 2 seconds? [And 500 points in less than 15 seconds - > > on a 2-year-old DELL Optiplex GX755.] > > > > The implementation below (at end) loops over all 'feasible' pairs of x > >

Re: [R] Find a rectangle of maximal area

2010-03-22 Thread Frank E Harrell Jr
A fast Fortran solution may be found by: require(Hmisc) ?largest.empty Frank Ray Brownrigg wrote: On Tue, 23 Mar 2010, Hans W Borchers wrote: Barry Rowlingson lancaster.ac.uk> writes: On Mon, Mar 22, 2010 at 4:28 PM, Hans W Borchers googlemail.com> wrote: Still I believe that a clever app

Re: [R] Find a rectangle of maximal area

2010-03-22 Thread Jim Lemon
On 03/23/2010 10:23 AM, Ray Brownrigg wrote: ... How about less than 2 seconds? [And 500 points in less than 15 seconds - on a 2-year-old DELL Optiplex GX755.] The implementation below (at end) loops over all 'feasible' pairs of x values, then selects the largest rectangle for each pair, su

Re: [R] Find a rectangle of maximal area

2010-03-22 Thread Ray Brownrigg
Sorry, minor tweak to the algorithm in line 16 (thanks Barry). Looks better now (at end again). Ray On Tue, 23 Mar 2010, Ray Brownrigg wrote: > On Tue, 23 Mar 2010, Hans W Borchers wrote: > > Barry Rowlingson lancaster.ac.uk> writes: > > > On Mon, Mar 22, 2010 at 4:28 PM, Hans W Borchers > > >

Re: [R] Find a rectangle of maximal area

2010-03-22 Thread Ray Brownrigg
On Tue, 23 Mar 2010, Hans W Borchers wrote: > Barry Rowlingson lancaster.ac.uk> writes: > > On Mon, Mar 22, 2010 at 4:28 PM, Hans W Borchers > > > > googlemail.com> wrote: > > > Still I believe that a clever approach might be possible avoiding the > > > need to call a commercial solver. I am gett

Re: [R] Find a rectangle of maximal area

2010-03-22 Thread Rolf Turner
On 23/03/2010, at 6:03 AM, Barry Rowlingson wrote: (Commenting on the sort of articles to be found in Computer Science journals) > The idea of actually producing some dirty, filthy, actual code to > implement their shiny algorithms never seems to cross their minds. Fortune?

Re: [R] Find a rectangle of maximal area

2010-03-22 Thread Hans W Borchers
Barry Rowlingson lancaster.ac.uk> writes: > > On Mon, Mar 22, 2010 at 4:28 PM, Hans W Borchers > googlemail.com> wrote: > > > Still I believe that a clever approach might be possible avoiding the need > > to > > call a commercial solver. I am getting this hope from one of Jon Bentley's > > ar

Re: [R] Find a rectangle of maximal area

2010-03-22 Thread Barry Rowlingson
On Mon, Mar 22, 2010 at 4:28 PM, Hans W Borchers wrote: > Still I believe that a clever approach might be possible avoiding the need to > call a commercial solver. I am getting this hope from one of Jon Bentley's > articles in the series Programming Pearls. > Is this the 'Largest Empty Rectangle

Re: [R] Find a rectangle of maximal area

2010-03-22 Thread Hans W Borchers
Hans W Borchers googlemail.com> writes: > > For an application in image processing -- using R for statistical purposes -- > I need to solve the following task: > > Given n (e.g. n = 100 or 200) points in the unit square, more or less > randomly distributed. Find a rectangle of maximal area withi

Re: [R] Find a rectangle of maximal area

2010-03-21 Thread Erwin Kalvelagen
Hans W Borchers googlemail.com> writes: > > For an application in image processing -- using R for statistical purposes -- I > need to solve the following task: > > Given n (e.g. n = 100 or 200) points in the unit square, more or less randomly > distributed. Find a rectangle of maximal area wit

Re: [R] Find a rectangle of maximal area

2010-03-21 Thread Jim Lemon
On 03/21/2010 10:12 PM, Hans W Borchers wrote: For an application in image processing -- using R for statistical purposes -- I need to solve the following task: Given n (e.g. n = 100 or 200) points in the unit square, more or less randomly distributed. Find a rectangle of maximal area within the

[R] Find a rectangle of maximal area

2010-03-21 Thread Hans W Borchers
For an application in image processing -- using R for statistical purposes -- I need to solve the following task: Given n (e.g. n = 100 or 200) points in the unit square, more or less randomly distributed. Find a rectangle of maximal area within the square that does not contain any of these points