On Sep 6, 5:15 pm, Vinzent Steinberg <vinzent.steinb...@googlemail.com> wrote: > On Sep 5, 10:29 pm, Bryan <alke...@gmail.com> wrote: > > > Thats exactly what I am trying to do, solve symbolic matrices which > > have numeric coefficients along symbols, thus I would like the numeric > > coefficients to be treated as floats to speed things up a bit. > > > The documentation says that it is generally the case that exact > > arithmetic > > is used, so I was wondering how to tap into the non-general case > > of having my numbers treated as floats. > > > But it appears to me that this is just the case of misleading > > documentation > > then? > > Please feel free to improve our documentation. :) > > Actually it is quite easy to mix symbols and floating point > arithmetic, just use sympy.Float for your coefficients: > > >>> from sympy import * > >>> var('a:d') > (a, b, c, d) > >>> m = Matrix([[Float('0.1')*a, Float('0.2')*b], [Float('0.3')*c, > >>> Float('0.4')*d]]) > >>> m > > [0.1*a, 0.2*b] > [0.3*c, 0.4*d] > > I'm not sure that it will be much faster though.
Of course you get the problem that the algorithm is probably not numerically stable. Vinzent -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.