clearing a variable: Gauss Ellimination
-
I am using a temporary variable to store some temporary values, which I will not be required to use once I have done some operation. Can I kill them (clear from memory) those variables once I am done with them. I am trying to get an inverse of a 1000*1000 size, so I am using a lot of temporary variables for Gauss Elimintion process. Will I be able to decrease the computation time required if I am to clear those variables from memory? Regards, Amit
-
I am using a temporary variable to store some temporary values, which I will not be required to use once I have done some operation. Can I kill them (clear from memory) those variables once I am done with them. I am trying to get an inverse of a 1000*1000 size, so I am using a lot of temporary variables for Gauss Elimintion process. Will I be able to decrease the computation time required if I am to clear those variables from memory? Regards, Amit
If it doesn't have a dispose method, you can't clear it. You should look for calculations that get repeated and see if you can replace them with a lookup table. Christian Graus - Microsoft MVP - C++
-
I am using a temporary variable to store some temporary values, which I will not be required to use once I have done some operation. Can I kill them (clear from memory) those variables once I am done with them. I am trying to get an inverse of a 1000*1000 size, so I am using a lot of temporary variables for Gauss Elimintion process. Will I be able to decrease the computation time required if I am to clear those variables from memory? Regards, Amit
amitmohanty wrote: Will I be able to decrease the computation time required if I am to clear those variables from memory? how?? Unless you consume so much memory that you cause system to swap (which I doubt in this case), I fail to see how this will speed up computation?? Memory consumption and time go against each other... besides AFAIK GC is optimized for cleaning small local varibles, so even if you could clear em yourself, maybe it wouldn't be the best idea. OT: I see you keep working with matrices... it would be nice topic for an article :) David