Re: [ojAlgo-user] BasicMatrix get method is slow
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2016-01-21 08:01:27
|
If you want to se what goes on then run the code in a debugger. I’m guessing you have very complex structures inside your BasicMatrix instances because you create them “incorrectly” (repeated updates to individual elements). > Y.get(U_i, P_i, C_i).doubleValue(); That line of code indicates that you extract something other than a ‘double’ from the BasicMatrix instances - why? I recommended you before to switch to using PrimitiveDenseStore or maybe even ArrayAnyD<Double> instead of BasicMatrix. Why didn’t you? Did you read? https://github.com/optimatika/ojAlgo/wiki/Getting-Started /Anders > On 20 jan. 2016, at 17:40, Stathis Maroulis <sta...@gm...> wrote: > > 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 > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |