02-19-2014 02:04 PM
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?
Solved! Go to Solution.
02-20-2014 09:12 AM
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.
02-20-2014 12:42 PM
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.
02-20-2014 01:04 PM
@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?
02-20-2014 01:16 PM
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.
02-20-2014 01:26 PM
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.
02-20-2014 01:30 PM - edited 02-20-2014 01:31 PM
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.
02-20-2014 01:38 PM
Thank you altenbach. I did not notice the subpallette. This seems to be working fine now.