class_docstr: Declare an interface common to all supported algorithms.
  :class:`SampleMorris` uses this interface to call the algorithm
  defined by a ConcreteStrategy.
docstr: Computes the distance between each and every trajectory
  
  Each entry in the matrix represents the sum of the geometric distances
  between all the pairs of points of the two trajectories
  
  If the `groups` argument is filled, then the distances are still
  calculated for each trajectory,
  
  Parameters
  ----------
  input_sample : numpy.ndarray
      The input sample of trajectories for which to compute
      the distance matrix
  num_samples : int
      The number of trajectories
  num_params : int
      The number of factors
  num_groups : int, default=None
      The number of groups
  local_optimization : bool, default=False
      If True, fills the lower triangle of the distance matrix
  
  Returns
  -------
  distance_matrix : numpy.ndarray
docstr_tok: ["Computes","the","distance","between","each","and","every","trajectory","Each","entry","in","the","matrix","represents","the","sum","of","the","geometric","distances","between","all","the","pairs","of","points","of","the","two","trajectories","If","the","`","groups","`","argument","is","filled",",","then","the","distances","are","still","calculated","for","each","trajectory",",","Parameters","--","--","--","--","--","input_sample",":","numpy.ndarray","The","input","sample","of","trajectories","for","which","to","compute","the","distance","matrix","num_samples",":","int","The","number","of","trajectories","num_params",":","int","The","number","of","factors","num_groups",":","int",",","default=None","The","number","of","groups","local_optimization",":","bool",",","default=False","If","True",",","fills","the","lower","triangle","of","the","distance","matrix","Returns","--","--","--","-","distance_matrix",":","numpy.ndarray"]
code: def compute_distance_matrix(
      self,
      input_sample,
      num_samples,
      num_params,
      num_groups=None,
      local_optimization=False,
  ):
      """Computes the distance between each and every trajectory
  
      Each entry in the matrix represents the sum of the geometric distances
      between all the pairs of points of the two trajectories
  
      If the `groups` argument is filled, then the distances are still
      calculated for each trajectory,
  
      Parameters
      ----------
      input_sample : numpy.ndarray
          The input sample of trajectories for which to compute
          the distance matrix
      num_samples : int
          The number of trajectories
      num_params : int
          The number of factors
      num_groups : int, default=None
          The number of groups
      local_optimization : bool, default=False
          If True, fills the lower triangle of the distance matrix
  
      Returns
      -------
      distance_matrix : numpy.ndarray
  
      """
      if num_groups:
          self.check_input_sample(input_sample, num_groups, num_samples)
      else:
          self.check_input_sample(input_sample, num_params, num_samples)
  
      index_list = self._make_index_list(
          num_samples, num_params, num_groups
      )
      distance_matrix = np.zeros(
          (num_samples, num_samples), dtype=np.float32
      )
  
      for j in range(num_samples):
          input_1 = input_sample[index_list[j]]
          for k in range(j + 1, num_samples):
              input_2 = input_sample[index_list[k]]
  
              # Fills the lower triangle of the matrix
              if local_optimization is True:
                  distance_matrix[j, k] = self.compute_distance(
                      input_1, input_2
                  )
  
              distance_matrix[k, j] = self.compute_distance(
                  input_1, input_2
              )
      return distance_matrix
  
file_path: SALib/src/SALib/sample/morris/strategy.py
imports: import abc
  import numpy
  from scipy.spatial.distance import cdist
label_desc: Use image node_id 8 for calling the Strategy obj's underlying member method code with example usage: obj.compute_distance_matrix(input_sample, num_samples, num_params, num_groups, local_optimization) and returns: distance_matrix