Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2174 by [email protected]: LUdecompositionFF and det_bareis are
returning fractions
http://code.google.com/p/sympy/issues/detail?id=2174
LUdecompositionFF and det_bareis (determinant using bareis algorithms) are
very useful functions when the matrices are full of symbols. However, the
current implementations do not do a good job of dividing out the factors.
For example LUdecompositionFF has:
U[i,j] = (Ukk*U[i,j]-U[k,j]*Uik)/oldpivot
The theory guarantees that oldpivot divides Ukk*U[i,j]-U[k,j]*Uik, however
the sympy '/' does not go that deep.
det_bareis does:
D = M[k,k]*M[i,j] - M[i,k]*M[k,j]
D /= M[k-1,k-1]
M[i,j] = Poly.cancel(D)
Again, the theory guarantees that D has a denominator of 1, but Poly.cancel
does not complete the full division.
Therefore, I propose that that 'div' be used in both functions.
LUdecompositionFF would look like:
U[i,j] = div(Ukk*U[i,j]-U[k,j]*Uik),oldpivot,*symbols)[0]
det_bareis would look like:
D = div(D,M[k-1,k-1],*symbols)
Because div requires symbols to do the division, we would need to add them
as parameters to the functions
def LUdecompositionFF(self,*symbols):
...
def det_bareis(self,*symbols):
...
These changes will produce fraction free results (as expected), and yield
faster execution since div is fast.
thank you,
rosen diankov,
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.