home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!mm-mac25.mse.uiuc.edu!gaylord
- From: gaylord@ux1.cso.uiuc.edu (Richard J. Gaylord)
- Newsgroups: sci.math.symbolic
- Subject: Re: Rootterdam Competition in Mathematica Journal
- Message-ID: <BxvDMD.4Gv@news.cso.uiuc.edu>
- Date: 17 Nov 92 16:54:11 GMT
- Article-I.D.: news.BxvDMD.4Gv
- References: <BxtJGM.472@news.cso.uiuc.edu>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: University of Illinois
- Lines: 25
- X-Xxdate: Tue, 17 Nov 92 10:55:53 GMT
- X-Useragent: Nuntius v1.1.1d12
- X-Xxmessage-Id: <A72E803946029B19@mm-mac25.mse.uiuc.edu>
-
-
- it has been pointed out to me by Victor at wri that the splitFast
- function can be 'elegantized' by dropping the Block structure (which also
- gives it a bit more speed).
-
-
- > splitFastandElegant[lis_, parts_] :=
- Inner[Take[lis,{#1,#2}]&,
- Drop[#1,-1]+1,
- Rest[#1],
- List]&[ FoldList[Plus,0,parts] ]
-
-
- comparing this to my program
-
- split[lis_, parts_] :=
- Map[Take[lis, #]&,
- Drop[Thread[List[# + 1, RotateLeft[#]]]&
- [FoldList[Plus,0,parts]], -1] ]
-
- i have to agree with victor that the top program is really nice looking
- (i like using Inner).
-
-
- 'in gustibus non disputandum'
-