I am studying your source code and I have a question about this method for the computation of the invariants in the Moments class:
def CalcInvariants(self): momrange=self.GetMomentSize()+1 self.invariants=[] for (i,j) in [(a,b) for a in range(momrange) for b in range(a+1)]: momtot=0 for k in range(-b,b+1,1): mom=self.GetMoment(i,j,k) if mom<>"VOID": momtot=mom.real**2+mom.imag**2 self.invariants.append([i,j,momtot])
Shouldn't the line momtot=mom.real**2+mom.imag**2 be momtot+=mom.real**2+mom.imag**2 instead?
momtot=mom.real**2+mom.imag**2
momtot+=mom.real**2+mom.imag**2
Thank you in advance,
Sebastian Daberdaku
You seem to have CSS turned off. Please don't fill out this field.
Anonymous
Yes - it looks like you're right. It certainly wouldn't make sense as it is. Thanks for pointing it out.
View and moderate all "General Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
I am studying your source code and I have a question about this method for the computation of the invariants in the Moments class:
Shouldn't the line
momtot=mom.real**2+mom.imag**2bemomtot+=mom.real**2+mom.imag**2instead?Thank you in advance,
Sebastian Daberdaku
Yes - it looks like you're right. It certainly wouldn't make sense as it is. Thanks for pointing it out.