/* * * Created on: Sep 25, 2017 * Author: Fande Kong */ static char help[] = "Illustrate the use of MatResetPreallocation.\n"; #include "petscmat.h" int main(int argc,char **argv) { Mat A; MPI_Comm comm; PetscInt n=5,m=5,*dnnz,*onnz,i,rstart,rend,M,N; PetscFunctionBeginUser; PetscCall(PetscInitialize(&argc,&argv,0,help)); comm = MPI_COMM_WORLD; PetscCall(PetscMalloc2(m,&dnnz,m,&onnz)); for (i=0; i