def save_solution
      # Check and store the model status
      if Cbc.Cbc_isProvenOptimal(@ptr) == 1
        status = :optimized
      elsif Cbc.Cbc_isProvenInfeasible(@ptr) == 1 ||
            Cbc.Cbc_isContinuousUnbounded(@ptr) == 1
        status = :invalid
      else
        status = :unknown
      end

      if status == :optimized
        objective_value = Cbc.Cbc_getObjValue @ptr
        dblptr = Cbc.Cbc_getColSolution @ptr
        variable_values = dblptr.read_array_of_double(@variables.length)
      else
        objective_value = nil
        variable_values = []
      end

      @solution = Solution.new status, objective_value, variable_values
    end
def save_solution
      # Check and store the model status
      if Cbc.Cbc_isProvenOptimal(@ptr) == 1
        status = :optimized
      elsif Cbc.Cbc_isProvenInfeasible(@ptr) == 1 ||
            Cbc.Cbc_isContinuousUnbounded(@ptr) == 1
        status = :invalid
      else
        status = :unknown
      end

      if status == :optimized
        objective_value = Cbc.Cbc_getObjValue @ptr
        dblptr = Cbc.Cbc_getColSolution @ptr
        variable_values = dblptr.read_array_of_double(@variables.length)
      else
        objective_value = nil
        variable_values = []
      end

      @solution = Solution.new status, objective_value, variable_values
    end
Save the solution to the model for access later