[petsc-users] more flexible MatSetValues?

Gong Ding gdiso at ustc.edu
Sat Feb 19 02:25:55 CST 2011


Hi,
After reading the source code of aij.c, I think the MatSetValues function can be more flexible when preallocation is not correct.

Why not use a dynamic array such as c++ vector of triple(a, i, j) to buffer the operation?
And flush the buffer to real a,i,j array when MatAssemblyEnd is called?

Gong Ding


More information about the petsc-users mailing list