add obtain_from_generic() method and improve print_result() in CGradientResult class