class_docstr: @brief Genetic algorithm math API.
docstr: !
  @brief Update the last same probabilities to one.
  @details All values of probability list equals to the last element are set to 1.
code: def set_last_value_to_one(probabilities):
      """!
      @brief Update the last same probabilities to one.
      @details All values of probability list equals to the last element are set to 1.
  
      """
  
      # Start from the last elem
      back_idx = -1
  
      # All values equal to the last elem should be set to 1
      last_val = probabilities[back_idx]
  
      # for all elements or if a elem not equal to the last elem
      for _ in range(-1, -len(probabilities) - 1):
          if probabilities[back_idx] == last_val:
              probabilities[back_idx] = 1
          else:
              break
  
file_path: pyclustering/pyclustering/cluster/ga_maths.py
imports: import numpy
label_desc: Use image node_id 6 for calling the ga_math obj's underlying member method code with example usage: obj.set_last_value_to_one(probabilities) without return types