def write_mps(filename)
      # Make a new model and ensure everything is added
      old_ptr = @ptr
      @ptr = new_model
      parent_update

      Cbc.Cbc_writeMps @ptr, filename.chomp('.mps')
      contents = Zlib::GzipReader.open(filename + '.gz').read
      File.delete(filename + '.gz')
      File.open(filename, 'w').write contents

      # Reset to the original model
      @ptr = old_ptr
      reset_model
    end
def write_mps(filename)
      # Make a new model and ensure everything is added
      old_ptr = @ptr
      @ptr = new_model
      parent_update

      Cbc.Cbc_writeMps @ptr, filename.chomp('.mps')
      contents = Zlib::GzipReader.open(filename + '.gz').read
      File.delete(filename + '.gz')
      File.open(filename, 'w').write contents

      # Reset to the original model
      @ptr = old_ptr
      reset_model
    end
Write the model to a file in MPS format