Insert sparse matrix into another matrix

29 views
Skip to first unread message

Marko Batic

unread,
Sep 9, 2014, 10:24:16 AM9/9/14
to la...@googlegroups.com

Hi,

I am using La4j for working with sparse matrices. I need to insert a sparse matrix (A) into another sparse matrix (B) starting at specific location (i,j). Basically, what I need is an opposite operation from the slice(arg0, arg1, arg2, arg3) method.

 I could write a function based on mat.eachNonZero(arg0) and mat.set(arg0, arg1, arg2) methods, to take the advantage of features for sparse matrices, but was wondering if there is already another way of doing this, using the current API to be sure I am getting the best possible performance (I am not a skilled programmer L)?

Thank you in advance.

Best,

Marko

Vladimir Kostyukov

unread,
Sep 10, 2014, 3:30:45 AM9/10/14
to Marko Batic, la...@googlegroups.com
Hi Marko,

Thanks for using the la4j library. There is already a ticket about such method. This should be handled in 0.6.0 release. Anyway, your solution based on eachNonZero method is probably the best way to do that using the current API.
--
Thanks,
Vladimir Kostyukov
Reply all
Reply to author
Forward
0 new messages