On Mon, Sep 1, 2014 at 4:10 AM, Florian Lindner <[email protected]> wrote:
> Hello, > > I want to set the entire column of a N x M matrix to a N vector. What is > the best way to do that? > > My first guess would be to VecGetArray and use that array for > MatSetValuesLocal with nrow = VecGetLocalSize. What is the best to say > MatSetValuesLocal that I want to set all rows continuesly (same like > passing irow = [0, 1, ..., VecGetLocalSize-1]? > > Any better way? > You are assuming dense storage above, so you can use http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatDenseGetArray.html Matt > Thanks, > Florian > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
