Gmail Calendar Documents Web Sites more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Maple: extracting data from sets of sets

View parsed - Show only message text

Path: g2news2.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Axel Vogt <&nore...@axelvogt.de>
Newsgroups: comp.soft-sys.math.maple
Subject: Re: Maple: extracting data from sets of sets
Date: Sat, 27 Feb 2010 17:12:48 +0100
Organization: none
Lines: 30
Message-ID: <7usultFomkU1@mid.individual.net>
References: <thbin.150139$zD4.85555@newsfe19.ams2>
Reply-To: &nore...@axelvogt.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net SplaoL0xohmbMTjeuJ4rXwJwO188jiuP8tinJvexWJuVq6oIY=
Cancel-Lock: sha1:i5HnGraNAOVsBlJ1W9cuQTY2Y5w=
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
In-Reply-To: <thbin.150139$zD4.85555@newsfe19.ams2>

Roger Kopler wrote:
> Hi,  I have a question about extracting data from a set to be used in a 
> function.  Suppose I have an object of the sort:
> 
> X:={{a=3,b=-3},{a=2,b=2},{a=0,b=3},{a=2,b=-4},{a=0,b=2},{a=2,b=0}};
> 
> and a function of the sort:
> 
> f:=(a,b)->a+b*sqrt(2);
> 
> How can I extract the values in the pairs (a,b) in X and use them in the 
> function f to create a set of 6 elements, i.e. {f(a,b) where {a,b} in X} 
> (and, no, I don't want to do this manually because I want to apply this 
> procedure, if it exists, to a set X containing a much larger number of 
> elements than 6)
> 
> Any help would be much appreciated.  Thanks in advance. 

   eval(f(a,b),op(1,X)); # uses the 1st equation in X

                                    1/2
                                 2 2

and by running to all of them gives you all, for example

   {seq( eval(f(a,b),op(j,X)), j=1 .. nops(X))};

or

   {seq( eval(f(a,b),xi), xi in X)};

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google