"""
Lightweight Java sparse/dense matrix library
See La4j for detail
The la4j is open source and 100% Java library that provides Linear Algebra primitives (matrices and vectors) and algorithms. The la4j was initially designed to be lightweight and simple tool for passionate Java developers. It has been started as student project and turned into one of the most popular Java packages for matrices and vectors.
The key features of the la4j are listed bellow:
- Great performance allied with beautiful design
- No dependencies and tiny size (~150kb jar)
- Fluent object-oriented/functional API
- Sparse (CRS, CCS) and dense (1D/2D arrays) matrices
- Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other)
- Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other)
- MatrixMarket/CSV IO formats support for matrices and vectors
"""
from org.la4j.matrix.dense import *
from org.la4j.matrix.sparse import *
from org.la4j.matrix import *
print "Dense matrix"
m=Basic2DMatrix.from2DArray([[1.0, 2.0, 3.0 ], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]])
m.multiplyByItsTranspose()
print m