Function CreateL

Function Documentation

PetscErrorCode CreateL(MPI_Comm COMM, char indexname[], PetscInt local_nrow, PetscInt global_nrow, PetscBool trunc, Mat *L)

Creates a diagonal matrix with the weights as the entries.

Parameters
  • COMM: The MPI communicator, PETSC_COMM_SELF.A
  • local_nrow: Number of rows for this rank
  • local_row0: The starting row for this rank.
  • global_nrow: The total length of the weights vector (N). L is NxN.
  • *L: The matrix created by this function.