[petsc-users] Round-off / Machine Zero with MatMult
Matthew Knepley
knepley at gmail.com
Fri Jun 17 15:06:51 CDT 2016
On Fri, Jun 17, 2016 at 2:47 PM, Paul Urbanczyk <gomer at stanford.edu> wrote:
> Hello all,
>
> I'm using PETSc's "MatMult" function - MatMult(Mat A, Vec x, Vec y) - to
> do a matrix-vector multiply. The Matrix, A, is anti-symmetric, and the
> vector, x, is uniform. Thus, the resulting vector, y, should be all zeros.
>
> The output I'm seeing typically looks like the following:
>
> Vec Object: Vec_0x20b2000_2 1 MPI processes
> type: mpi
> Process [0]
> 0.
> 0.
> -2.08167e-17
> -2.08167e-17
> -2.08167e-17
> -2.08167e-17
> -2.08167e-17
> -2.08167e-17
> 0.
> 0.
>
> Now, I know that -2.08167e-17 is machine zero, but I'm a bit confused why
> a few of the entries would be exactly zero while others are "machine zero."
> I would expect them all to be either exactly zero, or machine zero, but not
> a mixture. Do you have any idea why this might be?
>
The order of addition matter for roundoff errors.
Thanks,
Matt
> Thanks for your help!
>
> -Paul
>
--
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/20160617/4ba8a42d/attachment.html>
More information about the petsc-users
mailing list