1

I'm trying to work out the modular inverse of a matrix, how could this be done in Java?

So far I've found the package Jama package - http://math.nist.gov/javanumerics/jama/ Can be used for inverse and matrix multiplication, however I'm stumped trying to find the mouldar inverse of a matrix...

This is exactly what I am trying to achieve here: http://planetcalc.com/3324/

Any ideas?

Thanks

Java Noob
  • 67
  • 1
  • 6
  • Are you trying to implement the algorithm yourself, or are you looking for a library that will do it for you? – Dawood ibn Kareem Oct 29 '14 at 00:18
  • Either option. I don't have the knowledge to implement the algorithm myself so found myself looking for a library that could do it for me. – Java Noob Oct 29 '14 at 10:07
  • OK. The mathematics is fairly complicated if you don't know what you're doing, and I don't know where to start looking for a library for this - it's highly specialised. Probably your best bet is to get the Javascript from that page that you linked to, and try to convert it to Java. – Dawood ibn Kareem Oct 29 '14 at 18:07

1 Answers1

-1

You can look at this package:

https://code.google.com/p/jmatharray/

I see it supports inverse, but not sure out modular inverse.

There is also this library which is well supported and supports several variations of inverse:

http://commons.apache.org/proper/commons-math/userguide/linear.html

chubbsondubs
  • 37,646
  • 24
  • 106
  • 138