This project has moved and is read-only. For the latest updates, please go here.

Erase matrix from memory

Nov 5, 2010 at 12:30 PM

Is there any way to erase a matrix from memory? Thanks

Nov 8, 2010 at 4:17 AM

.NET programs are garbage collected. When your matrix object goes out of scope, the .NET Framework will be able to free the memory it used, and will do so when it needs to.

Is there a particular scenario you have that requires deterministic deletion?

Nov 8, 2010 at 2:52 PM

Well, I mean something like the ERASE Statment (Erase arraylist) in VB.NET


Nov 8, 2010 at 8:21 PM

VB's ERASE statement is equivlent to assigning Nothing to the variable. So, for example:

Dim A as New SquareMatrix(100)
' having allocated A, we can now assign values to the entries
' and work with it for a while
A = Nothing
' the memory previously used to store all those entries
' has now been released; the program can continue
' but any operations on A will fail

So, yes, you can do this with Meta.Numerics (or any other) types.