The thing is, i did not write that i need an exact integer solution because i don't like approximation, but because i am working in N^n and rounding can cause catastrophically false results. The matrices i am working on are, however, not all that big (i would guess absolute max 30x100, usually more like 5x20).
Am Freitag, 15. Juli 2016 21:11:07 UTC+2 schrieb Chris Rackauckas: > > You're not going to get good runtimes with this if you're using Rationals. > Each time a command is done, it needs to reduce the fraction. If you're > working with small examples like you show here, then yes this can be > worthwhile. However, even with good programming I don't think would scale > to something like 1000x1000 systems. > > That said, this OverflowError() is may be because you're overflowing the > integers? Try switching to Rational{BigInt} and see if you still get this > error. This will decrease the performance even more though. > > I know that being Mathematician the prospect of getting an exact answer > sounds nice, but there's a reason why it's not done very often. It's can > become orders of magnitude more computationally intensive than even precise > approximations. If you need something which is really precise, try > BigFloats or Decimals.jl. > > On Friday, July 15, 2016 at 11:50:01 AM UTC-7, Kurolong wrote: >> >> Hey Guys and Gals ^^ >> I'm having trouble with Julia. Maybe one of you can help me out >> The program i am writing requires the >> linear-equation-system-solver(command "\") in the folder >> "Julia-0.4.5\share\julia\base\linalg". >> Now my problem is that i need the equation solved strictly on integers, >> an approximate solution is of no use to me, which is why i tried working >> with the "Rational" Type. >> Curiously, the solver seems to work for the Rational Type if and only if >> no pivoting is required. Otherwise, the following Error is thrown: >> >> WARNING: pivoting only implemented for Float32, Float64, Complex64 and >> Complex128 >> ERROR: LoadError: OverflowError() >> in * at rational.jl:188 >> [inlined code] from linalg/generic.jl:471 >> in reflector! at no file:0 >> in A_ldiv_B! at linalg/qr.jl:346 >> in \ at linalg/qr.jl:398 >> in \ at linalg/dense.jl:450 >> in include at boot.jl:261 >> in include_from_node1 at loading.jl:320 >> while loading C:\users\<username >> omitted>\documents\julia-0.4.5\sg_project\v0.3\Test02.jl, in expression >> starting on line 3 >> >> Code to reproduce the Error: >> >> A=[[2//1,0//1] [3//1,3//2] [1//1,3//2]] >> v=[2//1,0//1] >> A\v >> >> Now i am under the impression that i could build a relatively simple >> workaround if i knew exactly where in the developer's code the actual >> problem is, but i am confused by the whole organization of the thing. >> Building my own solver could certainly be done, but this will most likely >> be ineffecient. Unfortunately, runtime is very important here, as the >> method i am currently devising is supposed to be embedded in some very >> expensive loops. >> >> I am a very unexperienced programmer and will likely not understand much >> programmertalk, but i am a mathematician and will probably have little >> problems in this respect. >> >> Maybe you have some ideas how to handle this problem. >> >> Thank you in advance for taking the time to look at my problem :) >> >