Re: calculate de Jong function
- To: mathgroup at smc.vnet.net
- Subject: [mg57008] Re: [mg56969] calculate de Jong function
- From: "Christoph Lhotka" <lhotka at astro.univie.ac.at>
- Date: Thu, 12 May 2005 02:33:13 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi! f[x_List] := Sum[x[[i]]^2, {i, 1, Length[x]}] or f[x_List] := Plus@@x^2 since Powers are Listable with kind regards On Wed, 11 May 2005 05:24:54 -0400 (EDT) Stefan Schuster <bi1169*delete_from_star_to_star* at fh-weihenstephan.de> wrote: > Hello, > > I don't know how I should implement the first de jong function: > > f(x)=Sum((x_i)^2) > where x is a Vector with n dimensions and x_i is the value of the i-th > Dimension. > i.e. all Values of the Vector are squared and added. > > My problem is that I don't know how many Dimensions there are, so I > can't define the borders of the SUM function. > > thanks in advance for help > > Stefan > -- Christoph Lhotka -- University of Vienna Institute for Astronomy