ujmp

Logical Error in if else statement in java

こ雲淡風輕ζ 提交于 2020-01-06 09:03:05
问题 My code: import org.ujmp.core.Matrix; import org.ujmp.core.SparseMatrix; public class part { public static void main(String args[]) throws Exception{ Matrix Bigomega=Matrix.Factory.zeros(6,6); Matrix omega = SparseMatrix.Factory.zeros(6, 6); int []timea={1,2,3,4,5,6}; int [] timeb={3}; int k1=0,k2=0; while (k1 < timea.length && k2 < timeb.length ) { if (timea[k1] < timeb[k2]) { omega.setAsInt(1, k1, k1); omega.setAsInt(-1, k1, k1 + 1); omega.setAsInt(-1, k1 + 1, k1); omega.setAsInt(1, k1 + 1,

UJMP Java library for sparse matrix

倾然丶 夕夏残阳落幕 提交于 2019-12-11 05:06:48
问题 I have downloaded and included UJMP (Universal Java Matrix Package) library to my project for generating sparse matrix. But I could not find any documentation about functions of the library, how to create a sparse matrix, adding element to matrix etc. Is there anyone experienced about it or have a documentation about the library? Thank you for all. 回答1: There is a la4j library that supports sparse matrices and vectors. Follow the examples given at official site. la4j supports CRS (Compressed