MathGroup Archive 2004

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

Search the Archive

Re: Conditonal sum

  • To: mathgroup at
  • Subject: [mg50285] Re: [mg50263] Conditonal sum
  • From: "Wolf, Hartmut" <Hartmut.Wolf at>
  • Date: Tue, 24 Aug 2004 06:22:36 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

>-----Original Message-----
>From: Christopher Grinde [mailto:christopher.grinde at]
To: mathgroup at
>Sent: Monday, August 23, 2004 12:35 PM
>To: mathgroup at
>Subject: [mg50285] [mg50263] Conditonal sum
>I am new to mathematica and could really need a tip on how to 
>implement a 
>conditional sum.  Pseudocode would be something like this
>if j in Sm:
>	EndSum=EndSum+f[j]
>I have tried doing this by using an If-clause inside the 
>sum-function, but  
>this seems little elegant and is nor very suitable for 
>symbolic calculations.
>Any advice would be highly appreciated
>Christopher Grinde

Don't quite understand your case, just guessing, would

   Plus @@ f /@ Sm 

do it?


  • Prev by Date: Re: Conditonal sum
  • Next by Date: Random rook's tour of a rectangle
  • Previous by thread: Re: Conditonal sum
  • Next by thread: Re: Conditonal sum