Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. clearing a variable: Gauss Ellimination

clearing a variable: Gauss Ellimination

Scheduled Pinned Locked Moved C#
performancequestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amitmohanty
    wrote on last edited by
    #1

    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

    C D 2 Replies Last reply
    0
    • A amitmohanty

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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++

      1 Reply Last reply
      0
      • A amitmohanty

        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

        D Offline
        D Offline
        DavidNohejl
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups