Created
February 5, 2016 04:24
-
-
Save ak64th/97a52334156ba026a2dc to your computer and use it in GitHub Desktop.
Call Jama Matrix from jython.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./bin/jython | |
Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11) | |
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_60 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import sys | |
>>> sys.path.append('Jama-1.0.3.jar') | |
>>> from Jama import Matrix | |
>>> array = [[1,2,3],[4,5,6],[7,8,9]] | |
>>> A = Matrix(array) | |
>>> b = Matrix.random(3,1) | |
>>> A.set(0,0,81) | |
>>> A.solve(b).print(5,2) | |
-0.02 | |
-2.01 | |
1.84 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment