Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Peter Pearson Newsgroups: comp.lang.python Subject: Re: Representing mathematical equations Date: 6 Oct 2014 16:45:07 GMT Lines: 36 Message-ID: References: <9ea5c61c-9f06-4bcb-982e-2be0a910b817@googlegroups.com> <09669ac4-1aeb-48fa-8cc9-7f741f7fe6b3@googlegroups.com> <28aeb1c6-2a2f-4452-862d-c98b204eab34@googlegroups.com> X-Trace: individual.net qdeLO+vyoSopMA37V0tglQwoJ+EBE5nxtri5ZiHio7BiYtXkmk Cancel-Lock: sha1:6WDrki/Ib1O90C5Xx5u1Xk2G6q4= User-Agent: slrn/pre1.0.0-18 (Linux) Xref: csiph.com comp.lang.python:78771 On Mon, 06 Oct 2014 08:42:01 -0600, Michael Torrie wrote: > On 10/06/2014 07:07 AM, varun7rs@gmail.com wrote: >>> Okay, I forgot to explain them. L is a set of links, dist is a >>> number (distance), bd is the bandwidth and hc is a number as well >>> (hopcount)...different bandwidths, hopcounts and distances for different >>> links... b(i,x) is what i intend to calculate out of these details...here >>> 'i'could be the head or tail of the link l and x is a node that hosts i >>> Thank You >> >> Unbelievable. I again forgot to express them >> L = [(1,3), (5,7), .....] >> bd = [23, 34,43.44.....] >> dist = [3,7,5,7, ....] >> hc = [2,3,4,1,2,2,...] >> for every l belonging to L, i could be either 1 or 3 for L[0], similarly >> for L[1] it could be 5 or 7 > > You might want to ask on the scipy mailing list[1]. I'm sure the folks > over there deal with complex sums and math all the time. Numpy > (standalone, or as part of scipy) has some facilities for working with > vectors, products, and summations in an efficient manner. I don't think the OP is interested in complex numbers. I think this is a question about organizing loops. But I can't tell for sure. My guess is that l is one of the pairs in L, and that i is one of the elements in l, or perhaps both in succession. OP hints that "x is a node that hosts i", but how that affects the right-hand side of the equation defining the quantity to be computed, which is lost in the history of this thread, is unclear. There's a lesson here for the OP, varun7rs: If your initial query had been clear and complete, you would have your answer by now. -- To email me, substitute nowhere->runbox, invalid->com.