LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sparse matrix memory limitations

Solved!
Go to solution

Hello All,

 

I am trying to utilize the Multicore and Sparse Matrix toolkit to creat an n x n identity matrix with n = 1048576. However, I receive a memory error. Is'nt the purpose of this toolkit to store sparse matrices using memory storage techniques? I would like to premultiply an n x 1 vector by an n x n diagonal matrix. Does anyone have any alternative approaches? 

0 Kudos
Message 1 of 8
(3,042 Views)

Jmountney,

First off, can you provide some more insight into what you are trying to do? 

 - Can you be more specific in what error you are receiving? Possible screenshots of the error window would be helpful

 - Can you send any screenshots of your code so we can see what you're trying to do?
 - Try running the Task Manager to see if it is Windows memory or LabVIEW memory that is running out

 - You can also try expanding the virtual memory of LabVIEW. To do this, go to this Knowledge Base article

Any information you can give us, the quicker we will be able to respond effectively.

Douglas Choisnet
0 Kudos
Message 2 of 8
(3,005 Views)

I want to multiply a 1048576 x 1 column vector by 1048576 x 1048576 identity matrix. I am using the special sparse matrix toolkit functions.The identity matrix will have over 1012 elements in it. There is obviously not enough memory on any PC that can store this many elements. However, sparse matrices are typically stored in other programming languages in a certain format that allows extemely large matrices to be used in calculations (i.e. in Mathematica, I can execute this process easily).  Below is the error I am receiving.

 

Error - 20001 occured ar NI_MASM_BasicLinAlglvlib:Creat Special Matrix (DBL).vi:2

Possible reason(s): Analysis: There is not enough memory to perform the specified routine.

 

snippet.png

 

0 Kudos
Message 3 of 8
(2,992 Views)

@jmountney wrote:

I want to multiply a 1048576 x 1 column vector by 1048576 x 1048576 identity matrix.

 

 


You know what the answer is going to be, right?

0 Kudos
Message 4 of 8
(2,988 Views)

Thank you, but this is just a test. I want to see if this toolkit is worth investing in before I move forward with my actual calculations. Right now I am collecting images in LabVIEW and then processing the results in Mathematica. I would like to do everything in LabVIEW if possible so I dont have to keep saving the image data and reopening and analyzing the data in Mathematica.

0 Kudos
Message 5 of 8
(2,985 Views)

Sometimes I find it faster to do what I was trying to do in LV inside Mathematica instead of the reverse, but I digress.

 

I have never looked at that toolkit, but what you have coming out of that function is a matrix so it is going to try to be a dense matrix.  Unless they are doing some under-the-hood magic (which would be cool, but I seriously doubt), you have the wrong function.  Perhaps there is a different VI to create a special sparse matrix.  Then you will probably have to use a special multiplication VI (not the built in primitive) to do the actual multiplication.

0 Kudos
Message 6 of 8
(2,979 Views)
Solution
Accepted by topic author jmountney

You are using the plain (=non-sparse)  matrix tools (just optimized for multicore).

 

The create special matrix (sparse) is in the "Sparse Linear Algebra" subpalette. It has a different icon.

Message 7 of 8
(2,976 Views)

Thank you altenbach. I did not notice the subpallette. This seems to be working fine now.

0 Kudos
Message 8 of 8
(2,968 Views)