Hi, 
How can I preallocate space for matrices (some symmetric, others asymmetric) if 
I have the global number of nonzeros (NNZ) but not the number of nonzeros per 
row? I could compute the NNZ for the upper or lower part separately if this 
would be useful for symmetric matrices.

I create the matrix this way:
    MatCreate(PETSC_COMM_WORLD, &M);
    MatSetSizes(M, PETSC_DECIDE, PETSC_DECIDE, N, N);
    MatSetFromOptions(M);
Klaus




Reply via email to