def store_variable(var)
      # Update the variable to track the index in the model
      index = @var_count + 1
      var.model = self
      var.index = index
      var.freeze
      @var_count += 1

      ret = LPSolve.add_columnex @ptr, 0, nil, nil
      fail if ret != 1

      # Set variable properties
      set_variable_type index, var.type

      ret = LPSolve.set_col_name(@ptr, index, var.name)
      fail if ret != 1

      ret = LPSolve.set_obj(@ptr, index, var.coefficient)
      fail if ret != 1

      set_variable_bounds index, var.lower_bound, var.upper_bound

      @variables << var
    end
def store_variable(var)
      # Update the variable to track the index in the model
      index = @var_count + 1
      var.model = self
      var.index = index
      var.freeze
      @var_count += 1

      ret = LPSolve.add_columnex @ptr, 0, nil, nil
      fail if ret != 1

      # Set variable properties
      set_variable_type index, var.type

      ret = LPSolve.set_col_name(@ptr, index, var.name)
      fail if ret != 1

      ret = LPSolve.set_obj(@ptr, index, var.coefficient)
      fail if ret != 1

      set_variable_bounds index, var.lower_bound, var.upper_bound

      @variables << var
    end
Save the variable to the model and update the variable pointers