Month: July 2012


  • Gams code snippet for checking consistency of a matrix

    In an earlier post, I showed how to include code snippets in your program. One of the most important principles of programming is the DRY principle: Don’ Repeat Yourself. Code snippets can be used to do stuff you have to code over and over again.
    One such a task for me is checking if the row and column totals in a matrix are equal (for example in the input output table you use, you want to check if supply is equal to demand).
     
    Here is the code snippet:
     
     
    Now you can batinclude (meaning that you can pass
    Read the rest “Gams code snippet for checking consistency of a matrix”


Categories

Name *

Email *