"""
Code example
This example shows how to create a matrix and perform a number of operations.
Look at the Java matrix documentation
"""
from Jama import Matrix
array = [[1.,2.,3],[1.,2.,3.],[1.,2.,3.]];
a = Matrix(array)
b = Matrix([[0.,1.,3],[1.,2.,3.],[3.,2.,5.]])
c=b.times(a)
print c.toString()
B = Matrix.random(5,5)
print B.toString()
T = B.transpose()
print "Transpose=\n",T.toString()
C=B.inverse()
print "Inverse=\n",C.toString()
C=B.det()
print "Determinant=\n",C
print dir(B) # show methods
Ads help maintain this website.