A gist would be helpful. By the way, which version of Julia are you running?
2014-03-25 16:19 GMT+01:00 James Crist <[email protected]>: > I'm probably not. New to this language, still figuring things out. The > matrix type seems to be inferred correctly though. I'll put a gist up in a > bit to try and get some more relevant feedback. > > > On Tuesday, March 25, 2014 9:54:53 AM UTC-5, Andreas Noack Jensen wrote: > >> I don't think you are right about LAPACK. The code tries to promote to a >> type which is stable under lu factorizing which is the intermediate step in >> the calculation. The problem could be that your matrix type is not inferred >> correctly. Please try to let your type by subtype of Number and then define >> your matrix by >> >> a = Mytype[mytype(1) mytype(2); mytype(3) mytype(4)] >> >> and see if it works. >> >> >> 2014-03-25 15:29 GMT+01:00 James Crist <[email protected]>: >> >> Yeah, I get a "ERROR: no method Triangular{..." error, because my type >>> doesn't subtype Number. If I do subtype number, then it wants a conversion >>> function to convert it to a float, so it can use the LAPACK routines. >>> >>> -Jim >>> >>> >>> On Tuesday, March 25, 2014 9:22:29 AM UTC-5, Andreas Noack Jensen wrote: >>> >>>> Have you tried to invert it? Maybe it works already. There is a generic >>>> inv in base/linalg/generic.jl. You'll have to define a one method for you >>>> type and maybe also a zero method. >>>> >>>> >>>> 2014-03-25 15:14 GMT+01:00 James Crist <[email protected]>: >>>> >>>> I have a type I've defined. It's not a number, but it has all >>>>> arithmetic operations defined for it. Is there a way to calculate the >>>>> inverse of a matrix of a user defined type? For example, if I was to >>>>> define: >>>>> >>>>> a = [mytype(1) mytype(2); mytype(3) mytype(4)] >>>>> b = inv(a) >>>>> >>>>> Looking through base, there doesn't seem to be a way to find inverses >>>>> of non-numeric matrices (although I may be missing it). For my case, even >>>>> a >>>>> simple algorithm that only works well for small matrices (<10x10) would be >>>>> more than sufficient. If a way for doing this doesn't currently exist, >>>>> I'll >>>>> probably try to roll my own. >>>>> >>>> >>>> >>>> >>>> -- >>>> Med venlig hilsen >>>> >>>> Andreas Noack Jensen >>>> >>> >> >> >> -- >> Med venlig hilsen >> >> Andreas Noack Jensen >> > -- Med venlig hilsen Andreas Noack Jensen
