If you do want to do this with a dense matrix then just use MatGetArray() to
directly access the matrix entries. Then you can skip the MatGetColumn() and
MatSetValues() stuff.
But I agree with Matt that generally if you are doing orthogonalization it is a
set of vectors you are doing it to. You then decide if you want to represent
that collection of vectors as a dense matrix (which is the Matlab way) or as an
array of vectors.
Barry
On May 18, 2010, at 4:08 AM, Matthew Knepley wrote:
> On Tue, May 18, 2010 at 3:58 AM, Umut Tabak <u.tabak at tudelft.nl> wrote:
> Matthew Knepley wrote:
> 1) This must be a dense matrix, so you could directly copy in the values with
> a strided loop
>
> Dear Matt,
> Thanks for the immediate reply, I guess I did not understand this.
>
> 2) Is there a reason for the output to be a matrix, rather than a collection
> of vectors?
>
> Collection of vectors? not sure on this point. After the orthogonalization, I
> extract some parts of the matrix and continue operation with these extracted
> parts. Are there better ways of conducting operations for these kinds of
> tasks?
>
> Well, you generally do not want the parallel organization of a MPIDENSE when
> you make
> these sorts of updates. You want to access 1 column at a time, with the
> layout of a vector.
> Thus is generally makes more sense to me to use a Vec[] than a MPIDENSE.
>
> Matt
>
> --
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100518/3d5d8eac/attachment.htm>