Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Evaluation Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76520] Re: Evaluation Question
  • From: dimitris <dimmechan at yahoo.com>
  • Date: Wed, 23 May 2007 05:31:55 -0400 (EDT)
  • References: <f2u57d$k2n$1@smc.vnet.net>

Hi.

Your function

f[a_, b_, c_] := a + b + c

Create your list of points.

Tuples[{0, 1}, 3]
{{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {0, 1, 1}, {1, 0, 0}, {1, 0, 1}, {1,
1, 0}, {1, 1, 1}}

And here is the requested evaluation

f@@@lst
{0,1,1,2,1,2,2,3}

Cheers
Dimitris

PS1

In[22]:=
Information["Tuples", LongForm -> False]

"Tuples[list, n] generates a list of all possible n-tuples of elements
from list. Tuples[{list1, list2, ... }] generates a list \
of all possible tuples whose ith element is from listi."*Button[More...,
ButtonData :> "Tuples", Active -> True,
   ButtonStyle -> "RefGuideLink"]

PS2

f@@@lst is the operator form of Apply[f,lst,{1}]

 /  hoffmannick       :
> Can anyone help me solve the following problem?
>
> I have a function of 3 variables, let's say
> f[a_, b_, c_] = a + b + c
>
> Now I need to evaluate the function at some given points.  To evaluate
> at a single point I would do
> f[0,0,1]
>
> For the point (0,0,1)
>
> Now here is the main question.
> I need to evaluate this function at the points (0,0,0) through (1,1,1)
> That would be the points:
> 0,0,0
> 0,0,1
> 0,1,0
> 0,1,1
> 1,0,0
> 1,0,1
> 1,1,0
> 1,1,1
>
> I'm testing these for approx 32 different functions.  Is there an easy
> way that I can define the function and then have it test all the
> points for me?  It will always be those finite points listed above.
>
> I looked into the mathematica documentation and it said how to do this
> with a function of a single variable, but it didn't say how to do it a
> function of more than one variable.
>
> I really appreciate your help



  • Prev by Date: Re: Re: Mathematica 6 review [first impressions]
  • Next by Date: Re: Hankel transformation // Fourier transformation for a circular function
  • Previous by thread: Re: Evaluation Question
  • Next by thread: Re: Evaluation Question