home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math.symbolic
- Path: sparky!uunet!sun-barr!decwrl!access.usask.ca!kakwa.ucs.ualberta.ca!news
- From: manuel@space.ualberta.ca (John Manuel)
- Subject: I need help with slow Mma code
- Message-ID: <1992Jul21.225045.203@kakwa.ucs.ualberta.ca>
- Sender: news@kakwa.ucs.ualberta.ca
- Nntp-Posting-Host: deimos.space.ualberta.ca
- Reply-To: manuel@space.ualberta.ca (John Manuel)
- Organization: University Of Alberta, Edmonton Canada
- Date: Tue, 21 Jul 1992 22:50:45 GMT
- Lines: 23
-
- I've got a particularly slow section of Mma code which I've GOT to speed up.
- Here's the offending section:
-
- xyz = Select[xyz, ((MemberQ[xSubSampleA, #[[1,1]]]
- &&
- MemberQ[ySubSampleA, #[[1,2]]])
- ||
- (MemberQ[xSubSampleB, #[[1,1]]]
- &&
- MemberQ[ySubSampleB, #[[1,2]]])) &];
-
- xyz is a 20,000 X 2 X 2 array of real numbers and the SubSample arrays are
- each <100 elements in length and are also composed of real numbers. The code
- extracts a subset of values from xyz (usually about 1,000 elements of the
- 20,000) for later processing, but does so quite slowly (~4 minutes in 2.0 on
- a NeXT).
-
- Does anyone know of a more efficient, but still concise, way to do this?
-
- --
- John R. Manuel Department of Physics, University of Alberta
- manuel@space.ualberta.ca Edmonton, Alberta, CANADA, T6G 2J1
- Office: (403) 492-2526 (NeXTMail OK) Fax: (403) 492-0714
-