From: "Alan Chalker" <alanc@osc.edu>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webcrossing
Newsgroups: comp.soft-sys.matlab
Subject: Re: Obfuscation
Message-ID: <ef55232.8@webcrossing.raydaftYaTP>
Date: Wed, 9 May 2007 13:38:21 -0400
References: <ef55232.0@webcrossing.raydaftYaTP> <ef55232.2@webcrossing.raydaftYaTP> <ef55232.3@webcrossing.raydaftYaTP> <ef55232.5@webcrossing.raydaftYaTP> <ef55232.7@webcrossing.raydaftYaTP>
Lines: 33
NNTP-Posting-Host: 192.148.249.120
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: news.mathworks.com comp.soft-sys.matlab:407956



Markus wrote:
>
>
> Hi!
>
> I am having the same problem with the bsxfun error message, as I am
> running R2006a. The contest team did a good job in obfuscation, or
> what do you think about these lines?
>
> % mf = @(g,h) arrayfun(@(h)
> all(inpolygon(c{1,g},c{2,g},c{1,h},c{2,h})),h);
> % c = c(:,~(sum(bsxfun(mf,1:size(c,2),(1:size(c,2))'))>1))';
>
> This source couldn't be easier to read I guess :-)
>
> A good contest to all of you!
>
> Markus
  

It's not deliberate obscufation that I can tell. The first line is
setting up an nested anonymous function handle (search for anonymous
functions in the MATLAB help for info). bsxfun is a new one to me,
but it applies element by element binary operations to 2 arrays.

The bottom line is they have used some of the more advanced
functionality to setup a demo solver and runcontest program that is
vectorized versus containing a lot of loops. This also factors into
the new Complexity rating.

Kudos to them for setting the bar high on this contest by trying to
start us off on a vectorized path instead of the 'easier to follow'
looping path many people would prefer to take.