[ojAlgo-user] BasicMatrix get method is slow
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Stathis M. <sta...@gm...> - 2016-01-20 16:40:31
|
Hi, I am trying to create a Tensor API using Ojalgo as backend. Actually a 3D Tensor is an Arraylist of BasicMatrix objects. To get element i,j,k from a tensor, I actually getting the i,j entry from the k-th oject on the arraylist. If i try to loop through all elements of these BasicMatrix object, the time i need is noticeable more or using Java double[][] arrays. E.g. accessing all element(using a triple-loop) of a 2000x20000x10 (10 BasicMatrix objects of dimension 2000x20000), i need hours(!!!!) of waiting, while will Java double[][] i need seconds... (This is the arraylist i got: ArrayList<BasicMatrix> tensor; and this is how to get the items: Y.get(U_i, P_i, C_i).doubleValue(); ) Is this behavior normal? Am I doing something wrong? Thanks in advance. Stathis |