vectorMatrixFunctions.py

Define standard vector and matrix functions.

petgem.efem.vectorMatrixFunctions.crossprod(x, y)[source]

Compute cross product of two arrays.

Parameters:
  • x (float-array) – array1.
  • y (float-array) – array2.
Returns:

cross product.

Return type:

ndarray.

petgem.efem.vectorMatrixFunctions.deleteDuplicateRows(matrix)[source]

Delete duplicate rows in a matrix.

Parameters:matrix (ndarray) – input matrix to be processed.
Returns:matrix without duplicate rows
Return type:ndarray
petgem.efem.vectorMatrixFunctions.findUniqueRows(array, return_index=False, return_inverse=False)[source]

Find unique rows of a two-dimensional numpy array.

Parameters:
  • ndarray – array to be processed.
  • return_index (bool) – the indices of array that result in the unique array.
  • return_inverse (bool) – indices of the unique array that can be used to reconstruct array.
Returns:

unique rows.

Return type:

ndarray.

petgem.efem.vectorMatrixFunctions.is_duplicate_entry(x)[source]

Compute number of duplicate entries in a vector.

Parameters:x (int-array) – matrix.
Returns:number of duplicate entries.
Return type:int.
petgem.efem.vectorMatrixFunctions.unitary_test()[source]

Unitary test for vector_matrix_functions.py script.