[petsc-dev] Matlab writes dense matrices as vectors

Jed Brown jedbrown at mcs.anl.gov
Thu Apr 19 12:16:06 CDT 2012


On Thu, Apr 19, 2012 at 07:52, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
> On Apr 19, 2012, at 9:06 AM, Jed Brown wrote:
>
> > It writes the whole thing as one vector, should we require the caller to
> reshape to clearly identify it as a vector? Then anything with multiple
> columns could be written as a matrix (e.g. by internally calling sparse()).
>
>    I cannot remember why I defaulted to this behavior.  (Probably for
> people using DMDA and automatically reshaping a read in vector into its
> DMDA defined shape and then later wanting to save that as a vector). I
> guess it might be more intuitive to change it as you suggest.
>

It was a size mismatch in that case anyway, so I chose this rather than an
implicit reshape. Dense row and column vectors are both written as vectors.

http://petsc.cs.iit.edu/petsc/petsc-dev/rev/03d36104f143
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120419/c5de1d8d/attachment.html>


More information about the petsc-dev mailing list