qttools.utils.inplace_utils#
source module qttools.utils.inplace_utils
Functions
-
compute_update_indices_sparse — Computes the indices for updating the system matrix.
-
compute_update_indices_dense — Computes the indices for updating the system matrix.
source compute_update_indices_sparse(M: sparse.csr_matrix, U: sparse.csr_matrix, destination_indexes: NDArray = None) → NDArray
Computes the indices for updating the system matrix.
Parameters
-
M : sparse.csr_matrix — The original system matrix.
-
U : sparse.csr_matrix — The update matrix to be applied.
-
destination_indexes : NDArray — The indices in the system matrix where the update should be applied.
Returns
-
target_indices : NDArray — The indices in the flattened system matrix corresponding to the update positions.
Raises
-
ValueError
source compute_update_indices_dense(M: sparse.csr_matrix, destination_indexes: NDArray = None) → NDArray
Computes the indices for updating the system matrix.
Parameters
-
M : sparse.csr_matrix — The original system matrix.
-
U : NDArray — The update matrix to be applied.
-
destination_indexes : NDArray — The indices in the system matrix where the update should be applied.
Returns
-
target_indices : NDArray — The indices in the flattened system matrix corresponding to the update positions.
Raises
-
ValueError