 |
Creating ZERO sparce matrix, show and transpose with UJMP
Source code name: "lalgebra_sparse_show_jdml.py"
Programming language: Python
Topic: Linear Algebra/Matrices
DMelt Version 1.8. Last modified: 06/26/1971. License: Pro
https://datamelt.org/code/cache/lalgebra_sparse_show_jdml_7530.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from org.ujmp.core import SparseMatrix
from org.ujmp.core.util import MathUtil
# first matrix
m1=SparseMatrix.Factory.zeros(10000, 5000)
m1.setAsDouble(MathUtil.nextGaussian(), 0, 0)
m1.setAsDouble(MathUtil.nextGaussian(), 1, 1)
# second
m2=SparseMatrix.Factory.zeros(10000, 5000)
for i in range(10000):
m2.setAsDouble(MathUtil.nextGaussian(), MathUtil.nextInteger(0, 10000), MathUtil.nextInteger(0, 5000))
m1.setAsDouble(MathUtil.nextGaussian(), MathUtil.nextInteger(0, 10000), MathUtil.nextInteger(0, 5000))
m2.showGUI()
m3 = m1.mtimes(m2.transpose())
You see the box below because you did not login.