问题标签 [ujmp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
102 浏览

java - Logical Error in if else statement in java

My code:

Output:

The output that came that is not desired. The loop was terminated here after getting the timea[k1] == timeb[k2]. But I want after getting the similar element from timea and timeb the loop continue until all the elements of timea visit. As per my code it visits 1,2,3 from timea array and then discards. And this is very obvious because of while statement while (k1 < timea.length && k2 < timeb.length ). Because when it get loop counter k2++ k2 increment by 1. So after getting 3 from timeb k2 become 1.So when it get k2<timeb.length that means 1<1 which is false so the loop is terminated. But in that time {4,5,6} of timea is not visited. I want after executing else statement if statement executes again for {4,5,6}.

How can this be achieved?

Desired output:

0 投票
0 回答
32 浏览

java - 使用通用 java 矩阵包时出现内存不足错误

我正在使用 UJMP 矩阵包进行研究工作。我尝试根据我的研究要求添加一个带有稀疏矩阵的普通矩阵。

我收到了这个错误:

线程“主”java.lang.OutOfMemoryError 中的异常:org.ujmp.core.doublematrix.factory.DefaultDenseDoubleMatrix2DFactory.zeros 的 org.ujmp.core.doublematrix.impl.DefaultDenseDoubleMatrix2D.(DefaultDenseDoubleMatrix2D.java:64) 处的 Java 堆空间( DefaultDenseDoubleMatrix2DFactory.java:34) at org.ujmp.core.doublematrix.factory.DefaultDenseDoubleMatrix2DFactory.zeros(DefaultDenseDoubleMatrix2DFactory.java:30) at org.ujmp.core.doublematrix.stub.AbstractDenseDoubleMatrix2D.plus(AbstractDenseDoubleMatrix2D.java:121) 在 Part1ujmp .main(Part1ujmp.java:66)

谁能回答我 UJMP 矩阵可以容纳的最大维度是多少?

我认为这个错误是因为我没有足够的内存空间。

任何人都可以专门讨论这个错误。为什么它来了,有什么办法可以摆脱它?

谢谢是提前